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 struct isl_qpolynomial
{
35 struct isl_upoly
*upoly
;
50 struct isl_pw_qpolynomial_piece
{
52 struct isl_qpolynomial
*qp
;
55 struct isl_pw_qpolynomial
{
63 struct isl_pw_qpolynomial_piece p
[1];
66 struct isl_qpolynomial_fold
{
75 struct isl_qpolynomial
*qp
[1];
78 struct isl_pw_qpolynomial_fold_piece
{
80 struct isl_qpolynomial_fold
*fold
;
83 struct isl_pw_qpolynomial_fold
{
92 struct isl_pw_qpolynomial_fold_piece p
[1];
95 __isl_give
struct isl_upoly
*isl_upoly_zero(struct isl_ctx
*ctx
);
96 __isl_give
struct isl_upoly
*isl_upoly_copy(__isl_keep
struct isl_upoly
*up
);
97 __isl_give
struct isl_upoly
*isl_upoly_cow(__isl_take
struct isl_upoly
*up
);
98 __isl_give
struct isl_upoly
*isl_upoly_dup(__isl_keep
struct isl_upoly
*up
);
99 void isl_upoly_free(__isl_take
struct isl_upoly
*up
);
100 __isl_give
struct isl_upoly
*isl_upoly_mul(__isl_take
struct isl_upoly
*up1
,
101 __isl_take
struct isl_upoly
*up2
);
103 int isl_upoly_is_cst(__isl_keep
struct isl_upoly
*up
);
104 int isl_upoly_is_zero(__isl_keep
struct isl_upoly
*up
);
105 int isl_upoly_is_one(__isl_keep
struct isl_upoly
*up
);
106 int isl_upoly_is_negone(__isl_keep
struct isl_upoly
*up
);
107 __isl_keep
struct isl_upoly_cst
*isl_upoly_as_cst(__isl_keep
struct isl_upoly
*up
);
108 __isl_keep
struct isl_upoly_rec
*isl_upoly_as_rec(__isl_keep
struct isl_upoly
*up
);
110 __isl_give
struct isl_upoly
*isl_upoly_sum(__isl_take
struct isl_upoly
*up1
,
111 __isl_take
struct isl_upoly
*up2
);
112 __isl_give
struct isl_upoly
*isl_upoly_mul_isl_int(
113 __isl_take
struct isl_upoly
*up
, isl_int v
);
115 __isl_give isl_qpolynomial
*isl_qpolynomial_alloc(__isl_take isl_dim
*dim
,
116 unsigned n_div
, __isl_take
struct isl_upoly
*up
);
117 __isl_give isl_qpolynomial
*isl_qpolynomial_cow(__isl_take isl_qpolynomial
*qp
);
118 __isl_give isl_qpolynomial
*isl_qpolynomial_dup(__isl_keep isl_qpolynomial
*qp
);
120 __isl_give isl_qpolynomial
*isl_qpolynomial_cst(__isl_take isl_dim
*dim
,
122 __isl_give isl_qpolynomial
*isl_qpolynomial_var_pow(__isl_take isl_dim
*dim
,
124 __isl_give isl_qpolynomial
*isl_qpolynomial_div_pow(__isl_take isl_div
*div
,
126 int isl_qpolynomial_is_one(__isl_keep isl_qpolynomial
*qp
);
127 int isl_qpolynomial_is_affine(__isl_keep isl_qpolynomial
*qp
);
129 __isl_give isl_qpolynomial
*isl_qpolynomial_add_on_domain(
130 __isl_keep isl_set
*dom
,
131 __isl_take isl_qpolynomial
*qp1
,
132 __isl_take isl_qpolynomial
*qp2
);
134 int isl_qpolynomial_le_cst(__isl_keep isl_qpolynomial
*qp1
,
135 __isl_keep isl_qpolynomial
*qp2
);
136 __isl_give isl_qpolynomial
*isl_qpolynomial_max_cst(
137 __isl_take isl_qpolynomial
*qp1
, __isl_take isl_qpolynomial
*qp2
);
138 __isl_give isl_qpolynomial
*isl_qpolynomial_min_cst(
139 __isl_take isl_qpolynomial
*qp1
, __isl_take isl_qpolynomial
*qp2
);
141 int isl_qpolynomial_degree(__isl_keep isl_qpolynomial
*poly
);
142 __isl_give isl_qpolynomial
*isl_qpolynomial_coeff(
143 __isl_keep isl_qpolynomial
*poly
,
144 enum isl_dim_type type
, unsigned pos
, int deg
);
146 __isl_give isl_vec
*isl_qpolynomial_extract_affine(
147 __isl_keep isl_qpolynomial
*qp
);
148 __isl_give isl_qpolynomial
*isl_qpolynomial_from_affine(__isl_take isl_dim
*dim
,
149 isl_int
*f
, isl_int denom
);
151 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_cow(
152 __isl_take isl_pw_qpolynomial
*pwqp
);
154 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_add_piece(
155 __isl_take isl_pw_qpolynomial
*pwqp
,
156 __isl_take isl_set
*set
, __isl_take isl_qpolynomial
*qp
);
157 int isl_pw_qpolynomial_is_one(__isl_keep isl_pw_qpolynomial
*pwqp
);
159 __isl_give isl_qpolynomial
*isl_qpolynomial_opt_on_domain(
160 __isl_take isl_qpolynomial
*qp
, __isl_take isl_set
*set
, int max
);
162 enum isl_fold
isl_fold_type_negate(enum isl_fold type
);
164 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_cow(
165 __isl_take isl_qpolynomial_fold
*fold
);
166 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_dup(
167 __isl_keep isl_qpolynomial_fold
*fold
);
169 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_cow(
170 __isl_take isl_pw_qpolynomial_fold
*pwf
);
172 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_add_on_domain(
173 __isl_keep isl_set
*set
,
174 __isl_take isl_qpolynomial_fold
*fold1
,
175 __isl_take isl_qpolynomial_fold
*fold2
);
176 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_fold_on_domain(
177 __isl_keep isl_set
*set
,
178 __isl_take isl_qpolynomial_fold
*fold1
,
179 __isl_take isl_qpolynomial_fold
*fold2
);
181 __isl_give isl_qpolynomial
*isl_qpolynomial_fold_opt_on_domain(
182 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_set
*set
, int max
);
184 int isl_pw_qpolynomial_fold_covers(__isl_keep isl_pw_qpolynomial_fold
*pwf1
,
185 __isl_keep isl_pw_qpolynomial_fold
*pwf2
);
187 __isl_give isl_qpolynomial
*isl_qpolynomial_morph(__isl_take isl_qpolynomial
*qp
,
188 __isl_take isl_morph
*morph
);
189 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_morph(
190 __isl_take isl_pw_qpolynomial
*pwqp
, __isl_take isl_morph
*morph
);
191 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_morph(
192 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_morph
*morph
);
193 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_morph(
194 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_morph
*morph
);
196 __isl_give isl_qpolynomial
*isl_qpolynomial_lift(__isl_take isl_qpolynomial
*qp
,
197 __isl_take isl_dim
*dim
);
198 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_lift(
199 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_dim
*dim
);
201 __isl_give isl_qpolynomial
*isl_qpolynomial_substitute_equalities(
202 __isl_take isl_qpolynomial
*qp
, __isl_take isl_basic_set
*eq
);
203 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_substitute_equalities(
204 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_basic_set
*eq
);
205 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_gist(
206 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_set
*context
);
208 __isl_give isl_qpolynomial
*isl_qpolynomial_realign(
209 __isl_take isl_qpolynomial
*qp
, __isl_take isl_reordering
*r
);
210 __isl_give isl_qpolynomial_fold
*isl_qpolynomial_fold_realign(
211 __isl_take isl_qpolynomial_fold
*fold
, __isl_take isl_reordering
*r
);
212 __isl_give isl_pw_qpolynomial
*isl_pw_qpolynomial_realign(
213 __isl_take isl_pw_qpolynomial
*pwqp
, __isl_take isl_reordering
*r
);
214 __isl_give isl_pw_qpolynomial_fold
*isl_pw_qpolynomial_fold_realign(
215 __isl_take isl_pw_qpolynomial_fold
*pwf
, __isl_take isl_reordering
*r
);