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_set_get_tuple_name(__isl_keep isl_set *set);
39 __isl_give isl_set *isl_set_set_tuple_name(__isl_take isl_set *set,
41 __isl_give isl_basic_set *isl_basic_set_set_dim_name(
42 __isl_take isl_basic_set *bset,
43 enum isl_dim_type type, unsigned pos, const char *s);
44 const char *isl_set_get_dim_name(__isl_keep isl_set *set,
45 enum isl_dim_type type, unsigned pos);
46 __isl_give isl_set *isl_set_set_dim_name(__isl_take isl_set *set,
47 enum isl_dim_type type, unsigned pos, const char *s);
49 struct isl_basic_set *isl_basic_set_alloc(struct isl_ctx *ctx,
50 unsigned nparam, unsigned dim, unsigned extra,
51 unsigned n_eq, unsigned n_ineq);
52 struct isl_basic_set *isl_basic_set_extend(struct isl_basic_set *base,
53 unsigned nparam, unsigned dim, unsigned extra,
54 unsigned n_eq, unsigned n_ineq);
55 struct isl_basic_set *isl_basic_set_extend_constraints(
56 struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq);
57 struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset);
58 void isl_basic_set_free(__isl_take isl_basic_set *bset);
59 __isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset);
60 struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset);
61 __isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_dim *dim);
62 struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *bset);
63 __isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_dim *dim);
64 struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *bset);
65 __isl_give isl_basic_set *isl_basic_set_universe_like_set(
66 __isl_keep isl_set *model);
67 struct isl_basic_set *isl_basic_set_interval(struct isl_ctx *ctx,
68 isl_int min, isl_int max);
69 struct isl_basic_set *isl_basic_set_positive_orthant(struct isl_dim *dims);
70 void isl_basic_set_print_internal(__isl_keep isl_basic_set *bset,
71 FILE *out, int indent);
72 struct isl_basic_set *isl_basic_set_swap_vars(
73 struct isl_basic_set *bset, unsigned n);
74 __isl_give isl_basic_set *isl_basic_set_intersect(
75 __isl_take isl_basic_set *bset1,
76 __isl_take isl_basic_set *bset2);
77 __isl_give isl_basic_set *isl_basic_set_apply(
78 __isl_take isl_basic_set *bset,
79 __isl_take isl_basic_map *bmap);
80 __isl_give isl_basic_set *isl_basic_set_affine_hull(
81 __isl_take isl_basic_set *bset);
82 __isl_give isl_basic_set *isl_basic_set_remove_dims(
83 __isl_take isl_basic_set *bset,
84 enum isl_dim_type type, unsigned first, unsigned n);
85 struct isl_basic_set *isl_basic_set_simplify(struct isl_basic_set *bset);
86 __isl_give isl_basic_set *isl_basic_set_detect_equalities(
87 __isl_take isl_basic_set *bset);
88 __isl_give isl_basic_set *isl_basic_set_list_product(
89 __isl_take struct isl_basic_set_list *list);
91 __isl_give isl_basic_set *isl_basic_set_read_from_file(isl_ctx *ctx,
92 FILE *input, int nparam);
93 __isl_give isl_basic_set *isl_basic_set_read_from_str(isl_ctx *ctx,
94 const char *str, int nparam);
95 __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx,
96 FILE *input, int nparam);
97 __isl_give isl_set *isl_set_read_from_str(isl_ctx *ctx,
98 const char *str, int nparam);
99 void isl_basic_set_dump(__isl_keep isl_basic_set *bset);
100 void isl_set_dump(__isl_keep isl_set *set);
101 __isl_give isl_printer *isl_printer_print_basic_set(
102 __isl_take isl_printer *printer, __isl_keep isl_basic_set *bset);
103 __isl_give isl_printer *isl_printer_print_set(__isl_take isl_printer *printer,
104 __isl_keep isl_set *map);
105 void isl_basic_set_print(__isl_keep isl_basic_set *bset, FILE *out, int indent,
106 const char *prefix, const char *suffix, unsigned output_format);
107 void isl_set_print(__isl_keep struct isl_set *set, FILE *out, int indent,
108 unsigned output_format);
109 __isl_give isl_basic_set *isl_basic_set_fix(__isl_take isl_basic_set *bset,
110 enum isl_dim_type type, unsigned pos, isl_int value);
111 struct isl_basic_set *isl_basic_set_fix_si(struct isl_basic_set *bset,
112 enum isl_dim_type type, unsigned pos, int value);
113 __isl_give isl_set *isl_set_fix_si(__isl_take isl_set *set,
114 enum isl_dim_type type, unsigned pos, int value);
115 __isl_give isl_set *isl_set_lower_bound_si(__isl_take isl_set *set,
116 enum isl_dim_type type, unsigned pos, int value);
118 struct isl_basic_set *isl_basic_set_from_underlying_set(
119 struct isl_basic_set *bset, struct isl_basic_set *like);
120 struct isl_set *isl_set_from_underlying_set(
121 struct isl_set *set, struct isl_basic_set *like);
122 struct isl_set *isl_set_to_underlying_set(struct isl_set *set);
124 int isl_basic_set_is_equal(
125 struct isl_basic_set *bset1, struct isl_basic_set *bset2);
127 __isl_give isl_set *isl_basic_set_partial_lexmin(
128 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
129 __isl_give isl_set **empty);
130 __isl_give isl_set *isl_basic_set_partial_lexmax(
131 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
132 __isl_give isl_set **empty);
133 __isl_give isl_set *isl_set_partial_lexmin(
134 __isl_take isl_set *set, __isl_take isl_set *dom,
135 __isl_give isl_set **empty);
136 __isl_give isl_set *isl_set_partial_lexmax(
137 __isl_take isl_set *set, __isl_take isl_set *dom,
138 __isl_give isl_set **empty);
139 __isl_give isl_set *isl_basic_set_lexmin(__isl_take isl_basic_set *bset);
140 __isl_give isl_set *isl_basic_set_lexmax(__isl_take isl_basic_set *bset);
141 __isl_give isl_set *isl_set_lexmin(__isl_take isl_set *set);
142 __isl_give isl_set *isl_set_lexmax(__isl_take isl_set *set);
143 __isl_give isl_set *isl_basic_set_union(
144 __isl_take isl_basic_set *bset1,
145 __isl_take isl_basic_set *bset2);
147 int isl_basic_set_compare_at(struct isl_basic_set *bset1,
148 struct isl_basic_set *bset2, int pos);
149 int isl_set_follows_at(__isl_keep isl_set *set1,
150 __isl_keep isl_set *set2, int pos);
152 int isl_basic_set_dims_get_sign(__isl_keep isl_basic_set *bset,
153 enum isl_dim_type type, unsigned pos, unsigned n, int *signs);
155 int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset);
156 int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set *bset);
157 int isl_basic_set_is_empty(__isl_keep isl_basic_set *bset);
158 int isl_basic_set_is_bounded(__isl_keep isl_basic_set *bset);
160 struct isl_set *isl_set_alloc(struct isl_ctx *ctx,
161 unsigned nparam, unsigned dim, int n, unsigned flags);
162 struct isl_set *isl_set_extend(struct isl_set *base,
163 unsigned nparam, unsigned dim);
164 __isl_give isl_set *isl_set_empty(__isl_take isl_dim *dim);
165 struct isl_set *isl_set_empty_like(struct isl_set *set);
166 __isl_give isl_set *isl_set_universe(__isl_take isl_dim *dim);
167 __isl_give isl_set *isl_set_universe_like(__isl_keep isl_set *model);
168 __isl_give isl_set *isl_set_add_basic_set(__isl_take isl_set *set,
169 __isl_take isl_basic_set *bset);
170 struct isl_set *isl_set_finalize(struct isl_set *set);
171 __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
172 void isl_set_free(__isl_take isl_set *set);
173 struct isl_set *isl_set_dup(struct isl_set *set);
174 __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset);
175 __isl_give isl_basic_set *isl_set_sample(__isl_take isl_set *set);
176 __isl_give isl_point *isl_basic_set_sample_point(__isl_take isl_basic_set *bset);
177 __isl_give isl_point *isl_set_sample_point(__isl_take isl_set *set);
178 __isl_give isl_set *isl_set_detect_equalities(__isl_take isl_set *set);
179 __isl_give isl_basic_set *isl_set_affine_hull(__isl_take isl_set *set);
180 __isl_give isl_basic_set *isl_set_convex_hull(__isl_take isl_set *set);
181 __isl_give isl_basic_set *isl_set_polyhedral_hull(__isl_take isl_set *set);
182 __isl_give isl_basic_set *isl_set_simple_hull(__isl_take isl_set *set);
183 struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set);
184 __isl_give isl_set *isl_set_recession_cone(__isl_take isl_set *set);
186 struct isl_set *isl_set_union_disjoint(
187 struct isl_set *set1, struct isl_set *set2);
188 __isl_give isl_set *isl_set_union(
189 __isl_take isl_set *set1,
190 __isl_take isl_set *set2);
191 __isl_give isl_set *isl_set_product(__isl_take isl_set *set1,
192 __isl_take isl_set *set2);
193 __isl_give isl_set *isl_set_flat_product(__isl_take isl_set *set1,
194 __isl_take isl_set *set2);
195 __isl_give isl_set *isl_set_intersect(
196 __isl_take isl_set *set1,
197 __isl_take isl_set *set2);
198 __isl_give isl_set *isl_set_subtract(
199 __isl_take isl_set *set1,
200 __isl_take isl_set *set2);
201 __isl_give isl_set *isl_set_complement(__isl_take isl_set *set);
202 __isl_give isl_set *isl_set_apply(
203 __isl_take isl_set *set,
204 __isl_take isl_map *map);
205 __isl_give isl_set *isl_set_fix(__isl_take isl_set *set,
206 enum isl_dim_type type, unsigned pos, isl_int value);
207 struct isl_set *isl_set_fix_dim_si(struct isl_set *set,
208 unsigned dim, int value);
209 struct isl_set *isl_set_lower_bound_dim(struct isl_set *set,
210 unsigned dim, isl_int value);
211 __isl_give isl_set *isl_set_insert(__isl_take isl_set *set,
212 enum isl_dim_type type, unsigned pos, unsigned n);
213 __isl_give isl_basic_set *isl_basic_set_add(__isl_take isl_basic_set *bset,
214 enum isl_dim_type type, unsigned n);
215 __isl_give isl_set *isl_set_add_dims(__isl_take isl_set *set,
216 enum isl_dim_type type, unsigned n);
217 __isl_give isl_basic_set *isl_basic_set_move_dims(__isl_take isl_basic_set *bset,
218 enum isl_dim_type dst_type, unsigned dst_pos,
219 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
220 __isl_give isl_set *isl_set_move_dims(__isl_take isl_set *set,
221 enum isl_dim_type dst_type, unsigned dst_pos,
222 enum isl_dim_type src_type, unsigned src_pos, unsigned n);
223 __isl_give isl_basic_set *isl_basic_set_project_out(
224 __isl_take isl_basic_set *bset,
225 enum isl_dim_type type, unsigned first, unsigned n);
226 __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
227 enum isl_dim_type type, unsigned first, unsigned n);
228 __isl_give isl_basic_set *isl_basic_set_remove_divs(
229 __isl_take isl_basic_set *bset);
230 struct isl_set *isl_set_eliminate_dims(struct isl_set *set,
231 unsigned first, unsigned n);
232 __isl_give isl_set *isl_set_remove_dims(__isl_take isl_set *bset,
233 enum isl_dim_type type, unsigned first, unsigned n);
234 __isl_give isl_set *isl_set_remove_divs_involving_dims(__isl_take isl_set *set,
235 enum isl_dim_type type, unsigned first, unsigned n);
236 __isl_give isl_set *isl_set_remove_unknown_divs(__isl_take isl_set *set);
237 __isl_give isl_set *isl_set_remove_divs(__isl_take isl_set *set);
238 __isl_give isl_set *isl_set_split_dims(__isl_take isl_set *set,
239 enum isl_dim_type type, unsigned first, unsigned n);
241 void isl_set_print_internal(__isl_keep isl_set *set, FILE *out, int indent);
242 struct isl_set *isl_set_swap_vars(struct isl_set *set, unsigned n);
243 int isl_set_fast_is_empty(__isl_keep isl_set *set);
244 int isl_set_fast_is_universe(__isl_keep isl_set *set);
245 int isl_set_is_empty(__isl_keep isl_set *set);
246 int isl_set_is_bounded(__isl_keep isl_set *set);
247 int isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
248 int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
249 int isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
250 int isl_set_is_singleton(__isl_keep isl_set *set);
251 int isl_set_is_box(__isl_keep isl_set *set);
252 int isl_set_has_equal_dim(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
254 __isl_give isl_set *isl_set_sum(__isl_take isl_set *set1,
255 __isl_take isl_set *set2);
256 __isl_give isl_set *isl_set_neg(__isl_take isl_set *set);
258 __isl_give isl_set *isl_set_make_disjoint(__isl_take isl_set *set);
259 struct isl_set *isl_basic_set_compute_divs(struct isl_basic_set *bset);
260 __isl_give isl_set *isl_set_compute_divs(__isl_take isl_set *set);
261 __isl_give isl_set *isl_set_align_divs(__isl_take isl_set *set);
263 struct isl_basic_set *isl_set_copy_basic_set(struct isl_set *set);
264 struct isl_set *isl_set_drop_basic_set(struct isl_set *set,
265 struct isl_basic_set *bset);
267 int isl_basic_set_fast_dim_is_fixed(struct isl_basic_set *bset, unsigned dim,
270 int isl_set_fast_dim_is_fixed(struct isl_set *set, unsigned dim, isl_int *val);
271 int isl_set_fast_dim_has_fixed_lower_bound(struct isl_set *set,
272 unsigned dim, isl_int *val);
273 int isl_set_dim_is_bounded(__isl_keep isl_set *set,
274 enum isl_dim_type type, unsigned pos);
276 __isl_give isl_basic_set *isl_basic_set_gist(__isl_take isl_basic_set *bset,
277 __isl_take isl_basic_set *context);
278 __isl_give isl_set *isl_set_gist_basic_set(__isl_take isl_set *set,
279 __isl_take isl_basic_set *context);
280 __isl_give isl_set *isl_set_gist(__isl_take isl_set *set,
281 __isl_take isl_set *context);
282 int isl_basic_set_dim_residue_class(struct isl_basic_set *bset,
283 int pos, isl_int *modulo, isl_int *residue);
284 int isl_set_dim_residue_class(struct isl_set *set,
285 int pos, isl_int *modulo, isl_int *residue);
287 __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
289 int isl_set_fast_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
290 int isl_set_fast_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
292 uint32_t isl_set_get_hash(struct isl_set *set);
294 int isl_set_dim_is_unique(struct isl_set *set, unsigned dim);
296 int isl_set_n_basic_set(__isl_keep isl_set *set);
297 int isl_set_foreach_basic_set(__isl_keep isl_set *set,
298 int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user);
300 int isl_set_foreach_point(__isl_keep isl_set *set,
301 int (*fn)(__isl_take isl_point *pnt, void *user), void *user);
302 int isl_set_count(__isl_keep isl_set *set, isl_int *count);
303 int isl_basic_set_count_upto(__isl_keep isl_basic_set *bset,
304 isl_int max, isl_int *count);
305 int isl_set_count_upto(__isl_keep isl_set *set, isl_int max, isl_int *count);
307 __isl_give isl_basic_set *isl_basic_set_from_point(__isl_take isl_point *pnt);
308 __isl_give isl_set *isl_set_from_point(__isl_take isl_point *pnt);
309 __isl_give isl_basic_set *isl_basic_set_box_from_points(
310 __isl_take isl_point *pnt1, __isl_take isl_point *pnt2);
311 __isl_give isl_set *isl_set_box_from_points(__isl_take isl_point *pnt1,
312 __isl_take isl_point *pnt2);
314 __isl_give isl_basic_set *isl_basic_set_lift(__isl_take isl_basic_set *bset);
315 __isl_give isl_set *isl_set_lift(__isl_take isl_set *set);
317 __isl_give isl_map *isl_set_lex_le_set(__isl_take isl_set *set1,
318 __isl_take isl_set *set2);
319 __isl_give isl_map *isl_set_lex_lt_set(__isl_take isl_set *set1,
320 __isl_take isl_set *set2);
321 __isl_give isl_map *isl_set_lex_ge_set(__isl_take isl_set *set1,
322 __isl_take isl_set *set2);
323 __isl_give isl_map *isl_set_lex_gt_set(__isl_take isl_set *set1,
324 __isl_take isl_set *set2);
326 int isl_set_size(__isl_keep isl_set *set);
328 __isl_give isl_mat *isl_basic_set_equalities_matrix(
329 __isl_keep isl_basic_set *bset, enum isl_dim_type c1,
330 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
331 __isl_give isl_mat *isl_basic_set_inequalities_matrix(
332 __isl_keep isl_basic_set *bset, enum isl_dim_type c1,
333 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
334 __isl_give isl_basic_set *isl_basic_set_from_constraint_matrices(
335 __isl_take isl_dim *dim,
336 __isl_take isl_mat *eq, __isl_take isl_mat *ineq, enum isl_dim_type c1,
337 enum isl_dim_type c2, enum isl_dim_type c3, enum isl_dim_type c4);
339 __isl_give isl_mat *isl_basic_set_reduced_basis(__isl_keep isl_basic_set *bset);
341 #if defined(__cplusplus)