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
13 #include <isl/map_type.h>
14 #include <isl/aff_type.h>
17 #include <isl/point.h>
18 #include <isl/local_space.h>
20 #if defined(__cplusplus)
24 unsigned isl_basic_set_n_dim(const struct isl_basic_set *bset);
25 unsigned isl_basic_set_n_param(const struct isl_basic_set *bset);
26 unsigned isl_basic_set_total_dim(const struct isl_basic_set *bset);
27 unsigned isl_basic_set_dim(const struct isl_basic_set *bset,
28 enum isl_dim_type type);
30 unsigned isl_set_n_dim(const struct isl_set *set);
31 unsigned isl_set_n_param(const struct isl_set *set);
32 unsigned isl_set_dim(const struct isl_set *set, enum isl_dim_type type);
34 isl_ctx *isl_basic_set_get_ctx(__isl_keep isl_basic_set *bset);
35 isl_ctx *isl_set_get_ctx(__isl_keep isl_set *set);
36 __isl_give isl_dim *isl_basic_set_get_dim(__isl_keep isl_basic_set *bset);
37 __isl_give isl_dim *isl_set_get_dim(__isl_keep isl_set *set);
38 __isl_give isl_set *isl_set_reset_dim(__isl_take isl_set *set,
39 __isl_take isl_dim *dim);
41 struct isl_div *isl_basic_set_div(struct isl_basic_set *bset, int pos);
43 __isl_give isl_local_space *isl_basic_set_get_local_space(
44 __isl_keep isl_basic_set *bset);
46 const char *isl_basic_set_get_tuple_name(__isl_keep isl_basic_set *bset);
47 const char *isl_set_get_tuple_name(__isl_keep isl_set *set);
48 __isl_give isl_basic_set *isl_basic_set_set_tuple_name(
49 __isl_take isl_basic_set *set, const char *s);
50 __isl_give isl_set *isl_set_set_tuple_name(__isl_take isl_set *set,
52 const char *isl_basic_set_get_dim_name(__isl_keep isl_basic_set *bset,
53 enum isl_dim_type type, unsigned pos);
54 __isl_give isl_basic_set *isl_basic_set_set_dim_name(
55 __isl_take isl_basic_set *bset,
56 enum isl_dim_type type, unsigned pos, const char *s);
57 const char *isl_set_get_dim_name(__isl_keep isl_set *set,
58 enum isl_dim_type type, unsigned pos);
59 __isl_give isl_set *isl_set_set_dim_name(__isl_take isl_set *set,
60 enum isl_dim_type type, unsigned pos, const char *s);
62 int isl_basic_set_is_rational(__isl_keep isl_basic_set *bset);
64 struct isl_basic_set *isl_basic_set_alloc(struct isl_ctx *ctx,
65 unsigned nparam, unsigned dim, unsigned extra,
66 unsigned n_eq, unsigned n_ineq);
67 struct isl_basic_set *isl_basic_set_extend(struct isl_basic_set *base,
68 unsigned nparam, unsigned dim, unsigned extra,
69 unsigned n_eq, unsigned n_ineq);
70 struct isl_basic_set *isl_basic_set_extend_constraints(
71 struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq);
72 struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset);
73 void isl_basic_set_free(__isl_take isl_basic_set *bset);
74 __isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset);
75 struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset);
76 __isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_dim *dim);
77 struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *bset);
78 __isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_dim *dim);
79 __isl_give isl_basic_set *isl_basic_set_nat_universe(__isl_take isl_dim *dim);
80 struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *bset);
81 __isl_give isl_basic_set *isl_basic_set_universe_like_set(
82 __isl_keep isl_set *model);
83 struct isl_basic_set *isl_basic_set_interval(struct isl_ctx *ctx,
84 isl_int min, isl_int max);
85 struct isl_basic_set *isl_basic_set_positive_orthant(struct isl_dim *dims);
86 void isl_basic_set_print_internal(__isl_keep isl_basic_set *bset,
87 FILE *out, int indent);
88 __isl_give isl_basic_set *isl_basic_set_intersect(
89 __isl_take isl_basic_set *bset1,
90 __isl_take isl_basic_set *bset2);
91 __isl_give isl_basic_set *isl_basic_set_apply(
92 __isl_take isl_basic_set *bset,
93 __isl_take isl_basic_map *bmap);
94 __isl_give isl_basic_set *isl_basic_set_affine_hull(
95 __isl_take isl_basic_set *bset);
96 __isl_give isl_basic_set *isl_basic_set_remove_dims(
97 __isl_take isl_basic_set *bset,
98 enum isl_dim_type type, unsigned first, unsigned n);
99 struct isl_basic_set *isl_basic_set_simplify(struct isl_basic_set *bset);
100 __isl_give isl_basic_set *isl_basic_set_detect_equalities(
101 __isl_take isl_basic_set *bset);
102 __isl_give isl_basic_set *isl_basic_set_remove_redundancies(
103 __isl_take isl_basic_set *bset);
104 __isl_give isl_set *isl_set_remove_redundancies(__isl_take isl_set *set);
105 __isl_give isl_basic_set *isl_basic_set_list_product(
106 __isl_take struct isl_basic_set_list *list);
108 __isl_give isl_basic_set *isl_basic_set_read_from_file(isl_ctx *ctx,
109 FILE *input, int nparam);
110 __isl_give isl_basic_set *isl_basic_set_read_from_str(isl_ctx *ctx,
111 const char *str, int nparam);
112 __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx,
113 FILE *input, int nparam);
114 __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx,
115 const char *str, int nparam);
116 void isl_basic_set_dump(__isl_keep isl_basic_set *bset);
117 void isl_set_dump(__isl_keep isl_set *set);
118 __isl_give isl_printer *isl_printer_print_basic_set(
119 __isl_take isl_printer *printer, __isl_keep isl_basic_set *bset);
120 __isl_give isl_printer *isl_printer_print_set(__isl_take isl_printer *printer,
121 __isl_keep isl_set *map);
122 void isl_basic_set_print(__isl_keep isl_basic_set *bset, FILE *out, int indent,
123 const char *prefix, const char *suffix, unsigned output_format);
124 void isl_set_print(__isl_keep struct isl_set *set, FILE *out, int indent,
125 unsigned output_format);
126 __isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset,
127 enum isl_dim_type type, unsigned pos, isl_int value);
128 __isl_give isl_basic_set *isl_basic_set_fix_si(__isl_take isl_basic_set *bset,
129 enum isl_dim_type type, unsigned pos, int value);
130 __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set,
131 enum isl_dim_type type, unsigned pos, int value);
132 __isl_give isl_set *isl_set_lower_bound_si(__isl_take isl_set *set,
133 enum isl_dim_type type, unsigned pos, int value);
135 struct isl_basic_set *isl_basic_set_from_underlying_set(
136 struct isl_basic_set *bset, struct isl_basic_set *like);
137 struct isl_set *isl_set_from_underlying_set(
138 struct isl_set *set, struct isl_basic_set *like);
139 struct isl_set *isl_set_to_underlying_set(struct isl_set *set);
141 int isl_basic_set_is_equal(
142 struct isl_basic_set *bset1, struct isl_basic_set *bset2);
144 __isl_give isl_set *isl_basic_set_partial_lexmin(
145 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
146 __isl_give isl_set **empty);
147 __isl_give isl_set *isl_basic_set_partial_lexmax(
148 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
149 __isl_give isl_set **empty);
150 __isl_give isl_set *isl_set_partial_lexmin(
151 __isl_take isl_set *set, __isl_take isl_set *dom,
152 __isl_give isl_set **empty);
153 __isl_give isl_set *isl_set_partial_lexmax(
154 __isl_take isl_set *set, __isl_take isl_set *dom,
155 __isl_give isl_set **empty);
156 __isl_give isl_set *isl_basic_set_lexmin(__isl_take isl_basic_set *bset);
157 __isl_give isl_set *isl_basic_set_lexmax(__isl_take isl_basic_set *bset);
158 __isl_give isl_set *isl_set_lexmin(__isl_take isl_set *set);
159 __isl_give isl_set *isl_set_lexmax(__isl_take isl_set *set);
160 int isl_basic_set_foreach_lexmax(__isl_keep isl_basic_set *bset,
161 int (*fn)(__isl_take isl_basic_set *dom, __isl_take isl_aff_list *list,
165 __isl_give isl_set *isl_basic_set_union(
166 __isl_take isl_basic_set *bset1,
167 __isl_take isl_basic_set *bset2);
169 int isl_basic_set_compare_at(struct isl_basic_set *bset1,
170 struct isl_basic_set *bset2, int pos);
171 int isl_set_follows_at(__isl_keep isl_set *set1,
172 __isl_keep isl_set *set2, int pos);
174 int isl_basic_set_dims_get_sign(__isl_keep isl_basic_set *bset,
175 enum isl_dim_type type, unsigned pos, unsigned n, int *signs);
177 int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset);
178 int isl_basic_set_plain_is_empty(__isl_keep isl_basic_set *bset);
179 int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set *bset);
180 int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset);
181 int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset);
183 struct isl_set *isl_set_alloc(struct isl_ctx *ctx,
184 unsigned nparam, unsigned dim, int n, unsigned flags);
185 struct isl_set *isl_set_extend(struct isl_set *base,
186 unsigned nparam, unsigned dim);
187 __isl_give isl_set *isl_set_empty(__isl_take isl_dim *dim);
188 struct isl_set *isl_set_empty_like(struct isl_set *set);
189 __isl_give isl_set *isl_set_universe(__isl_take isl_dim *dim);
190 __isl_give isl_set *isl_set_nat_universe(__isl_take isl_dim *dim);
191 __isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model);
192 __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
193 __isl_take isl_basic_set *bset);
194 struct isl_set *isl_set_finalize(struct isl_set *set);
195 __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
196 void isl_set_free(__isl_take isl_set *set);
197 struct isl_set *isl_set_dup(struct isl_set *set);
198 __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset);
199 __isl_give isl_basic_set *isl_set_sample(__isl_take isl_set *set);
200 __isl_give isl_point *isl_basic_set_sample_point(__isl_take isl_basic_set *bset);
201 __isl_give isl_point *isl_set_sample_point(__isl_take isl_set *set);
202 __isl_give isl_set *isl_set_detect_equalities(__isl_take isl_set *set);
203 __isl_give isl_basic_set *isl_set_affine_hull(__isl_take isl_set *set);
204 __isl_give isl_basic_set *isl_set_convex_hull(__isl_take isl_set *set);
205 __isl_give isl_basic_set *isl_set_polyhedral_hull(__isl_take isl_set *set);
206 __isl_give isl_basic_set *isl_set_simple_hull(__isl_take isl_set *set);
207 struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set);
208 __isl_give isl_set *isl_set_recession_cone(__isl_take isl_set *set);
210 struct isl_set *isl_set_union_disjoint(
211 struct isl_set *set1, struct isl_set *set2);
212 __isl_give isl_set *isl_set_union(
213 __isl_take isl_set *set1,
214 __isl_take isl_set *set2);
215 __isl_give isl_set *isl_set_product(__isl_take isl_set *set1,
216 __isl_take isl_set *set2);
217 __isl_give isl_basic_set *isl_basic_set_flat_product(
218 __isl_take isl_basic_set *bset1, __isl_take isl_basic_set *bset2);
219 __isl_give isl_set *isl_set_flat_product(__isl_take isl_set *set1,
220 __isl_take isl_set *set2);
221 __isl_give isl_set *isl_set_intersect(
222 __isl_take isl_set *set1,
223 __isl_take isl_set *set2);
224 __isl_give isl_set *isl_set_subtract(
225 __isl_take isl_set *set1,
226 __isl_take isl_set *set2);
227 __isl_give isl_set *isl_set_complement(__isl_take isl_set *set);
228 __isl_give isl_set *isl_set_apply(
229 __isl_take isl_set *set,
230 __isl_take isl_map *map);
231 __isl_give isl_set *isl_set_fix(__isl_take isl_set *set,
232 enum isl_dim_type type, unsigned pos, isl_int value);
233 struct isl_set *isl_set_fix_dim_si(struct isl_set *set,
234 unsigned dim, int value);
235 struct isl_set *isl_set_lower_bound_dim(struct isl_set *set,
236 unsigned dim, isl_int value);
237 __isl_give isl_set *isl_set_insert(__isl_take isl_set *set,
238 enum isl_dim_type type, unsigned pos, unsigned n);
239 __isl_give isl_basic_set *isl_basic_set_add(__isl_take isl_basic_set *bset,
240 enum isl_dim_type type, unsigned n);
241 __isl_give isl_set *isl_set_add_dims(__isl_take isl_set *set,
242 enum isl_dim_type type, unsigned n);
243 __isl_give isl_basic_set *isl_basic_set_move_dims(__isl_take isl_basic_set *bset,
244 enum isl_dim_type dst_type, unsigned dst_pos,
245 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
246 __isl_give isl_set *isl_set_move_dims(__isl_take isl_set *set,
247 enum isl_dim_type dst_type, unsigned dst_pos,
248 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
249 __isl_give isl_basic_set *isl_basic_set_project_out(
250 __isl_take isl_basic_set *bset,
251 enum isl_dim_type type, unsigned first, unsigned n);
252 __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
253 enum isl_dim_type type, unsigned first, unsigned n);
254 __isl_give isl_basic_set *isl_basic_set_remove_divs(
255 __isl_take isl_basic_set *bset);
256 __isl_give isl_set *isl_set_eliminate(__isl_take isl_set *set,
257 enum isl_dim_type type, unsigned first, unsigned n);
258 struct isl_set *isl_set_eliminate_dims(struct isl_set *set,
259 unsigned first, unsigned n);
260 __isl_give isl_set *isl_set_remove_dims(__isl_take isl_set *bset,
261 enum isl_dim_type type, unsigned first, unsigned n);
262 __isl_give isl_set *isl_set_remove_divs_involving_dims(__isl_take isl_set *set,
263 enum isl_dim_type type, unsigned first, unsigned n);
264 __isl_give isl_set *isl_set_remove_unknown_divs(__isl_take isl_set *set);
265 __isl_give isl_set *isl_set_remove_divs(__isl_take isl_set *set);
266 __isl_give isl_set *isl_set_split_dims(__isl_take isl_set *set,
267 enum isl_dim_type type, unsigned first, unsigned n);
269 int isl_basic_set_involves_dims(__isl_keep isl_basic_set *bset,
270 enum isl_dim_type type, unsigned first, unsigned n);
271 int isl_set_involves_dims(__isl_keep isl_set *set,
272 enum isl_dim_type type, unsigned first, unsigned n);
274 void isl_set_print_internal(__isl_keep isl_set *set, FILE *out, int indent);
275 int isl_set_plain_is_empty(__isl_keep isl_set *set);
276 int isl_set_fast_is_empty(__isl_keep isl_set *set);
277 int isl_set_plain_is_universe(__isl_keep isl_set *set);
278 int isl_set_fast_is_universe(__isl_keep isl_set *set);
279 int isl_set_is_empty(__isl_keep isl_set *set);
280 int isl_set_is_bounded(__isl_keep isl_set *set);
281 int isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
282 int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
283 int isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
284 int isl_set_is_singleton(__isl_keep isl_set *set);
285 int isl_set_is_box(__isl_keep isl_set *set);
286 int isl_set_has_equal_dim(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
288 __isl_give isl_set *isl_set_sum(__isl_take isl_set *set1,
289 __isl_take isl_set *set2);
290 __isl_give isl_basic_set *isl_basic_set_neg(__isl_take isl_basic_set *bset);
291 __isl_give isl_set *isl_set_neg(__isl_take isl_set *set);
293 __isl_give isl_set *isl_set_make_disjoint(__isl_take isl_set *set);
294 struct isl_set *isl_basic_set_compute_divs(struct isl_basic_set *bset);
295 __isl_give isl_set *isl_set_compute_divs(__isl_take isl_set *set);
296 __isl_give isl_set *isl_set_align_divs(__isl_take isl_set *set);
298 struct isl_basic_set *isl_set_copy_basic_set(struct isl_set *set);
299 struct isl_set *isl_set_drop_basic_set(struct isl_set *set,
300 struct isl_basic_set *bset);
302 int isl_basic_set_plain_dim_is_fixed(__isl_keep isl_basic_set *bset,
303 unsigned dim, isl_int *val);
305 int isl_set_plain_dim_is_fixed(__isl_keep isl_set *set,
306 unsigned dim, isl_int *val);
307 int isl_set_fast_dim_is_fixed(__isl_keep isl_set *set,
308 unsigned dim, isl_int *val);
309 int isl_set_plain_dim_has_fixed_lower_bound(__isl_keep isl_set *set,
310 unsigned dim, isl_int *val);
311 int isl_set_dim_is_bounded(__isl_keep isl_set *set,
312 enum isl_dim_type type, unsigned pos);
314 __isl_give isl_basic_set *isl_basic_set_gist(__isl_take isl_basic_set *bset,
315 __isl_take isl_basic_set *context);
316 __isl_give isl_set *isl_set_gist_basic_set(__isl_take isl_set *set,
317 __isl_take isl_basic_set *context);
318 __isl_give isl_set *isl_set_gist(__isl_take isl_set *set,
319 __isl_take isl_set *context);
320 int isl_basic_set_dim_residue_class(struct isl_basic_set *bset,
321 int pos, isl_int *modulo, isl_int *residue);
322 int isl_set_dim_residue_class(struct isl_set *set,
323 int pos, isl_int *modulo, isl_int *residue);
325 __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
327 int isl_set_plain_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
328 int isl_set_fast_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
329 int isl_set_plain_is_disjoint(__isl_keep isl_set *set1,
330 __isl_keep isl_set *set2);
331 int isl_set_fast_is_disjoint(__isl_keep isl_set *set1,
332 __isl_keep isl_set *set2);
334 uint32_t isl_set_get_hash(struct isl_set *set);
336 int isl_set_dim_is_unique(struct isl_set *set, unsigned dim);
338 int isl_set_n_basic_set(__isl_keep isl_set *set);
339 int isl_set_foreach_basic_set(__isl_keep isl_set *set,
340 int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user);
342 int isl_set_foreach_point(__isl_keep isl_set *set,
343 int (*fn)(__isl_take isl_point *pnt, void *user), void *user);
344 int isl_set_count(__isl_keep isl_set *set, isl_int *count);
345 int isl_basic_set_count_upto(__isl_keep isl_basic_set *bset,
346 isl_int max, isl_int *count);
347 int isl_set_count_upto(__isl_keep isl_set *set, isl_int max, isl_int *count);
349 __isl_give isl_basic_set *isl_basic_set_from_point(__isl_take isl_point *pnt);
350 __isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt);
351 __isl_give isl_basic_set *isl_basic_set_box_from_points(
352 __isl_take isl_point *pnt1, __isl_take isl_point *pnt2);
353 __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1,
354 __isl_take isl_point *pnt2);
356 __isl_give isl_basic_set *isl_basic_set_lift(__isl_take isl_basic_set *bset);
357 __isl_give isl_set *isl_set_lift(__isl_take isl_set *set);
359 __isl_give isl_map *isl_set_lex_le_set(__isl_take isl_set *set1,
360 __isl_take isl_set *set2);
361 __isl_give isl_map *isl_set_lex_lt_set(__isl_take isl_set *set1,
362 __isl_take isl_set *set2);
363 __isl_give isl_map *isl_set_lex_ge_set(__isl_take isl_set *set1,
364 __isl_take isl_set *set2);
365 __isl_give isl_map *isl_set_lex_gt_set(__isl_take isl_set *set1,
366 __isl_take isl_set *set2);
368 int isl_set_size(__isl_keep isl_set *set);
370 __isl_give isl_set *isl_set_align_params(__isl_take isl_set *set,
371 __isl_take isl_dim *model);
373 __isl_give isl_mat *isl_basic_set_equalities_matrix(
374 __isl_keep isl_basic_set *bset, enum isl_dim_type c1,
375 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
376 __isl_give isl_mat *isl_basic_set_inequalities_matrix(
377 __isl_keep isl_basic_set *bset, enum isl_dim_type c1,
378 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
379 __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices(
380 __isl_take isl_dim *dim,
381 __isl_take isl_mat *eq, __isl_take isl_mat *ineq, enum isl_dim_type c1,
382 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
384 __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset);
386 __isl_give isl_basic_set *isl_basic_set_coefficients(
387 __isl_take isl_basic_set *bset);
388 __isl_give isl_basic_set *isl_set_coefficients(__isl_take isl_set *set);
389 __isl_give isl_basic_set *isl_basic_set_solutions(
390 __isl_take isl_basic_set *bset);
391 __isl_give isl_basic_set *isl_set_solutions(__isl_take isl_set *set);
393 __isl_give isl_pw_aff *isl_set_dim_max(__isl_take isl_set *set, int pos);
395 #if defined(__cplusplus)