isl_morph.c: identity_on_parameters: return isl_bool
[isl.git] / isl_polynomial_private.h
blobbe5d9e9a85c618242f15b4b2153e03ddbe41643c
1 #include <stdio.h>
2 #include <isl_int.h>
3 #include <isl/map.h>
4 #include <isl/mat.h>
5 #include <isl_morph.h>
6 #include <isl/polynomial.h>
7 #include <isl_reordering.h>
9 struct isl_poly {
10 int ref;
11 struct isl_ctx *ctx;
13 int var;
15 typedef struct isl_poly isl_poly;
17 struct isl_poly_cst {
18 struct isl_poly poly;
19 isl_int n;
20 isl_int d;
22 typedef struct isl_poly_cst isl_poly_cst;
24 struct isl_poly_rec {
25 struct isl_poly poly;
26 int n;
28 size_t size;
29 isl_poly *p[];
31 typedef struct isl_poly_rec isl_poly_rec;
33 /* dim represents the domain space.
35 struct isl_qpolynomial {
36 int ref;
38 isl_space *dim;
39 struct isl_mat *div;
40 isl_poly *poly;
43 struct isl_term {
44 int ref;
46 isl_int n;
47 isl_int d;
49 isl_space *dim;
50 struct isl_mat *div;
52 int pow[1];
55 struct isl_pw_qpolynomial_piece {
56 struct isl_set *set;
57 struct isl_qpolynomial *qp;
60 struct isl_pw_qpolynomial {
61 int ref;
63 isl_space *dim;
65 int n;
67 size_t size;
68 struct isl_pw_qpolynomial_piece p[1];
71 #undef PW
72 #define PW isl_pw_qpolynomial
74 #include <isl_pw_templ.h>
76 #undef EL
77 #define EL isl_pw_qpolynomial
79 #include <isl_list_templ.h>
81 /* dim represents the domain space.
83 struct isl_qpolynomial_fold {
84 int ref;
86 enum isl_fold type;
87 isl_space *dim;
89 int n;
91 size_t size;
92 struct isl_qpolynomial *qp[1];
95 struct isl_pw_qpolynomial_fold_piece {
96 struct isl_set *set;
97 struct isl_qpolynomial_fold *fold;
100 struct isl_pw_qpolynomial_fold {
101 int ref;
103 enum isl_fold type;
104 isl_space *dim;
106 int n;
108 size_t size;
109 struct isl_pw_qpolynomial_fold_piece p[1];
112 #undef PW
113 #define PW isl_pw_qpolynomial_fold
115 #include <isl_pw_templ.h>
117 #undef EL
118 #define EL isl_pw_qpolynomial_fold
120 #include <isl_list_templ.h>
122 void isl_term_get_num(__isl_keep isl_term *term, isl_int *n);
124 __isl_give isl_poly *isl_poly_zero(struct isl_ctx *ctx);
125 __isl_give isl_poly *isl_poly_copy(__isl_keep isl_poly *poly);
126 __isl_give isl_poly *isl_poly_cow(__isl_take isl_poly *poly);
127 __isl_give isl_poly *isl_poly_dup(__isl_keep isl_poly *poly);
128 __isl_null isl_poly *isl_poly_free(__isl_take isl_poly *poly);
129 __isl_give struct isl_poly *isl_poly_mul(__isl_take struct isl_poly *poly1,
130 __isl_take struct isl_poly *poly2);
132 isl_bool isl_poly_is_cst(__isl_keep isl_poly *poly);
133 isl_bool isl_poly_is_zero(__isl_keep isl_poly *poly);
134 isl_bool isl_poly_is_one(__isl_keep isl_poly *poly);
135 isl_bool isl_poly_is_negone(__isl_keep isl_poly *poly);
136 __isl_keep isl_poly_cst *isl_poly_as_cst(__isl_keep isl_poly *poly);
137 __isl_keep isl_poly_rec *isl_poly_as_rec(__isl_keep isl_poly *poly);
139 __isl_give isl_poly *isl_poly_sum(__isl_take isl_poly *poly1,
140 __isl_take isl_poly *poly2);
141 __isl_give struct isl_poly *isl_poly_mul_isl_int(
142 __isl_take isl_poly *poly, isl_int v);
144 __isl_give isl_qpolynomial *isl_qpolynomial_alloc(__isl_take isl_space *space,
145 unsigned n_div, __isl_take isl_poly *poly);
146 __isl_give isl_qpolynomial *isl_qpolynomial_cow(__isl_take isl_qpolynomial *qp);
147 __isl_give isl_qpolynomial *isl_qpolynomial_dup(__isl_keep isl_qpolynomial *qp);
149 __isl_give isl_qpolynomial *isl_qpolynomial_cst_on_domain(__isl_take isl_space *dim,
150 isl_int v);
151 __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst_on_domain(
152 __isl_take isl_space *space, const isl_int n, const isl_int d);
153 __isl_give isl_qpolynomial *isl_qpolynomial_var_pow_on_domain(__isl_take isl_space *dim,
154 int pos, int power);
155 isl_bool isl_qpolynomial_is_one(__isl_keep isl_qpolynomial *qp);
156 isl_bool isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial *qp);
157 isl_bool isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp,
158 isl_int *n, isl_int *d);
160 unsigned isl_qpolynomial_domain_offset(__isl_keep isl_qpolynomial *qp,
161 enum isl_dim_type type);
163 __isl_give isl_qpolynomial *isl_qpolynomial_add_on_domain(
164 __isl_keep isl_set *dom,
165 __isl_take isl_qpolynomial *qp1,
166 __isl_take isl_qpolynomial *qp2);
168 int isl_qpolynomial_plain_cmp(__isl_keep isl_qpolynomial *qp1,
169 __isl_keep isl_qpolynomial *qp2);
171 int isl_qpolynomial_degree(__isl_keep isl_qpolynomial *poly);
172 __isl_give isl_qpolynomial *isl_qpolynomial_coeff(
173 __isl_keep isl_qpolynomial *poly,
174 enum isl_dim_type type, unsigned pos, int deg);
176 __isl_give isl_vec *isl_qpolynomial_extract_affine(
177 __isl_keep isl_qpolynomial *qp);
178 __isl_give isl_qpolynomial *isl_qpolynomial_from_affine(
179 __isl_take isl_space *space, isl_int *f, isl_int denom);
181 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_cow(
182 __isl_take isl_pw_qpolynomial *pwqp);
184 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_piece(
185 __isl_take isl_pw_qpolynomial *pwqp,
186 __isl_take isl_set *set, __isl_take isl_qpolynomial *qp);
187 int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial *pwqp);
189 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_project_out(
190 __isl_take isl_pw_qpolynomial *pwqp,
191 enum isl_dim_type type, unsigned first, unsigned n);
193 __isl_give isl_val *isl_qpolynomial_opt_on_domain(
194 __isl_take isl_qpolynomial *qp, __isl_take isl_set *set, int max);
196 enum isl_fold isl_fold_type_negate(enum isl_fold type);
198 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_cow(
199 __isl_take isl_qpolynomial_fold *fold);
200 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_dup(
201 __isl_keep isl_qpolynomial_fold *fold);
203 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_cow(
204 __isl_take isl_pw_qpolynomial_fold *pwf);
206 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_add_on_domain(
207 __isl_keep isl_set *set,
208 __isl_take isl_qpolynomial_fold *fold1,
209 __isl_take isl_qpolynomial_fold *fold2);
210 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold_on_domain(
211 __isl_keep isl_set *set,
212 __isl_take isl_qpolynomial_fold *fold1,
213 __isl_take isl_qpolynomial_fold *fold2);
215 int isl_qpolynomial_fold_plain_cmp(__isl_keep isl_qpolynomial_fold *fold1,
216 __isl_keep isl_qpolynomial_fold *fold2);
218 __isl_give isl_val *isl_qpolynomial_fold_opt_on_domain(
219 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *set, int max);
221 isl_bool isl_pw_qpolynomial_fold_covers(
222 __isl_keep isl_pw_qpolynomial_fold *pwf1,
223 __isl_keep isl_pw_qpolynomial_fold *pwf2);
225 __isl_give isl_qpolynomial *isl_qpolynomial_morph_domain(
226 __isl_take isl_qpolynomial *qp, __isl_take isl_morph *morph);
227 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_morph_domain(
228 __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_morph *morph);
229 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_morph_domain(
230 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_morph *morph);
231 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_morph_domain(
232 __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_morph *morph);
234 __isl_give isl_qpolynomial *isl_qpolynomial_lift(__isl_take isl_qpolynomial *qp,
235 __isl_take isl_space *space);
236 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_lift(
237 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_space *dim);
239 __isl_give isl_qpolynomial *isl_qpolynomial_substitute_equalities(
240 __isl_take isl_qpolynomial *qp, __isl_take isl_basic_set *eq);
241 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_substitute_equalities(
242 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_basic_set *eq);
243 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist(
244 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *context);
246 __isl_give isl_qpolynomial *isl_qpolynomial_realign_domain(
247 __isl_take isl_qpolynomial *qp, __isl_take isl_reordering *r);
248 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_realign_domain(
249 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_reordering *r);
250 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_realign_domain(
251 __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_reordering *r);
252 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_realign_domain(
253 __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_reordering *r);
255 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_reset_space(
256 __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_space *space);
257 __isl_give isl_qpolynomial *isl_qpolynomial_reset_domain_space(
258 __isl_take isl_qpolynomial *qp, __isl_take isl_space *dim);
259 __isl_give isl_qpolynomial *isl_qpolynomial_reset_space_and_domain(
260 __isl_take isl_qpolynomial *qp, __isl_take isl_space *space,
261 __isl_take isl_space *domain);
262 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_reset_domain_space(
263 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_space *dim);
264 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_reset_space_and_domain(
265 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_space *space,
266 __isl_take isl_space *domain);
267 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_reset_domain_space(
268 __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_space *dim);
270 __isl_give isl_val *isl_qpolynomial_get_den(__isl_keep isl_qpolynomial *qp);
271 __isl_give isl_qpolynomial *isl_qpolynomial_add_isl_int(
272 __isl_take isl_qpolynomial *qp, isl_int v);
273 __isl_give isl_qpolynomial *isl_qpolynomial_mul_isl_int(
274 __isl_take isl_qpolynomial *qp, isl_int v);
275 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul_isl_int(
276 __isl_take isl_pw_qpolynomial *pwqp, isl_int v);
278 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_scale(
279 __isl_take isl_qpolynomial_fold *fold, isl_int v);
281 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_mul_isl_int(
282 __isl_take isl_qpolynomial_fold *fold, isl_int v);
283 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_mul_isl_int(
284 __isl_take isl_pw_qpolynomial_fold *pwf, isl_int v);
285 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul_isl_int(
286 __isl_take isl_union_pw_qpolynomial *upwqp, isl_int v);
287 __isl_give isl_union_pw_qpolynomial_fold *
288 isl_union_pw_qpolynomial_fold_mul_isl_int(
289 __isl_take isl_union_pw_qpolynomial_fold *upwf, isl_int v);