2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the GNU LGPLv2.1 license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
15 #include <isl/point.h>
17 #if defined(__cplusplus)
21 unsigned isl_basic_set_n_dim(const struct isl_basic_set *bset);
22 unsigned isl_basic_set_n_param(const struct isl_basic_set *bset);
23 unsigned isl_basic_set_total_dim(const struct isl_basic_set *bset);
24 unsigned isl_basic_set_dim(const struct isl_basic_set *bset,
25 enum isl_dim_type type);
27 unsigned isl_set_n_dim(const struct isl_set *set);
28 unsigned isl_set_n_param(const struct isl_set *set);
29 unsigned isl_set_dim(const struct isl_set *set, enum isl_dim_type type);
31 isl_ctx *isl_basic_set_get_ctx(__isl_keep isl_basic_set *bset);
32 isl_ctx *isl_set_get_ctx(__isl_keep isl_set *set);
33 __isl_give isl_dim *isl_basic_set_get_dim(__isl_keep isl_basic_set *bset);
34 __isl_give isl_dim *isl_set_get_dim(__isl_keep isl_set *set);
35 __isl_give isl_set *isl_set_reset_dim(__isl_take isl_set *set,
36 __isl_take isl_dim *dim);
38 const char *isl_basic_set_get_tuple_name(__isl_keep isl_basic_set *bset);
39 const char *isl_set_get_tuple_name(__isl_keep isl_set *set);
40 __isl_give isl_set *isl_set_set_tuple_name(__isl_take isl_set *set,
42 const char *isl_basic_set_get_dim_name(__isl_keep isl_basic_set *bset,
43 enum isl_dim_type type, unsigned pos);
44 __isl_give isl_basic_set *isl_basic_set_set_dim_name(
45 __isl_take isl_basic_set *bset,
46 enum isl_dim_type type, unsigned pos, const char *s);
47 const char *isl_set_get_dim_name(__isl_keep isl_set *set,
48 enum isl_dim_type type, unsigned pos);
49 __isl_give isl_set *isl_set_set_dim_name(__isl_take isl_set *set,
50 enum isl_dim_type type, unsigned pos, const char *s);
52 int isl_basic_set_is_rational(__isl_keep isl_basic_set *bset);
54 struct isl_basic_set *isl_basic_set_alloc(struct isl_ctx *ctx,
55 unsigned nparam, unsigned dim, unsigned extra,
56 unsigned n_eq, unsigned n_ineq);
57 struct isl_basic_set *isl_basic_set_extend(struct isl_basic_set *base,
58 unsigned nparam, unsigned dim, unsigned extra,
59 unsigned n_eq, unsigned n_ineq);
60 struct isl_basic_set *isl_basic_set_extend_constraints(
61 struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq);
62 struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset);
63 void isl_basic_set_free(__isl_take isl_basic_set *bset);
64 __isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset);
65 struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset);
66 __isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_dim *dim);
67 struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *bset);
68 __isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_dim *dim);
69 __isl_give isl_basic_set *isl_basic_set_nat_universe(__isl_take isl_dim *dim);
70 struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *bset);
71 __isl_give isl_basic_set *isl_basic_set_universe_like_set(
72 __isl_keep isl_set *model);
73 struct isl_basic_set *isl_basic_set_interval(struct isl_ctx *ctx,
74 isl_int min, isl_int max);
75 struct isl_basic_set *isl_basic_set_positive_orthant(struct isl_dim *dims);
76 void isl_basic_set_print_internal(__isl_keep isl_basic_set *bset,
77 FILE *out, int indent);
78 __isl_give isl_basic_set *isl_basic_set_intersect(
79 __isl_take isl_basic_set *bset1,
80 __isl_take isl_basic_set *bset2);
81 __isl_give isl_basic_set *isl_basic_set_apply(
82 __isl_take isl_basic_set *bset,
83 __isl_take isl_basic_map *bmap);
84 __isl_give isl_basic_set *isl_basic_set_affine_hull(
85 __isl_take isl_basic_set *bset);
86 __isl_give isl_basic_set *isl_basic_set_remove_dims(
87 __isl_take isl_basic_set *bset,
88 enum isl_dim_type type, unsigned first, unsigned n);
89 struct isl_basic_set *isl_basic_set_simplify(struct isl_basic_set *bset);
90 __isl_give isl_basic_set *isl_basic_set_detect_equalities(
91 __isl_take isl_basic_set *bset);
92 __isl_give isl_basic_set *isl_basic_set_list_product(
93 __isl_take struct isl_basic_set_list *list);
95 __isl_give isl_basic_set *isl_basic_set_read_from_file(isl_ctx *ctx,
96 FILE *input, int nparam);
97 __isl_give isl_basic_set *isl_basic_set_read_from_str(isl_ctx *ctx,
98 const char *str, int nparam);
99 __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx,
100 FILE *input, int nparam);
101 __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx,
102 const char *str, int nparam);
103 void isl_basic_set_dump(__isl_keep isl_basic_set *bset);
104 void isl_set_dump(__isl_keep isl_set *set);
105 __isl_give isl_printer *isl_printer_print_basic_set(
106 __isl_take isl_printer *printer, __isl_keep isl_basic_set *bset);
107 __isl_give isl_printer *isl_printer_print_set(__isl_take isl_printer *printer,
108 __isl_keep isl_set *map);
109 void isl_basic_set_print(__isl_keep isl_basic_set *bset, FILE *out, int indent,
110 const char *prefix, const char *suffix, unsigned output_format);
111 void isl_set_print(__isl_keep struct isl_set *set, FILE *out, int indent,
112 unsigned output_format);
113 __isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset,
114 enum isl_dim_type type, unsigned pos, isl_int value);
115 struct isl_basic_set *isl_basic_set_fix_si(struct isl_basic_set *bset,
116 enum isl_dim_type type, unsigned pos, int value);
117 __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set,
118 enum isl_dim_type type, unsigned pos, int value);
119 __isl_give isl_set *isl_set_lower_bound_si(__isl_take isl_set *set,
120 enum isl_dim_type type, unsigned pos, int value);
122 struct isl_basic_set *isl_basic_set_from_underlying_set(
123 struct isl_basic_set *bset, struct isl_basic_set *like);
124 struct isl_set *isl_set_from_underlying_set(
125 struct isl_set *set, struct isl_basic_set *like);
126 struct isl_set *isl_set_to_underlying_set(struct isl_set *set);
128 int isl_basic_set_is_equal(
129 struct isl_basic_set *bset1, struct isl_basic_set *bset2);
131 __isl_give isl_set *isl_basic_set_partial_lexmin(
132 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
133 __isl_give isl_set **empty);
134 __isl_give isl_set *isl_basic_set_partial_lexmax(
135 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
136 __isl_give isl_set **empty);
137 __isl_give isl_set *isl_set_partial_lexmin(
138 __isl_take isl_set *set, __isl_take isl_set *dom,
139 __isl_give isl_set **empty);
140 __isl_give isl_set *isl_set_partial_lexmax(
141 __isl_take isl_set *set, __isl_take isl_set *dom,
142 __isl_give isl_set **empty);
143 __isl_give isl_set *isl_basic_set_lexmin(__isl_take isl_basic_set *bset);
144 __isl_give isl_set *isl_basic_set_lexmax(__isl_take isl_basic_set *bset);
145 __isl_give isl_set *isl_set_lexmin(__isl_take isl_set *set);
146 __isl_give isl_set *isl_set_lexmax(__isl_take isl_set *set);
147 __isl_give isl_set *isl_basic_set_union(
148 __isl_take isl_basic_set *bset1,
149 __isl_take isl_basic_set *bset2);
151 int isl_basic_set_compare_at(struct isl_basic_set *bset1,
152 struct isl_basic_set *bset2, int pos);
153 int isl_set_follows_at(__isl_keep isl_set *set1,
154 __isl_keep isl_set *set2, int pos);
156 int isl_basic_set_dims_get_sign(__isl_keep isl_basic_set *bset,
157 enum isl_dim_type type, unsigned pos, unsigned n, int *signs);
159 int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset);
160 int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set *bset);
161 int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset);
162 int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset);
164 struct isl_set *isl_set_alloc(struct isl_ctx *ctx,
165 unsigned nparam, unsigned dim, int n, unsigned flags);
166 struct isl_set *isl_set_extend(struct isl_set *base,
167 unsigned nparam, unsigned dim);
168 __isl_give isl_set *isl_set_empty(__isl_take isl_dim *dim);
169 struct isl_set *isl_set_empty_like(struct isl_set *set);
170 __isl_give isl_set *isl_set_universe(__isl_take isl_dim *dim);
171 __isl_give isl_set *isl_set_nat_universe(__isl_take isl_dim *dim);
172 __isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model);
173 __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
174 __isl_take isl_basic_set *bset);
175 struct isl_set *isl_set_finalize(struct isl_set *set);
176 __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
177 void isl_set_free(__isl_take isl_set *set);
178 struct isl_set *isl_set_dup(struct isl_set *set);
179 __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset);
180 __isl_give isl_basic_set *isl_set_sample(__isl_take isl_set *set);
181 __isl_give isl_point *isl_basic_set_sample_point(__isl_take isl_basic_set *bset);
182 __isl_give isl_point *isl_set_sample_point(__isl_take isl_set *set);
183 __isl_give isl_set *isl_set_detect_equalities(__isl_take isl_set *set);
184 __isl_give isl_basic_set *isl_set_affine_hull(__isl_take isl_set *set);
185 __isl_give isl_basic_set *isl_set_convex_hull(__isl_take isl_set *set);
186 __isl_give isl_basic_set *isl_set_polyhedral_hull(__isl_take isl_set *set);
187 __isl_give isl_basic_set *isl_set_simple_hull(__isl_take isl_set *set);
188 struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set);
189 __isl_give isl_set *isl_set_recession_cone(__isl_take isl_set *set);
191 struct isl_set *isl_set_union_disjoint(
192 struct isl_set *set1, struct isl_set *set2);
193 __isl_give isl_set *isl_set_union(
194 __isl_take isl_set *set1,
195 __isl_take isl_set *set2);
196 __isl_give isl_set *isl_set_product(__isl_take isl_set *set1,
197 __isl_take isl_set *set2);
198 __isl_give isl_basic_set *isl_basic_set_flat_product(
199 __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2);
200 __isl_give isl_set *isl_set_flat_product(__isl_take isl_set *set1,
201 __isl_take isl_set *set2);
202 __isl_give isl_set *isl_set_intersect(
203 __isl_take isl_set *set1,
204 __isl_take isl_set *set2);
205 __isl_give isl_set *isl_set_subtract(
206 __isl_take isl_set *set1,
207 __isl_take isl_set *set2);
208 __isl_give isl_set *isl_set_complement(__isl_take isl_set *set);
209 __isl_give isl_set *isl_set_apply(
210 __isl_take isl_set *set,
211 __isl_take isl_map *map);
212 __isl_give isl_set *isl_set_fix(__isl_take isl_set *set,
213 enum isl_dim_type type, unsigned pos, isl_int value);
214 struct isl_set *isl_set_fix_dim_si(struct isl_set *set,
215 unsigned dim, int value);
216 struct isl_set *isl_set_lower_bound_dim(struct isl_set *set,
217 unsigned dim, isl_int value);
218 __isl_give isl_set *isl_set_insert(__isl_take isl_set *set,
219 enum isl_dim_type type, unsigned pos, unsigned n);
220 __isl_give isl_basic_set *isl_basic_set_add(__isl_take isl_basic_set *bset,
221 enum isl_dim_type type, unsigned n);
222 __isl_give isl_set *isl_set_add_dims(__isl_take isl_set *set,
223 enum isl_dim_type type, unsigned n);
224 __isl_give isl_basic_set *isl_basic_set_move_dims(__isl_take isl_basic_set *bset,
225 enum isl_dim_type dst_type, unsigned dst_pos,
226 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
227 __isl_give isl_set *isl_set_move_dims(__isl_take isl_set *set,
228 enum isl_dim_type dst_type, unsigned dst_pos,
229 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
230 __isl_give isl_basic_set *isl_basic_set_project_out(
231 __isl_take isl_basic_set *bset,
232 enum isl_dim_type type, unsigned first, unsigned n);
233 __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
234 enum isl_dim_type type, unsigned first, unsigned n);
235 __isl_give isl_basic_set *isl_basic_set_remove_divs(
236 __isl_take isl_basic_set *bset);
237 struct isl_set *isl_set_eliminate_dims(struct isl_set *set,
238 unsigned first, unsigned n);
239 __isl_give isl_set *isl_set_remove_dims(__isl_take isl_set *bset,
240 enum isl_dim_type type, unsigned first, unsigned n);
241 __isl_give isl_set *isl_set_remove_divs_involving_dims(__isl_take isl_set *set,
242 enum isl_dim_type type, unsigned first, unsigned n);
243 __isl_give isl_set *isl_set_remove_unknown_divs(__isl_take isl_set *set);
244 __isl_give isl_set *isl_set_remove_divs(__isl_take isl_set *set);
245 __isl_give isl_set *isl_set_split_dims(__isl_take isl_set *set,
246 enum isl_dim_type type, unsigned first, unsigned n);
248 void isl_set_print_internal(__isl_keep isl_set *set, FILE *out, int indent);
249 int isl_set_fast_is_empty(__isl_keep isl_set *set);
250 int isl_set_fast_is_universe(__isl_keep isl_set *set);
251 int isl_set_is_empty(__isl_keep isl_set *set);
252 int isl_set_is_bounded(__isl_keep isl_set *set);
253 int isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
254 int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
255 int isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
256 int isl_set_is_singleton(__isl_keep isl_set *set);
257 int isl_set_is_box(__isl_keep isl_set *set);
258 int isl_set_has_equal_dim(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
260 __isl_give isl_set *isl_set_sum(__isl_take isl_set *set1,
261 __isl_take isl_set *set2);
262 __isl_give isl_basic_set *isl_basic_set_neg(__isl_take isl_basic_set *bset);
263 __isl_give isl_set *isl_set_neg(__isl_take isl_set *set);
265 __isl_give isl_set *isl_set_make_disjoint(__isl_take isl_set *set);
266 struct isl_set *isl_basic_set_compute_divs(struct isl_basic_set *bset);
267 __isl_give isl_set *isl_set_compute_divs(__isl_take isl_set *set);
268 __isl_give isl_set *isl_set_align_divs(__isl_take isl_set *set);
270 struct isl_basic_set *isl_set_copy_basic_set(struct isl_set *set);
271 struct isl_set *isl_set_drop_basic_set(struct isl_set *set,
272 struct isl_basic_set *bset);
274 int isl_basic_set_fast_dim_is_fixed(struct isl_basic_set *bset, unsigned dim,
277 int isl_set_fast_dim_is_fixed(struct isl_set *set, unsigned dim, isl_int *val);
278 int isl_set_fast_dim_has_fixed_lower_bound(struct isl_set *set,
279 unsigned dim, isl_int *val);
280 int isl_set_dim_is_bounded(__isl_keep isl_set *set,
281 enum isl_dim_type type, unsigned pos);
283 __isl_give isl_basic_set *isl_basic_set_gist(__isl_take isl_basic_set *bset,
284 __isl_take isl_basic_set *context);
285 __isl_give isl_set *isl_set_gist_basic_set(__isl_take isl_set *set,
286 __isl_take isl_basic_set *context);
287 __isl_give isl_set *isl_set_gist(__isl_take isl_set *set,
288 __isl_take isl_set *context);
289 int isl_basic_set_dim_residue_class(struct isl_basic_set *bset,
290 int pos, isl_int *modulo, isl_int *residue);
291 int isl_set_dim_residue_class(struct isl_set *set,
292 int pos, isl_int *modulo, isl_int *residue);
294 __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
296 int isl_set_fast_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
297 int isl_set_fast_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
299 uint32_t isl_set_get_hash(struct isl_set *set);
301 int isl_set_dim_is_unique(struct isl_set *set, unsigned dim);
303 int isl_set_n_basic_set(__isl_keep isl_set *set);
304 int isl_set_foreach_basic_set(__isl_keep isl_set *set,
305 int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user);
307 int isl_set_foreach_point(__isl_keep isl_set *set,
308 int (*fn)(__isl_take isl_point *pnt, void *user), void *user);
309 int isl_set_count(__isl_keep isl_set *set, isl_int *count);
310 int isl_basic_set_count_upto(__isl_keep isl_basic_set *bset,
311 isl_int max, isl_int *count);
312 int isl_set_count_upto(__isl_keep isl_set *set, isl_int max, isl_int *count);
314 __isl_give isl_basic_set *isl_basic_set_from_point(__isl_take isl_point *pnt);
315 __isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt);
316 __isl_give isl_basic_set *isl_basic_set_box_from_points(
317 __isl_take isl_point *pnt1, __isl_take isl_point *pnt2);
318 __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1,
319 __isl_take isl_point *pnt2);
321 __isl_give isl_basic_set *isl_basic_set_lift(__isl_take isl_basic_set *bset);
322 __isl_give isl_set *isl_set_lift(__isl_take isl_set *set);
324 __isl_give isl_map *isl_set_lex_le_set(__isl_take isl_set *set1,
325 __isl_take isl_set *set2);
326 __isl_give isl_map *isl_set_lex_lt_set(__isl_take isl_set *set1,
327 __isl_take isl_set *set2);
328 __isl_give isl_map *isl_set_lex_ge_set(__isl_take isl_set *set1,
329 __isl_take isl_set *set2);
330 __isl_give isl_map *isl_set_lex_gt_set(__isl_take isl_set *set1,
331 __isl_take isl_set *set2);
333 int isl_set_size(__isl_keep isl_set *set);
335 __isl_give isl_mat *isl_basic_set_equalities_matrix(
336 __isl_keep isl_basic_set *bset, enum isl_dim_type c1,
337 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
338 __isl_give isl_mat *isl_basic_set_inequalities_matrix(
339 __isl_keep isl_basic_set *bset, enum isl_dim_type c1,
340 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
341 __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices(
342 __isl_take isl_dim *dim,
343 __isl_take isl_mat *eq, __isl_take isl_mat *ineq, enum isl_dim_type c1,
344 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
346 __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset);
348 #if defined(__cplusplus)