6 #include <isl/polynomial.h>
7 #include <isl_reordering.h>
16 struct isl_upoly_cst
{
22 struct isl_upoly_rec
{
27 struct isl_upoly
*p
[];
30 /* dim represents the domain space.
32 struct isl_qpolynomial
{
37 struct isl_upoly
*upoly
;
52 struct isl_pw_qpolynomial_piece
{
54 struct isl_qpolynomial
*qp
;
57 struct isl_pw_qpolynomial
{
65 struct isl_pw_qpolynomial_piece p
[1];
69 #define PW isl_pw_qpolynomial
71 #include <isl_pw_templ.h>
73 /* dim represents the domain space.
75 struct isl_qpolynomial_fold
{
84 struct isl_qpolynomial
*qp
[1];
87 struct isl_pw_qpolynomial_fold_piece
{
89 struct isl_qpolynomial_fold
*fold
;
92 struct isl_pw_qpolynomial_fold
{
101 struct isl_pw_qpolynomial_fold_piece p
[1];
105 #define PW isl_pw_qpolynomial_fold
107 #include <isl_pw_templ.h>
109 void isl_term_get_num(__isl_keep isl_term
*term
, isl_int
*n
);
111 __isl_give
struct isl_upoly
*isl_upoly_zero(struct isl_ctx
*ctx
);
112 __isl_give
struct isl_upoly
*isl_upoly_copy(__isl_keep
struct isl_upoly
*up
);
113 __isl_give
struct isl_upoly
*isl_upoly_cow(__isl_take
struct isl_upoly
*up
);
114 __isl_give
struct isl_upoly
*isl_upoly_dup(__isl_keep
struct isl_upoly
*up
);
115 __isl_null
struct isl_upoly
*isl_upoly_free(__isl_take
struct isl_upoly
*up
);
116 __isl_give
struct isl_upoly
*isl_upoly_mul(__isl_take
struct isl_upoly
*up1
,
117 __isl_take
struct isl_upoly
*up2
);
119 int isl_upoly_is_cst(__isl_keep
struct isl_upoly
*up
);
120 int isl_upoly_is_zero(__isl_keep
struct isl_upoly
*up
);
121 int isl_upoly_is_one(__isl_keep
struct isl_upoly
*up
);
122 int isl_upoly_is_negone(__isl_keep
struct isl_upoly
*up
);
123 __isl_keep
struct isl_upoly_cst
*isl_upoly_as_cst(__isl_keep
struct isl_upoly
*up
);
124 __isl_keep
struct isl_upoly_rec
*isl_upoly_as_rec(__isl_keep
struct isl_upoly
*up
);
126 __isl_give
struct isl_upoly
*isl_upoly_sum(__isl_take
struct isl_upoly
*up1
,
127 __isl_take
struct isl_upoly
*up2
);
128 __isl_give
struct isl_upoly
*isl_upoly_mul_isl_int(
129 __isl_take
struct isl_upoly
*up
, isl_int v
);
131 __isl_give isl_qpolynomial
*isl_qpolynomial_alloc(__isl_take isl_space
*dim
,
132 unsigned n_div
, __isl_take
struct isl_upoly
*up
);
133 __isl_give isl_qpolynomial
*isl_qpolynomial_cow(__isl_take isl_qpolynomial
*qp
);
134 __isl_give isl_qpolynomial
*isl_qpolynomial_dup(__isl_keep isl_qpolynomial
*qp
);
136 __isl_give isl_qpolynomial
*isl_qpolynomial_cst_on_domain(__isl_take isl_space
*dim
,
138 __isl_give isl_qpolynomial
*isl_qpolynomial_rat_cst_on_domain(
139 __isl_take isl_space
*space
, const isl_int n
, const isl_int d
);
140 __isl_give isl_qpolynomial
*isl_qpolynomial_var_pow_on_domain(__isl_take isl_space
*dim
,
142 isl_bool
isl_qpolynomial_is_one(__isl_keep isl_qpolynomial
*qp
);
143 int isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial
*qp
);
144 int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial
*qp
,
145 isl_int
*n
, isl_int
*d
);
147 unsigned isl_qpolynomial_domain_offset(__isl_keep isl_qpolynomial
*qp
,
148 enum isl_dim_type type
);
150 __isl_give isl_qpolynomial
*isl_qpolynomial_add_on_domain(
151 __isl_keep isl_set
*dom
,
152 __isl_take isl_qpolynomial
*qp1
,
153 __isl_take isl_qpolynomial
*qp2
);
155 int isl_qpolynomial_plain_cmp(__isl_keep isl_qpolynomial
*qp1
,
156 __isl_keep isl_qpolynomial
*qp2
);
158 int isl_qpolynomial_degree(__isl_keep isl_qpolynomial
*poly
);
159 __isl_give isl_qpolynomial
*isl_qpolynomial_coeff(
160 __isl_keep isl_qpolynomial
*poly
,
161 enum isl_dim_type type
, unsigned pos
, int deg
);
163 __isl_give isl_vec
*isl_qpolynomial_extract_affine(
164 __isl_keep isl_qpolynomial
*qp
);
165 __isl_give isl_qpolynomial
*isl_qpolynomial_from_affine(__isl_take isl_space
*dim
,
166 isl_int
*f
, isl_int denom
);
168 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_cow(
169 __isl_take isl_pw_qpolynomial
*pwqp
);
171 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_add_piece(
172 __isl_take isl_pw_qpolynomial
*pwqp
,
173 __isl_take isl_set
*set
, __isl_take isl_qpolynomial
*qp
);
174 int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial
*pwqp
);
176 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_project_out(
177 __isl_take isl_pw_qpolynomial
*pwqp
,
178 enum isl_dim_type type
, unsigned first
, unsigned n
);
180 __isl_give isl_val
*isl_qpolynomial_opt_on_domain(
181 __isl_take isl_qpolynomial
*qp
, __isl_take isl_set
*set
, int max
);
183 enum isl_fold
isl_fold_type_negate(enum isl_fold type
);
185 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_cow(
186 __isl_take isl_qpolynomial_fold
*fold
);
187 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_dup(
188 __isl_keep isl_qpolynomial_fold
*fold
);
190 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_cow(
191 __isl_take isl_pw_qpolynomial_fold
*pwf
);
193 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_add_on_domain(
194 __isl_keep isl_set
*set
,
195 __isl_take isl_qpolynomial_fold
*fold1
,
196 __isl_take isl_qpolynomial_fold
*fold2
);
197 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_fold_on_domain(
198 __isl_keep isl_set
*set
,
199 __isl_take isl_qpolynomial_fold
*fold1
,
200 __isl_take isl_qpolynomial_fold
*fold2
);
202 int isl_qpolynomial_fold_plain_cmp(__isl_keep isl_qpolynomial_fold
*fold1
,
203 __isl_keep isl_qpolynomial_fold
*fold2
);
205 __isl_give isl_val
*isl_qpolynomial_fold_opt_on_domain(
206 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_set
*set
, int max
);
208 int isl_pw_qpolynomial_fold_covers(__isl_keep isl_pw_qpolynomial_fold
*pwf1
,
209 __isl_keep isl_pw_qpolynomial_fold
*pwf2
);
211 __isl_give isl_qpolynomial
*isl_qpolynomial_morph_domain(
212 __isl_take isl_qpolynomial
*qp
, __isl_take isl_morph
*morph
);
213 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_morph_domain(
214 __isl_take isl_pw_qpolynomial
*pwqp
, __isl_take isl_morph
*morph
);
215 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_morph_domain(
216 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_morph
*morph
);
217 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_morph_domain(
218 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_morph
*morph
);
220 __isl_give isl_qpolynomial
*isl_qpolynomial_lift(__isl_take isl_qpolynomial
*qp
,
221 __isl_take isl_space
*dim
);
222 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_lift(
223 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_space
*dim
);
225 __isl_give isl_qpolynomial
*isl_qpolynomial_substitute_equalities(
226 __isl_take isl_qpolynomial
*qp
, __isl_take isl_basic_set
*eq
);
227 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_substitute_equalities(
228 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_basic_set
*eq
);
229 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_gist(
230 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_set
*context
);
232 __isl_give isl_qpolynomial
*isl_qpolynomial_realign_domain(
233 __isl_take isl_qpolynomial
*qp
, __isl_take isl_reordering
*r
);
234 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_realign_domain(
235 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_reordering
*r
);
236 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_realign_domain(
237 __isl_take isl_pw_qpolynomial
*pwqp
, __isl_take isl_reordering
*r
);
238 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_realign_domain(
239 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_reordering
*r
);
241 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_reset_space(
242 __isl_take isl_pw_qpolynomial
*pwqp
, __isl_take isl_space
*space
);
243 __isl_give isl_qpolynomial
*isl_qpolynomial_reset_domain_space(
244 __isl_take isl_qpolynomial
*qp
, __isl_take isl_space
*dim
);
245 __isl_give isl_qpolynomial
*isl_qpolynomial_reset_space_and_domain(
246 __isl_take isl_qpolynomial
*qp
, __isl_take isl_space
*space
,
247 __isl_take isl_space
*domain
);
248 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_reset_domain_space(
249 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_space
*dim
);
250 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_reset_space_and_domain(
251 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_space
*space
,
252 __isl_take isl_space
*domain
);
253 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_reset_domain_space(
254 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_space
*dim
);
256 void isl_qpolynomial_get_den(__isl_keep isl_qpolynomial
*qp
, isl_int
*d
);
257 __isl_give isl_qpolynomial
*isl_qpolynomial_add_isl_int(
258 __isl_take isl_qpolynomial
*qp
, isl_int v
);
259 __isl_give isl_qpolynomial
*isl_qpolynomial_mul_isl_int(
260 __isl_take isl_qpolynomial
*qp
, isl_int v
);
261 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_mul_isl_int(
262 __isl_take isl_pw_qpolynomial
*pwqp
, isl_int v
);
264 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_scale(
265 __isl_take isl_qpolynomial_fold
*fold
, isl_int v
);
267 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_mul_isl_int(
268 __isl_take isl_qpolynomial_fold
*fold
, isl_int v
);
269 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_mul_isl_int(
270 __isl_take isl_pw_qpolynomial_fold
*pwf
, isl_int v
);
271 __isl_give isl_union_pw_qpolynomial
*isl_union_pw_qpolynomial_mul_isl_int(
272 __isl_take isl_union_pw_qpolynomial
*upwqp
, isl_int v
);
273 __isl_give isl_union_pw_qpolynomial_fold
*
274 isl_union_pw_qpolynomial_fold_mul_isl_int(
275 __isl_take isl_union_pw_qpolynomial_fold
*upwf
, isl_int v
);