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 struct isl_basic_set
*isl_basic_set_swap_vars(
79 struct isl_basic_set
*bset
, unsigned n
);
80 __isl_give isl_basic_set
*isl_basic_set_intersect(
81 __isl_take isl_basic_set
*bset1
,
82 __isl_take isl_basic_set
*bset2
);
83 __isl_give isl_basic_set
*isl_basic_set_apply(
84 __isl_take isl_basic_set
*bset
,
85 __isl_take isl_basic_map
*bmap
);
86 __isl_give isl_basic_set
*isl_basic_set_affine_hull(
87 __isl_take isl_basic_set
*bset
);
88 __isl_give isl_basic_set
*isl_basic_set_remove_dims(
89 __isl_take isl_basic_set
*bset
,
90 enum isl_dim_type type
, unsigned first
, unsigned n
);
91 struct isl_basic_set
*isl_basic_set_simplify(struct isl_basic_set
*bset
);
92 __isl_give isl_basic_set
*isl_basic_set_detect_equalities(
93 __isl_take isl_basic_set
*bset
);
94 __isl_give isl_basic_set
*isl_basic_set_list_product(
95 __isl_take
struct isl_basic_set_list
*list
);
97 __isl_give isl_basic_set
*isl_basic_set_read_from_file(isl_ctx
*ctx
,
98 FILE *input
, int nparam
);
99 __isl_give isl_basic_set
*isl_basic_set_read_from_str(isl_ctx
*ctx
,
100 const char *str
, int nparam
);
101 __isl_give isl_set
*isl_set_read_from_file(isl_ctx
*ctx
,
102 FILE *input
, int nparam
);
103 __isl_give isl_set
*isl_set_read_from_str(isl_ctx
*ctx
,
104 const char *str
, int nparam
);
105 void isl_basic_set_dump(__isl_keep isl_basic_set
*bset
);
106 void isl_set_dump(__isl_keep isl_set
*set
);
107 __isl_give isl_printer
*isl_printer_print_basic_set(
108 __isl_take isl_printer
*printer
, __isl_keep isl_basic_set
*bset
);
109 __isl_give isl_printer
*isl_printer_print_set(__isl_take isl_printer
*printer
,
110 __isl_keep isl_set
*map
);
111 void isl_basic_set_print(__isl_keep isl_basic_set
*bset
, FILE *out
, int indent
,
112 const char *prefix
, const char *suffix
, unsigned output_format
);
113 void isl_set_print(__isl_keep
struct isl_set
*set
, FILE *out
, int indent
,
114 unsigned output_format
);
115 __isl_give isl_basic_set
*isl_basic_set_fix(__isl_take isl_basic_set
*bset
,
116 enum isl_dim_type type
, unsigned pos
, isl_int value
);
117 struct isl_basic_set
*isl_basic_set_fix_si(struct isl_basic_set
*bset
,
118 enum isl_dim_type type
, unsigned pos
, int value
);
119 __isl_give isl_set
*isl_set_fix_si(__isl_take isl_set
*set
,
120 enum isl_dim_type type
, unsigned pos
, int value
);
121 __isl_give isl_set
*isl_set_lower_bound_si(__isl_take isl_set
*set
,
122 enum isl_dim_type type
, unsigned pos
, int value
);
124 struct isl_basic_set
*isl_basic_set_from_underlying_set(
125 struct isl_basic_set
*bset
, struct isl_basic_set
*like
);
126 struct isl_set
*isl_set_from_underlying_set(
127 struct isl_set
*set
, struct isl_basic_set
*like
);
128 struct isl_set
*isl_set_to_underlying_set(struct isl_set
*set
);
130 int isl_basic_set_is_equal(
131 struct isl_basic_set
*bset1
, struct isl_basic_set
*bset2
);
133 __isl_give isl_set
*isl_basic_set_partial_lexmin(
134 __isl_take isl_basic_set
*bset
, __isl_take isl_basic_set
*dom
,
135 __isl_give isl_set
**empty
);
136 __isl_give isl_set
*isl_basic_set_partial_lexmax(
137 __isl_take isl_basic_set
*bset
, __isl_take isl_basic_set
*dom
,
138 __isl_give isl_set
**empty
);
139 __isl_give isl_set
*isl_set_partial_lexmin(
140 __isl_take isl_set
*set
, __isl_take isl_set
*dom
,
141 __isl_give isl_set
**empty
);
142 __isl_give isl_set
*isl_set_partial_lexmax(
143 __isl_take isl_set
*set
, __isl_take isl_set
*dom
,
144 __isl_give isl_set
**empty
);
145 __isl_give isl_set
*isl_basic_set_lexmin(__isl_take isl_basic_set
*bset
);
146 __isl_give isl_set
*isl_basic_set_lexmax(__isl_take isl_basic_set
*bset
);
147 __isl_give isl_set
*isl_set_lexmin(__isl_take isl_set
*set
);
148 __isl_give isl_set
*isl_set_lexmax(__isl_take isl_set
*set
);
149 __isl_give isl_set
*isl_basic_set_union(
150 __isl_take isl_basic_set
*bset1
,
151 __isl_take isl_basic_set
*bset2
);
153 int isl_basic_set_compare_at(struct isl_basic_set
*bset1
,
154 struct isl_basic_set
*bset2
, int pos
);
155 int isl_set_follows_at(__isl_keep isl_set
*set1
,
156 __isl_keep isl_set
*set2
, int pos
);
158 int isl_basic_set_dims_get_sign(__isl_keep isl_basic_set
*bset
,
159 enum isl_dim_type type
, unsigned pos
, unsigned n
, int *signs
);
161 int isl_basic_set_is_universe(__isl_keep isl_basic_set
*bset
);
162 int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set
*bset
);
163 int isl_basic_set_is_empty(__isl_keep isl_basic_set
*bset
);
164 int isl_basic_set_is_bounded(__isl_keep isl_basic_set
*bset
);
166 struct isl_set
*isl_set_alloc(struct isl_ctx
*ctx
,
167 unsigned nparam
, unsigned dim
, int n
, unsigned flags
);
168 struct isl_set
*isl_set_extend(struct isl_set
*base
,
169 unsigned nparam
, unsigned dim
);
170 __isl_give isl_set
*isl_set_empty(__isl_take isl_dim
*dim
);
171 struct isl_set
*isl_set_empty_like(struct isl_set
*set
);
172 __isl_give isl_set
*isl_set_universe(__isl_take isl_dim
*dim
);
173 __isl_give isl_set
*isl_set_nat_universe(__isl_take isl_dim
*dim
);
174 __isl_give isl_set
*isl_set_universe_like(__isl_keep isl_set
*model
);
175 __isl_give isl_set
*isl_set_add_basic_set(__isl_take isl_set
*set
,
176 __isl_take isl_basic_set
*bset
);
177 struct isl_set
*isl_set_finalize(struct isl_set
*set
);
178 __isl_give isl_set
*isl_set_copy(__isl_keep isl_set
*set
);
179 void isl_set_free(__isl_take isl_set
*set
);
180 struct isl_set
*isl_set_dup(struct isl_set
*set
);
181 __isl_give isl_set
*isl_set_from_basic_set(__isl_take isl_basic_set
*bset
);
182 __isl_give isl_basic_set
*isl_set_sample(__isl_take isl_set
*set
);
183 __isl_give isl_point
*isl_basic_set_sample_point(__isl_take isl_basic_set
*bset
);
184 __isl_give isl_point
*isl_set_sample_point(__isl_take isl_set
*set
);
185 __isl_give isl_set
*isl_set_detect_equalities(__isl_take isl_set
*set
);
186 __isl_give isl_basic_set
*isl_set_affine_hull(__isl_take isl_set
*set
);
187 __isl_give isl_basic_set
*isl_set_convex_hull(__isl_take isl_set
*set
);
188 __isl_give isl_basic_set
*isl_set_polyhedral_hull(__isl_take isl_set
*set
);
189 __isl_give isl_basic_set
*isl_set_simple_hull(__isl_take isl_set
*set
);
190 struct isl_basic_set
*isl_set_bounded_simple_hull(struct isl_set
*set
);
191 __isl_give isl_set
*isl_set_recession_cone(__isl_take isl_set
*set
);
193 struct isl_set
*isl_set_union_disjoint(
194 struct isl_set
*set1
, struct isl_set
*set2
);
195 __isl_give isl_set
*isl_set_union(
196 __isl_take isl_set
*set1
,
197 __isl_take isl_set
*set2
);
198 __isl_give isl_set
*isl_set_product(__isl_take isl_set
*set1
,
199 __isl_take isl_set
*set2
);
200 __isl_give isl_basic_set
*isl_basic_set_flat_product(
201 __isl_take isl_basic_set
*bset1
, __isl_take isl_basic_set
*bset2
);
202 __isl_give isl_set
*isl_set_flat_product(__isl_take isl_set
*set1
,
203 __isl_take isl_set
*set2
);
204 __isl_give isl_set
*isl_set_intersect(
205 __isl_take isl_set
*set1
,
206 __isl_take isl_set
*set2
);
207 __isl_give isl_set
*isl_set_subtract(
208 __isl_take isl_set
*set1
,
209 __isl_take isl_set
*set2
);
210 __isl_give isl_set
*isl_set_complement(__isl_take isl_set
*set
);
211 __isl_give isl_set
*isl_set_apply(
212 __isl_take isl_set
*set
,
213 __isl_take isl_map
*map
);
214 __isl_give isl_set
*isl_set_fix(__isl_take isl_set
*set
,
215 enum isl_dim_type type
, unsigned pos
, isl_int value
);
216 struct isl_set
*isl_set_fix_dim_si(struct isl_set
*set
,
217 unsigned dim
, int value
);
218 struct isl_set
*isl_set_lower_bound_dim(struct isl_set
*set
,
219 unsigned dim
, isl_int value
);
220 __isl_give isl_set
*isl_set_insert(__isl_take isl_set
*set
,
221 enum isl_dim_type type
, unsigned pos
, unsigned n
);
222 __isl_give isl_basic_set
*isl_basic_set_add(__isl_take isl_basic_set
*bset
,
223 enum isl_dim_type type
, unsigned n
);
224 __isl_give isl_set
*isl_set_add_dims(__isl_take isl_set
*set
,
225 enum isl_dim_type type
, unsigned n
);
226 __isl_give isl_basic_set
*isl_basic_set_move_dims(__isl_take isl_basic_set
*bset
,
227 enum isl_dim_type dst_type
, unsigned dst_pos
,
228 enum isl_dim_type src_type
, unsigned src_pos
, unsigned n
);
229 __isl_give isl_set
*isl_set_move_dims(__isl_take isl_set
*set
,
230 enum isl_dim_type dst_type
, unsigned dst_pos
,
231 enum isl_dim_type src_type
, unsigned src_pos
, unsigned n
);
232 __isl_give isl_basic_set
*isl_basic_set_project_out(
233 __isl_take isl_basic_set
*bset
,
234 enum isl_dim_type type
, unsigned first
, unsigned n
);
235 __isl_give isl_set
*isl_set_project_out(__isl_take isl_set
*set
,
236 enum isl_dim_type type
, unsigned first
, unsigned n
);
237 __isl_give isl_basic_set
*isl_basic_set_remove_divs(
238 __isl_take isl_basic_set
*bset
);
239 struct isl_set
*isl_set_eliminate_dims(struct isl_set
*set
,
240 unsigned first
, unsigned n
);
241 __isl_give isl_set
*isl_set_remove_dims(__isl_take isl_set
*bset
,
242 enum isl_dim_type type
, unsigned first
, unsigned n
);
243 __isl_give isl_set
*isl_set_remove_divs_involving_dims(__isl_take isl_set
*set
,
244 enum isl_dim_type type
, unsigned first
, unsigned n
);
245 __isl_give isl_set
*isl_set_remove_unknown_divs(__isl_take isl_set
*set
);
246 __isl_give isl_set
*isl_set_remove_divs(__isl_take isl_set
*set
);
247 __isl_give isl_set
*isl_set_split_dims(__isl_take isl_set
*set
,
248 enum isl_dim_type type
, unsigned first
, unsigned n
);
250 void isl_set_print_internal(__isl_keep isl_set
*set
, FILE *out
, int indent
);
251 struct isl_set
*isl_set_swap_vars(struct isl_set
*set
, unsigned n
);
252 int isl_set_fast_is_empty(__isl_keep isl_set
*set
);
253 int isl_set_fast_is_universe(__isl_keep isl_set
*set
);
254 int isl_set_is_empty(__isl_keep isl_set
*set
);
255 int isl_set_is_bounded(__isl_keep isl_set
*set
);
256 int isl_set_is_subset(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
);
257 int isl_set_is_strict_subset(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
);
258 int isl_set_is_equal(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
);
259 int isl_set_is_singleton(__isl_keep isl_set
*set
);
260 int isl_set_is_box(__isl_keep isl_set
*set
);
261 int isl_set_has_equal_dim(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
);
263 __isl_give isl_set
*isl_set_sum(__isl_take isl_set
*set1
,
264 __isl_take isl_set
*set2
);
265 __isl_give isl_basic_set
*isl_basic_set_neg(__isl_take isl_basic_set
*bset
);
266 __isl_give isl_set
*isl_set_neg(__isl_take isl_set
*set
);
268 __isl_give isl_set
*isl_set_make_disjoint(__isl_take isl_set
*set
);
269 struct isl_set
*isl_basic_set_compute_divs(struct isl_basic_set
*bset
);
270 __isl_give isl_set
*isl_set_compute_divs(__isl_take isl_set
*set
);
271 __isl_give isl_set
*isl_set_align_divs(__isl_take isl_set
*set
);
273 struct isl_basic_set
*isl_set_copy_basic_set(struct isl_set
*set
);
274 struct isl_set
*isl_set_drop_basic_set(struct isl_set
*set
,
275 struct isl_basic_set
*bset
);
277 int isl_basic_set_fast_dim_is_fixed(struct isl_basic_set
*bset
, unsigned dim
,
280 int isl_set_fast_dim_is_fixed(struct isl_set
*set
, unsigned dim
, isl_int
*val
);
281 int isl_set_fast_dim_has_fixed_lower_bound(struct isl_set
*set
,
282 unsigned dim
, isl_int
*val
);
283 int isl_set_dim_is_bounded(__isl_keep isl_set
*set
,
284 enum isl_dim_type type
, unsigned pos
);
286 __isl_give isl_basic_set
*isl_basic_set_gist(__isl_take isl_basic_set
*bset
,
287 __isl_take isl_basic_set
*context
);
288 __isl_give isl_set
*isl_set_gist_basic_set(__isl_take isl_set
*set
,
289 __isl_take isl_basic_set
*context
);
290 __isl_give isl_set
*isl_set_gist(__isl_take isl_set
*set
,
291 __isl_take isl_set
*context
);
292 int isl_basic_set_dim_residue_class(struct isl_basic_set
*bset
,
293 int pos
, isl_int
*modulo
, isl_int
*residue
);
294 int isl_set_dim_residue_class(struct isl_set
*set
,
295 int pos
, isl_int
*modulo
, isl_int
*residue
);
297 __isl_give isl_set
*isl_set_coalesce(__isl_take isl_set
*set
);
299 int isl_set_fast_is_equal(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
);
300 int isl_set_fast_is_disjoint(__isl_keep isl_set
*set1
, __isl_keep isl_set
*set2
);
302 uint32_t isl_set_get_hash(struct isl_set
*set
);
304 int isl_set_dim_is_unique(struct isl_set
*set
, unsigned dim
);
306 int isl_set_n_basic_set(__isl_keep isl_set
*set
);
307 int isl_set_foreach_basic_set(__isl_keep isl_set
*set
,
308 int (*fn
)(__isl_take isl_basic_set
*bset
, void *user
), void *user
);
310 int isl_set_foreach_point(__isl_keep isl_set
*set
,
311 int (*fn
)(__isl_take isl_point
*pnt
, void *user
), void *user
);
312 int isl_set_count(__isl_keep isl_set
*set
, isl_int
*count
);
313 int isl_basic_set_count_upto(__isl_keep isl_basic_set
*bset
,
314 isl_int max
, isl_int
*count
);
315 int isl_set_count_upto(__isl_keep isl_set
*set
, isl_int max
, isl_int
*count
);
317 __isl_give isl_basic_set
*isl_basic_set_from_point(__isl_take isl_point
*pnt
);
318 __isl_give isl_set
*isl_set_from_point(__isl_take isl_point
*pnt
);
319 __isl_give isl_basic_set
*isl_basic_set_box_from_points(
320 __isl_take isl_point
*pnt1
, __isl_take isl_point
*pnt2
);
321 __isl_give isl_set
*isl_set_box_from_points(__isl_take isl_point
*pnt1
,
322 __isl_take isl_point
*pnt2
);
324 __isl_give isl_basic_set
*isl_basic_set_lift(__isl_take isl_basic_set
*bset
);
325 __isl_give isl_set
*isl_set_lift(__isl_take isl_set
*set
);
327 __isl_give isl_map
*isl_set_lex_le_set(__isl_take isl_set
*set1
,
328 __isl_take isl_set
*set2
);
329 __isl_give isl_map
*isl_set_lex_lt_set(__isl_take isl_set
*set1
,
330 __isl_take isl_set
*set2
);
331 __isl_give isl_map
*isl_set_lex_ge_set(__isl_take isl_set
*set1
,
332 __isl_take isl_set
*set2
);
333 __isl_give isl_map
*isl_set_lex_gt_set(__isl_take isl_set
*set1
,
334 __isl_take isl_set
*set2
);
336 int isl_set_size(__isl_keep isl_set
*set
);
338 __isl_give isl_mat
*isl_basic_set_equalities_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_mat
*isl_basic_set_inequalities_matrix(
342 __isl_keep isl_basic_set
*bset
, enum isl_dim_type c1
,
343 enum isl_dim_type c2
, enum isl_dim_type c3
, enum isl_dim_type c4
);
344 __isl_give isl_basic_set
*isl_basic_set_from_constraint_matrices(
345 __isl_take isl_dim
*dim
,
346 __isl_take isl_mat
*eq
, __isl_take isl_mat
*ineq
, enum isl_dim_type c1
,
347 enum isl_dim_type c2
, enum isl_dim_type c3
, enum isl_dim_type c4
);
349 __isl_give isl_mat
*isl_basic_set_reduced_basis(__isl_keep isl_basic_set
*bset
);
351 #if defined(__cplusplus)