2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the GNU LGPLv2.1 license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
20 #if defined(__cplusplus)
25 typedef struct isl_mat isl_mat
;
27 __isl_give isl_mat
*isl_mat_alloc(struct isl_ctx
*ctx
,
28 unsigned n_row
, unsigned n_col
);
29 struct isl_mat
*isl_mat_dup(struct isl_mat
*mat
);
30 struct isl_mat
*isl_mat_extend(struct isl_mat
*mat
,
31 unsigned n_row
, unsigned n_col
);
32 struct isl_mat
*isl_mat_identity(struct isl_ctx
*ctx
, unsigned n_row
);
33 __isl_give isl_mat
*isl_mat_copy(__isl_keep isl_mat
*mat
);
34 struct isl_mat
*isl_mat_cow(struct isl_mat
*mat
);
35 void isl_mat_free(__isl_take isl_mat
*mat
);
37 int isl_mat_rows(__isl_keep isl_mat
*mat
);
38 int isl_mat_cols(__isl_keep isl_mat
*mat
);
39 int isl_mat_get_element(__isl_keep isl_mat
*mat
, int row
, int col
, isl_int
*v
);
40 __isl_give isl_mat
*isl_mat_set_element(__isl_take isl_mat
*mat
,
41 int row
, int col
, isl_int v
);
43 struct isl_mat
*isl_mat_sub_alloc(struct isl_ctx
*ctx
, isl_int
**row
,
44 unsigned first_row
, unsigned n_row
, unsigned first_col
, unsigned n_col
);
45 void isl_mat_sub_copy(struct isl_ctx
*ctx
, isl_int
**dst
, isl_int
**src
,
46 unsigned n_row
, unsigned dst_col
, unsigned src_col
, unsigned n_col
);
47 void isl_mat_sub_neg(struct isl_ctx
*ctx
, isl_int
**dst
, isl_int
**src
,
48 unsigned n_row
, unsigned dst_col
, unsigned src_col
, unsigned n_col
);
50 struct isl_mat
*isl_mat_swap_cols(struct isl_mat
*mat
, unsigned i
, unsigned j
);
51 struct isl_mat
*isl_mat_swap_rows(struct isl_mat
*mat
, unsigned i
, unsigned j
);
53 struct isl_vec
*isl_mat_vec_product(struct isl_mat
*mat
, struct isl_vec
*vec
);
54 struct isl_vec
*isl_vec_mat_product(struct isl_vec
*vec
, struct isl_mat
*mat
);
55 __isl_give isl_vec
*isl_mat_vec_inverse_product(__isl_take isl_mat
*mat
,
56 __isl_take isl_vec
*vec
);
57 struct isl_mat
*isl_mat_aff_direct_sum(struct isl_mat
*left
,
58 struct isl_mat
*right
);
59 __isl_give isl_mat
*isl_mat_diagonal(__isl_take isl_mat
*mat1
,
60 __isl_take isl_mat
*mat2
);
61 struct isl_mat
*isl_mat_left_hermite(struct isl_mat
*M
,
62 int neg
, struct isl_mat
**U
, struct isl_mat
**Q
);
63 struct isl_mat
*isl_mat_lin_to_aff(struct isl_mat
*mat
);
64 struct isl_mat
*isl_mat_inverse_product(struct isl_mat
*left
,
65 struct isl_mat
*right
);
66 struct isl_mat
*isl_mat_product(struct isl_mat
*left
, struct isl_mat
*right
);
67 struct isl_mat
*isl_mat_transpose(struct isl_mat
*mat
);
68 __isl_give isl_mat
*isl_mat_right_inverse(__isl_take isl_mat
*mat
);
69 __isl_give isl_mat
*isl_mat_right_kernel(__isl_take isl_mat
*mat
);
71 __isl_give isl_mat
*isl_mat_normalize(__isl_take isl_mat
*mat
);
73 struct isl_mat
*isl_mat_drop_cols(struct isl_mat
*mat
,
74 unsigned col
, unsigned n
);
75 struct isl_mat
*isl_mat_drop_rows(struct isl_mat
*mat
,
76 unsigned row
, unsigned n
);
77 __isl_give isl_mat
*isl_mat_insert_cols(__isl_take isl_mat
*mat
,
78 unsigned col
, unsigned n
);
79 __isl_give isl_mat
*isl_mat_insert_rows(__isl_take isl_mat
*mat
,
80 unsigned row
, unsigned n
);
81 __isl_give isl_mat
*isl_mat_move_cols(__isl_take isl_mat
*mat
,
82 unsigned dst_col
, unsigned src_col
, unsigned n
);
83 __isl_give isl_mat
*isl_mat_add_rows(__isl_take isl_mat
*mat
, unsigned n
);
84 __isl_give isl_mat
*isl_mat_insert_zero_cols(__isl_take isl_mat
*mat
,
85 unsigned first
, unsigned n
);
86 __isl_give isl_mat
*isl_mat_add_zero_cols(__isl_take isl_mat
*mat
, unsigned n
);
88 void isl_mat_col_add(__isl_keep isl_mat
*mat
, int dst_col
, int src_col
);
89 void isl_mat_col_mul(struct isl_mat
*mat
, int dst_col
, isl_int f
, int src_col
);
90 void isl_mat_col_submul(struct isl_mat
*mat
,
91 int dst_col
, isl_int f
, int src_col
);
93 struct isl_mat
*isl_mat_unimodular_complete(struct isl_mat
*M
, int row
);
95 __isl_give isl_mat
*isl_mat_from_row_vec(__isl_take isl_vec
*vec
);
96 __isl_give isl_mat
*isl_mat_concat(__isl_take isl_mat
*top
,
97 __isl_take isl_mat
*bot
);
98 __isl_give isl_mat
*isl_mat_vec_concat(__isl_take isl_mat
*top
,
99 __isl_take isl_vec
*bot
);
101 int isl_mat_is_equal(__isl_keep isl_mat
*mat1
, __isl_keep isl_mat
*mat2
);
103 void isl_mat_dump(struct isl_mat
*mat
, FILE *out
, int indent
);
105 #if defined(__cplusplus)