export isl_basic_set_project_out
[isl.git] / isl_mat.h
blob6e44a96c767f1b8a3d3d9634e979268f27f54c30
1 #ifndef ISL_MAT_H
2 #define ISL_MAT_H
4 #include <stdio.h>
6 #include <isl_int.h>
7 #include <isl_ctx.h>
8 #include <isl_blk.h>
9 #include <isl_set.h>
10 #include "isl_vec.h"
12 #if defined(__cplusplus)
13 extern "C" {
14 #endif
16 struct isl_mat {
17 int ref;
19 struct isl_ctx *ctx;
21 #define ISL_MAT_BORROWED (1 << 0)
22 unsigned flags;
24 unsigned n_row;
25 unsigned n_col;
27 isl_int **row;
29 /* actual size of the rows in memory; n_col <= max_col */
30 unsigned max_col;
32 struct isl_blk block;
35 struct isl_mat *isl_mat_alloc(struct isl_ctx *ctx,
36 unsigned n_row, unsigned n_col);
37 struct isl_mat *isl_mat_dup(struct isl_mat *mat);
38 struct isl_mat *isl_mat_extend(struct isl_mat *mat,
39 unsigned n_row, unsigned n_col);
40 struct isl_mat *isl_mat_identity(struct isl_ctx *ctx, unsigned n_row);
41 struct isl_mat *isl_mat_copy(struct isl_mat *mat);
42 struct isl_mat *isl_mat_cow(struct isl_mat *mat);
43 void isl_mat_free(struct isl_mat *mat);
45 struct isl_mat *isl_mat_sub_alloc(struct isl_ctx *ctx, isl_int **row,
46 unsigned first_row, unsigned n_row, unsigned first_col, unsigned n_col);
47 void isl_mat_sub_copy(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
48 unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
49 void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
50 unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
52 struct isl_mat *isl_mat_swap_cols(struct isl_mat *mat, unsigned i, unsigned j);
53 struct isl_mat *isl_mat_swap_rows(struct isl_mat *mat, unsigned i, unsigned j);
55 struct isl_vec *isl_mat_vec_product(struct isl_mat *mat, struct isl_vec *vec);
56 struct isl_vec *isl_vec_mat_product(struct isl_vec *vec, struct isl_mat *mat);
57 struct isl_mat *isl_mat_aff_direct_sum(struct isl_mat *left,
58 struct isl_mat *right);
59 struct isl_mat *isl_mat_left_hermite(struct isl_mat *M,
60 int neg, struct isl_mat **U, struct isl_mat **Q);
61 struct isl_mat *isl_mat_lin_to_aff(struct isl_mat *mat);
62 struct isl_mat *isl_mat_inverse_product(struct isl_mat *left,
63 struct isl_mat *right);
64 struct isl_mat *isl_mat_product(struct isl_mat *left, struct isl_mat *right);
65 struct isl_mat *isl_mat_transpose(struct isl_mat *mat);
66 struct isl_mat *isl_mat_right_inverse(struct isl_mat *mat);
67 struct isl_mat *isl_mat_right_kernel(struct isl_mat *mat);
69 struct isl_mat *isl_mat_drop_cols(struct isl_mat *mat,
70 unsigned col, unsigned n);
71 struct isl_mat *isl_mat_drop_rows(struct isl_mat *mat,
72 unsigned row, unsigned n);
74 void isl_mat_col_mul(struct isl_mat *mat, int dst_col, isl_int f, int src_col);
75 void isl_mat_col_submul(struct isl_mat *mat,
76 int dst_col, isl_int f, int src_col);
78 struct isl_basic_set *isl_basic_set_preimage(struct isl_basic_set *bset,
79 struct isl_mat *mat);
80 struct isl_set *isl_set_preimage(struct isl_set *set, struct isl_mat *mat);
82 struct isl_mat *isl_mat_unimodular_complete(struct isl_mat *M, int row);
84 void isl_mat_dump(struct isl_mat *mat, FILE *out, int indent);
86 #if defined(__cplusplus)
88 #endif
90 #endif