Merge branch 'maint'
[platform/upstream/isl.git] / include / isl / polynomial.h
1 #ifndef ISL_POLYNOMIAL_H
2 #define ISL_POLYNOMIAL_H
3
4 #include <isl/ctx.h>
5 #include <isl/constraint.h>
6 #include <isl/dim.h>
7 #include <isl/div.h>
8 #include <isl/set.h>
9 #include <isl/point.h>
10 #include <isl/printer.h>
11 #include <isl/union_set.h>
12 #include <isl/aff.h>
13
14 #if defined(__cplusplus)
15 extern "C" {
16 #endif
17
18 struct isl_qpolynomial;
19 typedef struct isl_qpolynomial isl_qpolynomial;
20
21 isl_ctx *isl_qpolynomial_get_ctx(__isl_keep isl_qpolynomial *qp);
22 __isl_give isl_dim *isl_qpolynomial_get_dim(__isl_keep isl_qpolynomial *qp);
23 __isl_give isl_qpolynomial *isl_qpolynomial_reset_dim(
24         __isl_take isl_qpolynomial *qp, __isl_take isl_dim *dim);
25 unsigned isl_qpolynomial_dim(__isl_keep isl_qpolynomial *qp,
26         enum isl_dim_type type);
27 int isl_qpolynomial_involves_dims(__isl_keep isl_qpolynomial *qp,
28         enum isl_dim_type type, unsigned first, unsigned n);
29
30 __isl_give isl_qpolynomial *isl_qpolynomial_set_dim_name(
31         __isl_take isl_qpolynomial *qp,
32         enum isl_dim_type type, unsigned pos, const char *s);
33
34 __isl_give isl_qpolynomial *isl_qpolynomial_zero(__isl_take isl_dim *dim);
35 __isl_give isl_qpolynomial *isl_qpolynomial_one(__isl_take isl_dim *dim);
36 __isl_give isl_qpolynomial *isl_qpolynomial_infty(__isl_take isl_dim *dim);
37 __isl_give isl_qpolynomial *isl_qpolynomial_neginfty(__isl_take isl_dim *dim);
38 __isl_give isl_qpolynomial *isl_qpolynomial_nan(__isl_take isl_dim *dim);
39 __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst(__isl_take isl_dim *dim,
40         const isl_int n, const isl_int d);
41 __isl_give isl_qpolynomial *isl_qpolynomial_div(__isl_take isl_div *div);
42 __isl_give isl_qpolynomial *isl_qpolynomial_var(__isl_take isl_dim *dim,
43         enum isl_dim_type type, unsigned pos);
44 __isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp);
45 void isl_qpolynomial_free(__isl_take isl_qpolynomial *qp);
46
47 int isl_qpolynomial_is_equal(__isl_keep isl_qpolynomial *qp1,
48         __isl_keep isl_qpolynomial *qp2);
49 int isl_qpolynomial_is_zero(__isl_keep isl_qpolynomial *qp);
50 int isl_qpolynomial_is_nan(__isl_keep isl_qpolynomial *qp);
51 int isl_qpolynomial_is_infty(__isl_keep isl_qpolynomial *qp);
52 int isl_qpolynomial_is_neginfty(__isl_keep isl_qpolynomial *qp);
53 int isl_qpolynomial_sgn(__isl_keep isl_qpolynomial *qp);
54 int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp,
55         isl_int *n, isl_int *d);
56 void isl_qpolynomial_get_den(__isl_keep isl_qpolynomial *qp, isl_int *d);
57
58 __isl_give isl_qpolynomial *isl_qpolynomial_neg(__isl_take isl_qpolynomial *qp);
59 __isl_give isl_qpolynomial *isl_qpolynomial_add(__isl_take isl_qpolynomial *qp1,
60         __isl_take isl_qpolynomial *qp2);
61 __isl_give isl_qpolynomial *isl_qpolynomial_sub(__isl_take isl_qpolynomial *qp1,
62         __isl_take isl_qpolynomial *qp2);
63 __isl_give isl_qpolynomial *isl_qpolynomial_mul(__isl_take isl_qpolynomial *qp1,
64         __isl_take isl_qpolynomial *qp2);
65 __isl_give isl_qpolynomial *isl_qpolynomial_pow(__isl_take isl_qpolynomial *qp,
66         unsigned power);
67 __isl_give isl_qpolynomial *isl_qpolynomial_add_isl_int(
68         __isl_take isl_qpolynomial *qp, isl_int v);
69 __isl_give isl_qpolynomial *isl_qpolynomial_mul_isl_int(
70         __isl_take isl_qpolynomial *qp, isl_int v);
71
72 __isl_give isl_qpolynomial *isl_qpolynomial_insert_dims(
73         __isl_take isl_qpolynomial *qp, enum isl_dim_type type,
74         unsigned first, unsigned n);
75 __isl_give isl_qpolynomial *isl_qpolynomial_add_dims(
76         __isl_take isl_qpolynomial *qp, enum isl_dim_type type, unsigned n);
77 __isl_give isl_qpolynomial *isl_qpolynomial_move_dims(
78         __isl_take isl_qpolynomial *qp,
79         enum isl_dim_type dst_type, unsigned dst_pos,
80         enum isl_dim_type src_type, unsigned src_pos, unsigned n);
81 __isl_give isl_qpolynomial *isl_qpolynomial_drop_dims(
82         __isl_take isl_qpolynomial *qp,
83         enum isl_dim_type type, unsigned first, unsigned n);
84
85 __isl_give isl_qpolynomial *isl_qpolynomial_substitute(
86         __isl_take isl_qpolynomial *qp,
87         enum isl_dim_type type, unsigned first, unsigned n,
88         __isl_keep isl_qpolynomial **subs);
89
90 int isl_qpolynomial_as_polynomial_on_domain(__isl_keep isl_qpolynomial *qp,
91         __isl_keep isl_basic_set *bset,
92         int (*fn)(__isl_take isl_basic_set *bset,
93                   __isl_take isl_qpolynomial *poly, void *user), void *user);
94
95 __isl_give isl_qpolynomial *isl_qpolynomial_homogenize(
96         __isl_take isl_qpolynomial *poly);
97
98 __isl_give isl_qpolynomial *isl_qpolynomial_align_params(
99         __isl_take isl_qpolynomial *qp, __isl_take isl_dim *model);
100
101 struct isl_term;
102 typedef struct isl_term isl_term;
103
104 isl_ctx *isl_term_get_ctx(__isl_keep isl_term *term);
105
106 void isl_term_free(__isl_take isl_term *term);
107
108 unsigned isl_term_dim(__isl_keep isl_term *term, enum isl_dim_type type);
109 void isl_term_get_num(__isl_keep isl_term *term, isl_int *n);
110 void isl_term_get_den(__isl_keep isl_term *term, isl_int *d);
111 int isl_term_get_exp(__isl_keep isl_term *term,
112         enum isl_dim_type type, unsigned pos);
113 __isl_give isl_div *isl_term_get_div(__isl_keep isl_term *term, unsigned pos);
114
115 int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp,
116         int (*fn)(__isl_take isl_term *term, void *user), void *user);
117
118 __isl_give isl_qpolynomial *isl_qpolynomial_eval(
119         __isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt);
120
121 __isl_give isl_qpolynomial *isl_qpolynomial_gist(
122         __isl_take isl_qpolynomial *qp, __isl_take isl_set *context);
123
124 __isl_give isl_qpolynomial *isl_qpolynomial_from_constraint(
125         __isl_take isl_constraint *c, enum isl_dim_type type, unsigned pos);
126 __isl_give isl_qpolynomial *isl_qpolynomial_from_term(__isl_take isl_term *term);
127 __isl_give isl_qpolynomial *isl_qpolynomial_from_aff(__isl_take isl_aff *aff);
128 __isl_give isl_basic_map *isl_basic_map_from_qpolynomial(
129         __isl_take isl_qpolynomial *qp);
130
131 __isl_give isl_printer *isl_printer_print_qpolynomial(
132         __isl_take isl_printer *p, __isl_keep isl_qpolynomial *qp);
133 void isl_qpolynomial_print(__isl_keep isl_qpolynomial *qp, FILE *out,
134         unsigned output_format);
135 void isl_qpolynomial_dump(__isl_keep isl_qpolynomial *qp);
136
137 struct isl_pw_qpolynomial;
138 typedef struct isl_pw_qpolynomial isl_pw_qpolynomial;
139
140 isl_ctx *isl_pw_qpolynomial_get_ctx(__isl_keep isl_pw_qpolynomial *pwqp);
141
142 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(__isl_take isl_dim *dim);
143 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc(__isl_take isl_set *set,
144         __isl_take isl_qpolynomial *qp);
145 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy(
146         __isl_keep isl_pw_qpolynomial *pwqp);
147 void isl_pw_qpolynomial_free(__isl_take isl_pw_qpolynomial *pwqp);
148
149 int isl_pw_qpolynomial_is_zero(__isl_keep isl_pw_qpolynomial *pwqp);
150
151 __isl_give isl_dim *isl_pw_qpolynomial_get_dim(
152         __isl_keep isl_pw_qpolynomial *pwqp);
153 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_reset_dim(
154         __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_dim *dim);
155 unsigned isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial *pwqp,
156         enum isl_dim_type type);
157 int isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp,
158         enum isl_dim_type type, unsigned first, unsigned n);
159 int isl_pw_qpolynomial_has_equal_dim(__isl_keep isl_pw_qpolynomial *pwqp1,
160         __isl_keep isl_pw_qpolynomial *pwqp2);
161
162 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_set_dim_name(
163         __isl_take isl_pw_qpolynomial *pwqp,
164         enum isl_dim_type type, unsigned pos, const char *s);
165
166 __isl_give isl_set *isl_pw_qpolynomial_domain(__isl_take isl_pw_qpolynomial *pwqp);
167 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain(
168         __isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
169
170 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_drop_dims(
171         __isl_take isl_pw_qpolynomial *pwqp,
172         enum isl_dim_type type, unsigned first, unsigned n);
173 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_split_dims(
174         __isl_take isl_pw_qpolynomial *pwqp,
175         enum isl_dim_type type, unsigned first, unsigned n);
176
177 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add(
178         __isl_take isl_pw_qpolynomial *pwqp1,
179         __isl_take isl_pw_qpolynomial *pwqp2);
180 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sub(
181         __isl_take isl_pw_qpolynomial *pwqp1,
182         __isl_take isl_pw_qpolynomial *pwqp2);
183 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_disjoint(
184         __isl_take isl_pw_qpolynomial *pwqp1,
185         __isl_take isl_pw_qpolynomial *pwqp2);
186 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_neg(
187         __isl_take isl_pw_qpolynomial *pwqp);
188 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul(
189         __isl_take isl_pw_qpolynomial *pwqp1,
190         __isl_take isl_pw_qpolynomial *pwqp2);
191 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul_isl_int(
192         __isl_take isl_pw_qpolynomial *pwqp, isl_int v);
193
194 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_insert_dims(
195         __isl_take isl_pw_qpolynomial *pwqp, enum isl_dim_type type,
196         unsigned first, unsigned n);
197 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_dims(
198         __isl_take isl_pw_qpolynomial *pwqp,
199         enum isl_dim_type type, unsigned n);
200 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_move_dims(
201         __isl_take isl_pw_qpolynomial *pwqp,
202         enum isl_dim_type dst_type, unsigned dst_pos,
203         enum isl_dim_type src_type, unsigned src_pos, unsigned n);
204
205 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_fix_dim(
206         __isl_take isl_pw_qpolynomial *pwqp,
207         enum isl_dim_type type, unsigned n, isl_int v);
208
209 __isl_give isl_qpolynomial *isl_pw_qpolynomial_eval(
210         __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_point *pnt);
211
212 __isl_give isl_qpolynomial *isl_pw_qpolynomial_max(
213         __isl_take isl_pw_qpolynomial *pwqp);
214 __isl_give isl_qpolynomial *isl_pw_qpolynomial_min(
215         __isl_take isl_pw_qpolynomial *pwqp);
216
217 int isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp,
218         int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp,
219                     void *user), void *user);
220 int isl_pw_qpolynomial_foreach_lifted_piece(__isl_keep isl_pw_qpolynomial *pwqp,
221         int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp,
222                     void *user), void *user);
223
224 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_read_from_str(isl_ctx *ctx,
225                 const char *str);
226 __isl_give isl_printer *isl_printer_print_pw_qpolynomial(
227         __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial *pwqp);
228 void isl_pw_qpolynomial_print(__isl_keep isl_pw_qpolynomial *pwqp, FILE *out,
229         unsigned output_format);
230 void isl_pw_qpolynomial_dump(__isl_keep isl_pw_qpolynomial *pwqp);
231
232 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_coalesce(
233         __isl_take isl_pw_qpolynomial *pwqp);
234 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist(
235         __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_set *context);
236
237 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_split_periods(
238         __isl_take isl_pw_qpolynomial *pwqp, int max_periods);
239
240 __isl_give isl_pw_qpolynomial *isl_basic_set_multiplicative_call(
241         __isl_take isl_basic_set *bset,
242         __isl_give isl_pw_qpolynomial *(*fn)(__isl_take isl_basic_set *bset));
243
244 enum isl_fold {
245         isl_fold_min,
246         isl_fold_max,
247         isl_fold_list
248 };
249
250 struct isl_qpolynomial_fold;
251 typedef struct isl_qpolynomial_fold isl_qpolynomial_fold;
252
253 isl_ctx *isl_qpolynomial_fold_get_ctx(__isl_keep isl_qpolynomial_fold *fold);
254 enum isl_fold isl_qpolynomial_fold_get_type(__isl_keep isl_qpolynomial_fold *fold);
255
256 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_empty(enum isl_fold type,
257         __isl_take isl_dim *dim);
258 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_alloc(
259         enum isl_fold type, __isl_take isl_qpolynomial *qp);
260 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_copy(
261         __isl_keep isl_qpolynomial_fold *fold);
262 void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold *fold);
263
264 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_reset_dim(
265         __isl_take isl_qpolynomial_fold *fold, __isl_take isl_dim *dim);
266
267 int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold);
268 int isl_qpolynomial_fold_is_equal(__isl_keep isl_qpolynomial_fold *fold1,
269         __isl_keep isl_qpolynomial_fold *fold2);
270
271 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold(
272         __isl_take isl_qpolynomial_fold *fold1,
273         __isl_take isl_qpolynomial_fold *fold2);
274
275 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_mul_isl_int(
276         __isl_take isl_qpolynomial_fold *fold, isl_int v);
277
278 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_move_dims(
279         __isl_take isl_qpolynomial_fold *fold,
280         enum isl_dim_type dst_type, unsigned dst_pos,
281         enum isl_dim_type src_type, unsigned src_pos, unsigned n);
282
283 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_substitute(
284         __isl_take isl_qpolynomial_fold *fold,
285         enum isl_dim_type type, unsigned first, unsigned n,
286         __isl_keep isl_qpolynomial **subs);
287
288 __isl_give isl_qpolynomial *isl_qpolynomial_fold_eval(
289         __isl_take isl_qpolynomial_fold *fold, __isl_take isl_point *pnt);
290
291 int isl_qpolynomial_fold_foreach_qpolynomial(
292         __isl_keep isl_qpolynomial_fold *fold,
293         int (*fn)(__isl_take isl_qpolynomial *qp, void *user), void *user);
294
295 __isl_give isl_printer *isl_printer_print_qpolynomial_fold(
296         __isl_take isl_printer *p, __isl_keep isl_qpolynomial_fold *fold);
297 void isl_qpolynomial_fold_print(__isl_keep isl_qpolynomial_fold *fold, FILE *out,
298         unsigned output_format);
299 void isl_qpolynomial_fold_dump(__isl_keep isl_qpolynomial_fold *fold);
300
301 struct isl_pw_qpolynomial_fold;
302 typedef struct isl_pw_qpolynomial_fold isl_pw_qpolynomial_fold;
303
304 isl_ctx *isl_pw_qpolynomial_fold_get_ctx(__isl_keep isl_pw_qpolynomial_fold *pwf);
305
306 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_from_pw_qpolynomial(
307         enum isl_fold type, __isl_take isl_pw_qpolynomial *pwqp);
308
309 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_alloc(
310         enum isl_fold type,
311         __isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold);
312 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_copy(
313         __isl_keep isl_pw_qpolynomial_fold *pwf);
314 void isl_pw_qpolynomial_fold_free(__isl_take isl_pw_qpolynomial_fold *pwf);
315
316 int isl_pw_qpolynomial_fold_is_zero(__isl_keep isl_pw_qpolynomial_fold *pwf);
317
318 __isl_give isl_dim *isl_pw_qpolynomial_fold_get_dim(
319         __isl_keep isl_pw_qpolynomial_fold *pwf);
320 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_reset_dim(
321         __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_dim *dim);
322 unsigned isl_pw_qpolynomial_fold_dim(__isl_keep isl_pw_qpolynomial_fold *pwf,
323         enum isl_dim_type type);
324 int isl_pw_qpolynomial_fold_has_equal_dim(
325         __isl_keep isl_pw_qpolynomial_fold *pwf1,
326         __isl_keep isl_pw_qpolynomial_fold *pwf2);
327
328 size_t isl_pw_qpolynomial_fold_size(__isl_keep isl_pw_qpolynomial_fold *pwf);
329
330 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_zero(
331         __isl_take isl_dim *dim, enum isl_fold type);
332
333 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_set_dim_name(
334         __isl_take isl_pw_qpolynomial_fold *pwf,
335         enum isl_dim_type type, unsigned pos, const char *s);
336
337 __isl_give isl_set *isl_pw_qpolynomial_fold_domain(
338         __isl_take isl_pw_qpolynomial_fold *pwf);
339 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_domain(
340         __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
341
342 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
343         __isl_take isl_pw_qpolynomial_fold *pwf1,
344         __isl_take isl_pw_qpolynomial_fold *pwf2);
345 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fold(
346         __isl_take isl_pw_qpolynomial_fold *pwf1,
347         __isl_take isl_pw_qpolynomial_fold *pwf2);
348 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add_disjoint(
349         __isl_take isl_pw_qpolynomial_fold *pwf1,
350         __isl_take isl_pw_qpolynomial_fold *pwf2);
351 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_mul_isl_int(
352         __isl_take isl_pw_qpolynomial_fold *pwf, isl_int v);
353
354 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_drop_dims(
355         __isl_take isl_pw_qpolynomial_fold *pwf,
356         enum isl_dim_type type, unsigned first, unsigned n);
357 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_move_dims(
358         __isl_take isl_pw_qpolynomial_fold *pwf,
359         enum isl_dim_type dst_type, unsigned dst_pos,
360         enum isl_dim_type src_type, unsigned src_pos, unsigned n);
361
362 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_fix_dim(
363         __isl_take isl_pw_qpolynomial_fold *pwf,
364         enum isl_dim_type type, unsigned n, isl_int v);
365
366 __isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_eval(
367         __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_point *pnt);
368
369 int isl_pw_qpolynomial_fold_foreach_piece(
370         __isl_keep isl_pw_qpolynomial_fold *pwf,
371         int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold,
372                     void *user), void *user);
373 int isl_pw_qpolynomial_fold_foreach_lifted_piece(
374         __isl_keep isl_pw_qpolynomial_fold *pwf,
375         int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold,
376                     void *user), void *user);
377
378 __isl_give isl_printer *isl_printer_print_pw_qpolynomial_fold(
379         __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf);
380 void isl_pw_qpolynomial_fold_print(__isl_keep isl_pw_qpolynomial_fold *pwf,
381         FILE *out, unsigned output_format);
382 void isl_pw_qpolynomial_fold_dump(__isl_keep isl_pw_qpolynomial_fold *pwf);
383
384 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_coalesce(
385         __isl_take isl_pw_qpolynomial_fold *pwf);
386 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_gist(
387         __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *context);
388
389 __isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_max(
390         __isl_take isl_pw_qpolynomial_fold *pwf);
391 __isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_min(
392         __isl_take isl_pw_qpolynomial_fold *pwf);
393
394 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_bound(
395         __isl_take isl_pw_qpolynomial *pwqp, enum isl_fold type, int *tight);
396 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_bound(
397         __isl_take isl_pw_qpolynomial_fold *pwf, int *tight);
398 __isl_give isl_pw_qpolynomial_fold *isl_set_apply_pw_qpolynomial_fold(
399         __isl_take isl_set *set, __isl_take isl_pw_qpolynomial_fold *pwf,
400         int *tight);
401 __isl_give isl_pw_qpolynomial_fold *isl_map_apply_pw_qpolynomial_fold(
402         __isl_take isl_map *map, __isl_take isl_pw_qpolynomial_fold *pwf,
403         int *tight);
404
405 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_to_polynomial(
406         __isl_take isl_pw_qpolynomial *pwqp, int sign);
407
408 struct isl_union_pw_qpolynomial;
409 typedef struct isl_union_pw_qpolynomial isl_union_pw_qpolynomial;
410
411 isl_ctx *isl_union_pw_qpolynomial_get_ctx(
412         __isl_keep isl_union_pw_qpolynomial *upwqp);
413
414 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_from_pw_qpolynomial(__isl_take isl_pw_qpolynomial *pwqp);
415 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_zero(
416         __isl_take isl_dim *dim);
417 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add_pw_qpolynomial(
418         __isl_take isl_union_pw_qpolynomial *upwqp,
419         __isl_take isl_pw_qpolynomial *pwqp);
420 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_copy(
421         __isl_keep isl_union_pw_qpolynomial *upwqp);
422 void isl_union_pw_qpolynomial_free(__isl_take isl_union_pw_qpolynomial *upwqp);
423
424 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_add(
425         __isl_take isl_union_pw_qpolynomial *upwqp1,
426         __isl_take isl_union_pw_qpolynomial *upwqp2);
427 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_sub(
428         __isl_take isl_union_pw_qpolynomial *upwqp1,
429         __isl_take isl_union_pw_qpolynomial *upwqp2);
430 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul(
431         __isl_take isl_union_pw_qpolynomial *upwqp1,
432         __isl_take isl_union_pw_qpolynomial *upwqp2);
433 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_mul_isl_int(
434         __isl_take isl_union_pw_qpolynomial *upwqp, isl_int v);
435
436 __isl_give isl_union_set *isl_union_pw_qpolynomial_domain(
437         __isl_take isl_union_pw_qpolynomial *upwqp);
438 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_intersect_domain(
439         __isl_take isl_union_pw_qpolynomial *upwpq,
440         __isl_take isl_union_set *uset);
441
442 __isl_give isl_dim *isl_union_pw_qpolynomial_get_dim(
443         __isl_keep isl_union_pw_qpolynomial *upwqp);
444
445 __isl_give isl_qpolynomial *isl_union_pw_qpolynomial_eval(
446         __isl_take isl_union_pw_qpolynomial *upwqp, __isl_take isl_point *pnt);
447
448 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_coalesce(
449         __isl_take isl_union_pw_qpolynomial *upwqp);
450 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_gist(
451         __isl_take isl_union_pw_qpolynomial *upwqp,
452         __isl_take isl_union_set *context);
453
454 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_align_params(
455         __isl_take isl_union_pw_qpolynomial *upwqp,
456         __isl_take isl_dim *model);
457
458 int isl_union_pw_qpolynomial_foreach_pw_qpolynomial(
459         __isl_keep isl_union_pw_qpolynomial *upwqp,
460         int (*fn)(__isl_take isl_pw_qpolynomial *pwqp, void *user), void *user);
461 __isl_give isl_pw_qpolynomial *isl_union_pw_qpolynomial_extract_pw_qpolynomial(
462         __isl_keep isl_union_pw_qpolynomial *upwqp, __isl_take isl_dim *dim);
463
464 __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial(
465         __isl_take isl_printer *p, __isl_keep isl_union_pw_qpolynomial *upwqp);
466
467 struct isl_union_pw_qpolynomial_fold;
468 typedef struct isl_union_pw_qpolynomial_fold isl_union_pw_qpolynomial_fold;
469
470 isl_ctx *isl_union_pw_qpolynomial_fold_get_ctx(
471         __isl_keep isl_union_pw_qpolynomial_fold *upwf);
472
473 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_from_pw_qpolynomial_fold(__isl_take isl_pw_qpolynomial_fold *pwf);
474 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_zero(
475         __isl_take isl_dim *dim, enum isl_fold type);
476 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold_pw_qpolynomial_fold(
477         __isl_take isl_union_pw_qpolynomial_fold *upwqp,
478         __isl_take isl_pw_qpolynomial_fold *pwqp);
479 void isl_union_pw_qpolynomial_fold_free(
480         __isl_take isl_union_pw_qpolynomial_fold *upwf);
481 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_copy(
482         __isl_keep isl_union_pw_qpolynomial_fold *upwf);
483
484 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_fold(
485         __isl_take isl_union_pw_qpolynomial_fold *upwf1,
486         __isl_take isl_union_pw_qpolynomial_fold *upwf2);
487 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_add_union_pw_qpolynomial(
488         __isl_take isl_union_pw_qpolynomial_fold *upwf,
489         __isl_take isl_union_pw_qpolynomial *upwqp);
490 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_mul_isl_int(
491         __isl_take isl_union_pw_qpolynomial_fold *upwf, isl_int v);
492
493 __isl_give isl_union_set *isl_union_pw_qpolynomial_fold_domain(
494         __isl_take isl_union_pw_qpolynomial_fold *upwf);
495 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_intersect_domain(
496         __isl_take isl_union_pw_qpolynomial_fold *upwf,
497         __isl_take isl_union_set *uset);
498
499 enum isl_fold isl_union_pw_qpolynomial_fold_get_type(
500         __isl_keep isl_union_pw_qpolynomial_fold *upwf);
501 __isl_give isl_dim *isl_union_pw_qpolynomial_fold_get_dim(
502         __isl_keep isl_union_pw_qpolynomial_fold *upwf);
503
504 __isl_give isl_qpolynomial *isl_union_pw_qpolynomial_fold_eval(
505         __isl_take isl_union_pw_qpolynomial_fold *upwf,
506         __isl_take isl_point *pnt);
507
508 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_coalesce(
509         __isl_take isl_union_pw_qpolynomial_fold *upwf);
510 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_gist(
511         __isl_take isl_union_pw_qpolynomial_fold *upwf,
512         __isl_take isl_union_set *context);
513
514 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_align_params(
515         __isl_take isl_union_pw_qpolynomial_fold *upwf,
516         __isl_take isl_dim *model);
517
518 int isl_union_pw_qpolynomial_fold_foreach_pw_qpolynomial_fold(
519         __isl_keep isl_union_pw_qpolynomial_fold *upwf,
520         int (*fn)(__isl_take isl_pw_qpolynomial_fold *pwf,
521                     void *user), void *user);
522 __isl_give isl_pw_qpolynomial_fold *isl_union_pw_qpolynomial_fold_extract_pw_qpolynomial_fold(
523         __isl_keep isl_union_pw_qpolynomial_fold *upwf, __isl_take isl_dim *dim);
524
525 __isl_give isl_printer *isl_printer_print_union_pw_qpolynomial_fold(
526         __isl_take isl_printer *p,
527         __isl_keep isl_union_pw_qpolynomial_fold *upwf);
528
529 __isl_give isl_union_pw_qpolynomial_fold *isl_union_pw_qpolynomial_bound(
530         __isl_take isl_union_pw_qpolynomial *upwqp,
531         enum isl_fold type, int *tight);
532 __isl_give isl_union_pw_qpolynomial_fold *isl_union_set_apply_union_pw_qpolynomial_fold(
533         __isl_take isl_union_set *uset,
534         __isl_take isl_union_pw_qpolynomial_fold *upwf, int *tight);
535 __isl_give isl_union_pw_qpolynomial_fold *isl_union_map_apply_union_pw_qpolynomial_fold(
536         __isl_take isl_union_map *umap,
537         __isl_take isl_union_pw_qpolynomial_fold *upwf, int *tight);
538
539 __isl_give isl_union_pw_qpolynomial *isl_union_pw_qpolynomial_to_polynomial(
540         __isl_take isl_union_pw_qpolynomial *upwqp, int sign);
541
542 #if defined(__cplusplus)
543 }
544 #endif
545
546 #endif