isl_map_intersect_{domain,range}: allow intersection with parameter constraints
[isl.git] / isl_mat.h
blob503b6f4f0b10a8a6b6527c6ef74d562df7b666bb
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 #define ISL_MAT_BORROWED (1 << 0)
20 unsigned flags;
22 unsigned n_row;
23 unsigned n_col;
25 isl_int **row;
27 struct isl_blk block;
30 struct isl_mat *isl_mat_alloc(struct isl_ctx *ctx,
31 unsigned n_row, unsigned n_col);
32 struct isl_mat *isl_mat_identity(struct isl_ctx *ctx, unsigned n_row);
33 struct isl_mat *isl_mat_copy(struct isl_ctx *ctx, struct isl_mat *mat);
34 struct isl_mat *isl_mat_cow(struct isl_ctx *ctx, struct isl_mat *mat);
35 void isl_mat_free(struct isl_ctx *ctx, struct isl_mat *mat);
37 struct isl_mat *isl_mat_sub_alloc(struct isl_ctx *ctx, isl_int **row,
38 unsigned first_row, unsigned n_row, unsigned first_col, unsigned n_col);
39 void isl_mat_sub_copy(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
40 unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
41 void isl_mat_sub_neg(struct isl_ctx *ctx, isl_int **dst, isl_int **src,
42 unsigned n_row, unsigned dst_col, unsigned src_col, unsigned n_col);
44 struct isl_mat *isl_mat_swap_rows(struct isl_ctx *ctx,
45 struct isl_mat *mat, unsigned i, unsigned j);
47 struct isl_vec *isl_mat_vec_product(struct isl_ctx *ctx,
48 struct isl_mat *mat, struct isl_vec *vec);
49 struct isl_mat *isl_mat_aff_direct_sum(struct isl_ctx *ctx,
50 struct isl_mat *left, struct isl_mat *right);
51 struct isl_mat *isl_mat_left_hermite(struct isl_ctx *ctx,
52 struct isl_mat *M, int neg, struct isl_mat **U, struct isl_mat **Q);
53 struct isl_mat *isl_mat_lin_to_aff(struct isl_ctx *ctx, struct isl_mat *mat);
54 struct isl_mat *isl_mat_inverse_product(struct isl_ctx *ctx,
55 struct isl_mat *left, struct isl_mat *right);
56 struct isl_mat *isl_mat_product(struct isl_ctx *ctx,
57 struct isl_mat *left, struct isl_mat *right);
58 struct isl_mat *isl_mat_transpose(struct isl_ctx *ctx, struct isl_mat *mat);
59 struct isl_mat *isl_mat_right_inverse(struct isl_ctx *ctx,
60 struct isl_mat *mat);
61 struct isl_mat *isl_mat_right_kernel(struct isl_ctx *ctx, struct isl_mat *mat);
63 struct isl_mat *isl_mat_drop_cols(struct isl_ctx *ctx, struct isl_mat *mat,
64 unsigned col, unsigned n);
65 struct isl_mat *isl_mat_drop_rows(struct isl_ctx *ctx, struct isl_mat *mat,
66 unsigned row, unsigned n);
68 void isl_mat_col_mul(struct isl_mat *mat, int dst_col, isl_int f, int src_col);
69 void isl_mat_col_submul(struct isl_mat *mat,
70 int dst_col, isl_int f, int src_col);
72 struct isl_basic_set *isl_basic_set_preimage(struct isl_ctx *ctx,
73 struct isl_basic_set *bset, struct isl_mat *mat);
74 struct isl_set *isl_set_preimage(struct isl_ctx *ctx,
75 struct isl_set *set, struct isl_mat *mat);
77 void isl_mat_dump(struct isl_ctx *ctx, struct isl_mat *mat,
78 FILE *out, int indent);
80 #if defined(__cplusplus)
82 #endif
84 #endif