add isl_vec_insert_zero_els
[isl.git] / isl_polynomial_private.h
blob8f6a7b799689e896dd0c9a6817734070c7be33d6
1 #include <stdio.h>
2 #include <isl/div.h>
3 #include <isl/map.h>
4 #include <isl/mat.h>
5 #include <isl_morph.h>
6 #include <isl/polynomial.h>
7 #include <isl_reordering.h>
9 struct isl_upoly {
10 int ref;
11 struct isl_ctx *ctx;
13 int var;
16 struct isl_upoly_cst {
17 struct isl_upoly up;
18 isl_int n;
19 isl_int d;
22 struct isl_upoly_rec {
23 struct isl_upoly up;
24 int n;
26 size_t size;
27 struct isl_upoly *p[];
30 struct isl_qpolynomial {
31 int ref;
33 struct isl_dim *dim;
34 struct isl_mat *div;
35 struct isl_upoly *upoly;
38 struct isl_term {
39 int ref;
41 isl_int n;
42 isl_int d;
44 struct isl_dim *dim;
45 struct isl_mat *div;
47 int pow[1];
50 struct isl_pw_qpolynomial_piece {
51 struct isl_set *set;
52 struct isl_qpolynomial *qp;
55 struct isl_pw_qpolynomial {
56 int ref;
58 struct isl_dim *dim;
60 int n;
62 size_t size;
63 struct isl_pw_qpolynomial_piece p[1];
66 struct isl_qpolynomial_fold {
67 int ref;
69 enum isl_fold type;
70 struct isl_dim *dim;
72 int n;
74 size_t size;
75 struct isl_qpolynomial *qp[1];
78 struct isl_pw_qpolynomial_fold_piece {
79 struct isl_set *set;
80 struct isl_qpolynomial_fold *fold;
83 struct isl_pw_qpolynomial_fold {
84 int ref;
86 enum isl_fold type;
87 struct isl_dim *dim;
89 int n;
91 size_t size;
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,
121 isl_int v);
122 __isl_give isl_qpolynomial *isl_qpolynomial_var_pow(__isl_take isl_dim *dim,
123 int pos, int power);
124 __isl_give isl_qpolynomial *isl_qpolynomial_div_pow(__isl_take isl_div *div,
125 int power);
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);