1 #ifndef ISL_POLYNOMIAL_H
2 #define ISL_POLYNOMIAL_H
9 #include <isl_printer.h>
11 #if defined(__cplusplus)
15 struct isl_qpolynomial;
16 typedef struct isl_qpolynomial isl_qpolynomial;
18 __isl_give isl_qpolynomial *isl_qpolynomial_zero(__isl_take isl_dim *dim);
19 __isl_give isl_qpolynomial *isl_qpolynomial_infty(__isl_take isl_dim *dim);
20 __isl_give isl_qpolynomial *isl_qpolynomial_nan(__isl_take isl_dim *dim);
21 __isl_give isl_qpolynomial *isl_qpolynomial_rat_cst(__isl_take isl_dim *dim,
22 const isl_int n, const isl_int d);
23 __isl_give isl_qpolynomial *isl_qpolynomial_div(__isl_take isl_div *div);
24 __isl_give isl_qpolynomial *isl_qpolynomial_var(__isl_take isl_dim *dim,
25 enum isl_dim_type type, unsigned pos);
26 __isl_give isl_qpolynomial *isl_qpolynomial_copy(__isl_keep isl_qpolynomial *qp);
27 void isl_qpolynomial_free(__isl_take isl_qpolynomial *qp);
29 int isl_qpolynomial_is_equal(__isl_keep isl_qpolynomial *qp1,
30 __isl_keep isl_qpolynomial *qp2);
31 int isl_qpolynomial_is_cst(__isl_keep isl_qpolynomial *qp,
32 isl_int *n, isl_int *d);
33 void isl_qpolynomial_get_den(__isl_keep isl_qpolynomial *qp, isl_int *d);
35 __isl_give isl_qpolynomial *isl_qpolynomial_neg(__isl_take isl_qpolynomial *qp);
36 __isl_give isl_qpolynomial *isl_qpolynomial_add(__isl_take isl_qpolynomial *qp1,
37 __isl_take isl_qpolynomial *qp2);
38 __isl_give isl_qpolynomial *isl_qpolynomial_mul(__isl_take isl_qpolynomial *qp1,
39 __isl_take isl_qpolynomial *qp2);
42 typedef struct isl_term isl_term;
44 isl_ctx *isl_term_get_ctx(__isl_keep isl_term *term);
46 void isl_term_free(__isl_take isl_term *term);
48 unsigned isl_term_dim(__isl_keep isl_term *term, enum isl_dim_type type);
49 void isl_term_get_num(__isl_keep isl_term *term, isl_int *n);
50 void isl_term_get_den(__isl_keep isl_term *term, isl_int *d);
51 int isl_term_get_exp(__isl_keep isl_term *term,
52 enum isl_dim_type type, unsigned pos);
53 __isl_give isl_div *isl_term_get_div(__isl_keep isl_term *term, unsigned pos);
55 int isl_qpolynomial_foreach_term(__isl_keep isl_qpolynomial *qp,
56 int (*fn)(__isl_take isl_term *term, void *user), void *user);
58 __isl_give isl_qpolynomial *isl_qpolynomial_eval(
59 __isl_take isl_qpolynomial *qp, __isl_take isl_point *pnt);
61 __isl_give isl_printer *isl_printer_print_qpolynomial(
62 __isl_take isl_printer *p, __isl_keep isl_qpolynomial *qp);
63 void isl_qpolynomial_print(__isl_keep isl_qpolynomial *qp, FILE *out,
64 unsigned output_format);
66 struct isl_pw_qpolynomial;
67 typedef struct isl_pw_qpolynomial isl_pw_qpolynomial;
69 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_zero(__isl_take isl_dim *dim);
70 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_alloc(__isl_take isl_set *set,
71 __isl_take isl_qpolynomial *qp);
72 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_copy(
73 __isl_keep isl_pw_qpolynomial *pwqp);
74 void isl_pw_qpolynomial_free(__isl_take isl_pw_qpolynomial *pwqp);
76 __isl_give isl_dim *isl_pw_qpolynomial_get_dim(
77 __isl_keep isl_pw_qpolynomial *pwqp);
78 unsigned isl_pw_qpolynomial_dim(__isl_keep isl_pw_qpolynomial *pwqp,
79 enum isl_dim_type type);
80 int isl_pw_qpolynomial_involves_dims(__isl_keep isl_pw_qpolynomial *pwqp,
81 enum isl_dim_type type, unsigned first, unsigned n);
83 __isl_give isl_set *isl_pw_qpolynomial_domain(__isl_take isl_pw_qpolynomial *pwqp);
84 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_intersect_domain(
85 __isl_take isl_pw_qpolynomial *pwpq, __isl_take isl_set *set);
87 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add(
88 __isl_take isl_pw_qpolynomial *pwqp1,
89 __isl_take isl_pw_qpolynomial *pwqp2);
90 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_sub(
91 __isl_take isl_pw_qpolynomial *pwqp1,
92 __isl_take isl_pw_qpolynomial *pwqp2);
93 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_add_disjoint(
94 __isl_take isl_pw_qpolynomial *pwqp1,
95 __isl_take isl_pw_qpolynomial *pwqp2);
96 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_neg(
97 __isl_take isl_pw_qpolynomial *pwqp);
98 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_mul(
99 __isl_take isl_pw_qpolynomial *pwqp1,
100 __isl_take isl_pw_qpolynomial *pwqp2);
102 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_move(
103 __isl_take isl_pw_qpolynomial *pwqp,
104 enum isl_dim_type dst_type, unsigned dst_pos,
105 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
107 __isl_give isl_qpolynomial *isl_pw_qpolynomial_eval(
108 __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_point *pnt);
110 __isl_give isl_qpolynomial *isl_pw_qpolynomial_max(
111 __isl_take isl_pw_qpolynomial *pwqp);
113 int isl_pw_qpolynomial_foreach_piece(__isl_keep isl_pw_qpolynomial *pwqp,
114 int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp,
115 void *user), void *user);
116 int isl_pw_qpolynomial_foreach_lifted_piece(__isl_keep isl_pw_qpolynomial *pwqp,
117 int (*fn)(__isl_take isl_set *set, __isl_take isl_qpolynomial *qp,
118 void *user), void *user);
120 __isl_give isl_printer *isl_printer_print_pw_qpolynomial(
121 __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial *pwqp);
122 void isl_pw_qpolynomial_print(__isl_keep isl_pw_qpolynomial *pwqp, FILE *out,
123 unsigned output_format);
125 __isl_give isl_pw_qpolynomial *isl_pw_qpolynomial_gist(
126 __isl_take isl_pw_qpolynomial *pwqp, __isl_take isl_set *context);
134 struct isl_qpolynomial_fold;
135 typedef struct isl_qpolynomial_fold isl_qpolynomial_fold;
137 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_empty(enum isl_fold type,
138 __isl_take isl_dim *dim);
139 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_alloc(
140 enum isl_fold type, __isl_take isl_qpolynomial *qp);
141 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_copy(
142 __isl_keep isl_qpolynomial_fold *fold);
143 void isl_qpolynomial_fold_free(__isl_take isl_qpolynomial_fold *fold);
145 int isl_qpolynomial_fold_is_empty(__isl_keep isl_qpolynomial_fold *fold);
146 int isl_qpolynomial_fold_is_equal(__isl_keep isl_qpolynomial_fold *fold1,
147 __isl_keep isl_qpolynomial_fold *fold2);
149 __isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_fold(
150 __isl_take isl_qpolynomial_fold *fold1,
151 __isl_take isl_qpolynomial_fold *fold2);
153 __isl_give isl_qpolynomial *isl_qpolynomial_fold_eval(
154 __isl_take isl_qpolynomial_fold *fold, __isl_take isl_point *pnt);
156 void isl_qpolynomial_fold_print(__isl_keep isl_qpolynomial_fold *fold, FILE *out,
157 unsigned output_format);
159 struct isl_pw_qpolynomial_fold;
160 typedef struct isl_pw_qpolynomial_fold isl_pw_qpolynomial_fold;
162 isl_ctx *isl_pw_qpolynomial_fold_get_ctx(__isl_keep isl_pw_qpolynomial_fold *pwf);
164 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_from_pw_qpolynomial(
165 enum isl_fold type, __isl_take isl_pw_qpolynomial *pwqp);
167 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_alloc(
168 __isl_take isl_set *set, __isl_take isl_qpolynomial_fold *fold);
169 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_copy(
170 __isl_keep isl_pw_qpolynomial_fold *pwf);
171 void isl_pw_qpolynomial_fold_free(__isl_take isl_pw_qpolynomial_fold *pwf);
173 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_zero(
174 __isl_take isl_dim *dim);
176 __isl_give isl_set *isl_pw_qpolynomial_fold_domain(
177 __isl_take isl_pw_qpolynomial_fold *pwf);
178 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_intersect_domain(
179 __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *set);
181 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
182 __isl_take isl_pw_qpolynomial_fold *pwf1,
183 __isl_take isl_pw_qpolynomial_fold *pwf2);
184 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add_disjoint(
185 __isl_take isl_pw_qpolynomial_fold *pwf1,
186 __isl_take isl_pw_qpolynomial_fold *pwf2);
188 __isl_give isl_qpolynomial *isl_pw_qpolynomial_fold_eval(
189 __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_point *pnt);
191 __isl_give isl_printer *isl_printer_print_pw_qpolynomial_fold(
192 __isl_take isl_printer *p, __isl_keep isl_pw_qpolynomial_fold *pwf);
193 void isl_pw_qpolynomial_fold_print(__isl_keep isl_pw_qpolynomial_fold *pwf,
194 FILE *out, unsigned output_format);
196 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_coalesce(
197 __isl_take isl_pw_qpolynomial_fold *pwf);
198 __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_gist(
199 __isl_take isl_pw_qpolynomial_fold *pwf, __isl_take isl_set *context);
201 #if defined(__cplusplus)