6 #include <isl/polynomial.h>
7 #include <isl_reordering.h>
15 typedef struct isl_poly isl_poly
;
22 typedef struct isl_poly_cst isl_poly_cst
;
31 typedef struct isl_poly_rec isl_poly_rec
;
33 /* dim represents the domain space.
35 struct isl_qpolynomial
{
55 struct isl_pw_qpolynomial_piece
{
57 struct isl_qpolynomial
*qp
;
60 struct isl_pw_qpolynomial
{
68 struct isl_pw_qpolynomial_piece p
[1];
72 #define PW isl_pw_qpolynomial
74 #include <isl_pw_templ.h>
77 #define EL isl_pw_qpolynomial
79 #include <isl_list_templ.h>
81 /* dim represents the domain space.
83 struct isl_qpolynomial_fold
{
92 struct isl_qpolynomial
*qp
[1];
95 struct isl_pw_qpolynomial_fold_piece
{
97 struct isl_qpolynomial_fold
*fold
;
100 struct isl_pw_qpolynomial_fold
{
109 struct isl_pw_qpolynomial_fold_piece p
[1];
113 #define PW isl_pw_qpolynomial_fold
115 #include <isl_pw_templ.h>
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
,
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
,
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
);