7 #if defined(__cplusplus)
11 /* A "basic set" is a basic map with a zero-dimensional
14 struct isl_basic_set {
16 #define ISL_BASIC_SET_FINAL (1 << 0)
17 #define ISL_BASIC_SET_EMPTY (1 << 1)
18 #define ISL_BASIC_SET_NO_IMPLICIT (1 << 2)
19 #define ISL_BASIC_SET_NO_REDUNDANT (1 << 3)
20 #define ISL_BASIC_SET_RATIONAL (1 << 4)
21 #define ISL_BASIC_SET_NORMALIZED (1 << 5)
22 #define ISL_BASIC_SET_NORMALIZED_DIVS (1 << 6)
23 #define ISL_BASIC_SET_ALL_EQUALITIES (1 << 7)
42 struct isl_vec *sample;
45 struct isl_blk block2;
48 /* A "set" is a (possibly disjoint) union of basic sets.
50 * See the documentation of isl_map.
54 #define ISL_SET_DISJOINT (1 << 0)
55 #define ISL_SET_NORMALIZED (1 << 1)
65 struct isl_basic_set *p[1];
68 unsigned isl_basic_set_n_dim(const struct isl_basic_set *bset);
69 unsigned isl_basic_set_n_param(const struct isl_basic_set *bset);
70 unsigned isl_basic_set_total_dim(const struct isl_basic_set *bset);
71 unsigned isl_basic_set_dim(const struct isl_basic_set *bset,
72 enum isl_dim_type type);
74 unsigned isl_set_n_dim(const struct isl_set *set);
75 unsigned isl_set_n_param(const struct isl_set *set);
76 unsigned isl_set_dim(const struct isl_set *set, enum isl_dim_type type);
78 struct isl_dim *isl_basic_set_get_dim(struct isl_basic_set *bset);
79 struct isl_dim *isl_set_get_dim(struct isl_set *set);
81 struct isl_basic_set *isl_basic_set_alloc(struct isl_ctx *ctx,
82 unsigned nparam, unsigned dim, unsigned extra,
83 unsigned n_eq, unsigned n_ineq);
84 struct isl_basic_set *isl_basic_set_extend(struct isl_basic_set *base,
85 unsigned nparam, unsigned dim, unsigned extra,
86 unsigned n_eq, unsigned n_ineq);
87 struct isl_basic_set *isl_basic_set_extend_constraints(
88 struct isl_basic_set *base, unsigned n_eq, unsigned n_ineq);
89 struct isl_basic_set *isl_basic_set_finalize(struct isl_basic_set *bset);
90 void isl_basic_set_free(__isl_take isl_basic_set *bset);
91 __isl_give isl_basic_set *isl_basic_set_copy(__isl_keep isl_basic_set *bset);
92 struct isl_basic_set *isl_basic_set_dup(struct isl_basic_set *bset);
93 __isl_give isl_basic_set *isl_basic_set_empty(__isl_take isl_dim *dim);
94 struct isl_basic_set *isl_basic_set_empty_like(struct isl_basic_set *bset);
95 __isl_give isl_basic_set *isl_basic_set_universe(__isl_take isl_dim *dim);
96 struct isl_basic_set *isl_basic_set_universe_like(struct isl_basic_set *bset);
97 __isl_give isl_basic_set *isl_basic_set_universe_like_set(
98 __isl_keep isl_set *model);
99 struct isl_basic_set *isl_basic_set_interval(struct isl_ctx *ctx,
100 isl_int min, isl_int max);
101 struct isl_basic_set *isl_basic_set_positive_orthant(struct isl_dim *dims);
102 void isl_basic_set_dump(__isl_keep isl_basic_set *bset,
103 FILE *out, int indent);
104 struct isl_basic_set *isl_basic_set_swap_vars(
105 struct isl_basic_set *bset, unsigned n);
106 __isl_give isl_basic_set *isl_basic_set_intersect(
107 __isl_take isl_basic_set *bset1,
108 __isl_take isl_basic_set *bset2);
109 __isl_give isl_basic_set *isl_basic_set_apply(
110 __isl_take isl_basic_set *bset,
111 __isl_take isl_basic_map *bmap);
112 __isl_give isl_basic_set *isl_basic_set_affine_hull(
113 __isl_take isl_basic_set *bset);
114 __isl_give isl_basic_set *isl_basic_set_remove(__isl_take isl_basic_set *bset,
115 enum isl_dim_type type, unsigned first, unsigned n);
116 struct isl_basic_set *isl_basic_set_simplify(struct isl_basic_set *bset);
117 __isl_give isl_basic_set *isl_basic_set_detect_equalities(
118 __isl_take isl_basic_set *bset);
119 struct isl_basic_set *isl_basic_set_product(struct isl_basic_set_list *list);
121 #define ISL_FORMAT_POLYLIB 1
122 #define ISL_FORMAT_OMEGA 2
123 __isl_give isl_basic_set *isl_basic_set_read_from_file(isl_ctx *ctx,
124 FILE *input, unsigned nparam, unsigned input_format);
125 __isl_give isl_basic_set *isl_basic_set_read_from_str(isl_ctx *ctx,
126 const char *str, unsigned nparam, unsigned input_format);
127 __isl_give isl_set *isl_set_read_from_file(isl_ctx *ctx,
128 FILE *input, unsigned nparam, unsigned input_format);
129 #define ISL_FORMAT_POLYLIB_CONSTRAINTS 3
130 void isl_basic_set_print(__isl_keep isl_basic_set *bset, FILE *out, int indent,
131 const char *prefix, const char *suffix, unsigned output_format);
132 void isl_set_print(__isl_keep struct isl_set *set, FILE *out, int indent,
133 unsigned output_format);
134 struct isl_basic_set *isl_basic_set_fix_si(struct isl_basic_set *bset,
135 enum isl_dim_type type, unsigned pos, int value);
137 struct isl_basic_set *isl_basic_set_from_underlying_set(
138 struct isl_basic_set *bset, struct isl_basic_set *like);
139 struct isl_set *isl_set_from_underlying_set(
140 struct isl_set *set, struct isl_basic_set *like);
141 struct isl_set *isl_set_to_underlying_set(struct isl_set *set);
143 int isl_basic_set_is_equal(
144 struct isl_basic_set *bset1, struct isl_basic_set *bset2);
146 __isl_give isl_set *isl_basic_set_partial_lexmin(
147 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
148 __isl_give isl_set **empty);
149 __isl_give isl_set *isl_basic_set_partial_lexmax(
150 __isl_take isl_basic_set *bset, __isl_take isl_basic_set *dom,
151 __isl_give isl_set **empty);
152 __isl_give isl_set *isl_basic_set_lexmin(__isl_take isl_basic_set *bset);
153 __isl_give isl_set *isl_basic_set_union(
154 __isl_take isl_basic_set *bset1,
155 __isl_take isl_basic_set *bset2);
157 int isl_basic_set_compare_at(struct isl_basic_set *bset1,
158 struct isl_basic_set *bset2, int pos);
160 int isl_basic_set_is_universe(__isl_keep isl_basic_set *bset);
161 int isl_basic_set_fast_is_empty(__isl_keep isl_basic_set *bset);
162 int isl_basic_set_is_empty(__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_universe_like(__isl_keep isl_set *model);
172 struct isl_set *isl_set_add(struct isl_set *set, struct isl_basic_set *bset);
173 struct isl_set *isl_set_finalize(struct isl_set *set);
174 __isl_give isl_set *isl_set_copy(__isl_keep isl_set *set);
175 void isl_set_free(__isl_take isl_set *set);
176 struct isl_set *isl_set_dup(struct isl_set *set);
177 __isl_give isl_set *isl_set_from_basic_set(__isl_take isl_basic_set *bset);
178 __isl_give isl_basic_set *isl_set_sample(__isl_take isl_set *set);
179 __isl_give isl_set *isl_set_detect_equalities(__isl_take isl_set *set);
180 __isl_give isl_basic_set *isl_set_affine_hull(__isl_take isl_set *set);
181 __isl_give isl_basic_set *isl_set_convex_hull(__isl_take isl_set *set);
182 struct isl_basic_set *isl_set_simple_hull(struct isl_set *set);
183 struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set);
185 struct isl_set *isl_set_union_disjoint(
186 struct isl_set *set1, struct isl_set *set2);
187 __isl_give isl_set *isl_set_union(
188 __isl_take isl_set *set1,
189 __isl_take isl_set *set2);
190 struct isl_set *isl_set_product(struct isl_set *set1, struct isl_set *set2);
191 __isl_give isl_set *isl_set_intersect(
192 __isl_take isl_set *set1,
193 __isl_take isl_set *set2);
194 __isl_give isl_set *isl_set_subtract(
195 __isl_take isl_set *set1,
196 __isl_take isl_set *set2);
197 __isl_give isl_set *isl_set_apply(
198 __isl_take isl_set *set,
199 __isl_take isl_map *map);
200 struct isl_set *isl_set_fix_dim_si(struct isl_set *set,
201 unsigned dim, int value);
202 struct isl_set *isl_set_lower_bound_dim(struct isl_set *set,
203 unsigned dim, isl_int value);
204 __isl_give isl_basic_set *isl_basic_set_project_out(
205 __isl_take isl_basic_set *bset,
206 enum isl_dim_type type, unsigned first, unsigned n);
207 __isl_give isl_set *isl_set_project_out(__isl_take isl_set *set,
208 enum isl_dim_type type, unsigned first, unsigned n);
209 struct isl_basic_set *isl_basic_set_remove_dims(struct isl_basic_set *bset,
210 unsigned first, unsigned n);
211 struct isl_basic_set *isl_basic_set_remove_divs(struct isl_basic_set *bset);
212 struct isl_set *isl_set_eliminate_dims(struct isl_set *set,
213 unsigned first, unsigned n);
214 struct isl_set *isl_set_remove_dims(struct isl_set *set,
215 unsigned first, unsigned n);
216 struct isl_set *isl_set_remove_divs(struct isl_set *set);
218 void isl_set_dump(__isl_keep isl_set *set, FILE *out, int indent);
219 struct isl_set *isl_set_swap_vars(struct isl_set *set, unsigned n);
220 int isl_set_is_empty(__isl_keep isl_set *set);
221 int isl_set_is_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
222 int isl_set_is_strict_subset(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
223 int isl_set_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
225 struct isl_set *isl_basic_set_compute_divs(struct isl_basic_set *bset);
226 struct isl_set *isl_set_compute_divs(struct isl_set *set);
228 struct isl_basic_set *isl_set_copy_basic_set(struct isl_set *set);
229 struct isl_set *isl_set_drop_basic_set(struct isl_set *set,
230 struct isl_basic_set *bset);
232 int isl_basic_set_fast_dim_is_fixed(struct isl_basic_set *bset, unsigned dim,
235 int isl_set_fast_dim_is_fixed(struct isl_set *set, unsigned dim, isl_int *val);
236 int isl_set_fast_dim_has_fixed_lower_bound(struct isl_set *set,
237 unsigned dim, isl_int *val);
239 struct isl_basic_set *isl_basic_set_gist(struct isl_basic_set *bset,
240 struct isl_basic_set *context);
241 struct isl_set *isl_set_gist(struct isl_set *set,
242 struct isl_basic_set *context);
243 int isl_basic_set_dim_residue_class(struct isl_basic_set *bset,
244 int pos, isl_int *modulo, isl_int *residue);
245 int isl_set_dim_residue_class(struct isl_set *set,
246 int pos, isl_int *modulo, isl_int *residue);
248 __isl_give isl_set *isl_set_coalesce(__isl_take isl_set *set);
250 int isl_set_fast_is_equal(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
251 int isl_set_fast_is_disjoint(__isl_keep isl_set *set1, __isl_keep isl_set *set2);
253 uint32_t isl_set_get_hash(struct isl_set *set);
255 int isl_set_dim_is_unique(struct isl_set *set, unsigned dim);
257 int isl_set_foreach_basic_set(__isl_keep isl_set *set,
258 int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user);
260 int isl_set_size(__isl_keep isl_set *set);
262 #if defined(__cplusplus)