11 #if defined(__cplusplus)
17 * All structures are reference counted to allow reuse without duplication.
18 * A *_copy operation will increase the reference count, while a *_free
19 * operation will decrease the reference count and only actually release
20 * the structures when the reference count drops to zero.
22 * Functions that return an isa structure will in general _destroy_
23 * all argument isa structures (the obvious execption begin the _copy
24 * functions). A pointer passed to such a function may therefore
25 * never be used after the function call. If you want to keep a
26 * reference to the old structure(s), use the appropriate _copy function.
29 /* A "basic map" is a relation between two sets of variables,
30 * called the "in" and "out" variables.
32 * It is implemented as a set with two extra fields:
33 * n_in is the number of in variables
34 * n_out is the number of out variables
35 * n_in + n_out should be equal to set.dim
39 struct isl_basic_map {
41 #define ISL_BASIC_MAP_FINAL (1 << 0)
42 #define ISL_BASIC_MAP_EMPTY (1 << 1)
43 #define ISL_BASIC_MAP_NO_IMPLICIT (1 << 2)
44 #define ISL_BASIC_MAP_NO_REDUNDANT (1 << 3)
45 #define ISL_BASIC_MAP_RATIONAL (1 << 4)
46 #define ISL_BASIC_MAP_NORMALIZED (1 << 5)
47 #define ISL_BASIC_MAP_NORMALIZED_DIVS (1 << 6)
66 struct isl_vec *sample;
69 struct isl_blk block2;
73 /* A "map" is a (disjoint) union of basic maps.
75 * Currently, the isl_set structure is identical to the isl_map structure
76 * and the library depends on this correspondence internally.
77 * However, users should not depend on this correspondence.
81 #define ISL_MAP_DISJOINT (1 << 0)
82 #define ISL_MAP_NORMALIZED (1 << 1)
92 struct isl_basic_map *p[0];
96 unsigned isl_basic_map_n_in(const struct isl_basic_map *bmap);
97 unsigned isl_basic_map_n_out(const struct isl_basic_map *bmap);
98 unsigned isl_basic_map_n_param(const struct isl_basic_map *bmap);
99 unsigned isl_basic_map_n_div(const struct isl_basic_map *bmap);
100 unsigned isl_basic_map_total_dim(const struct isl_basic_map *bmap);
101 unsigned isl_basic_map_dim(const struct isl_basic_map *bmap,
102 enum isl_dim_type type);
104 unsigned isl_map_n_in(const struct isl_map *map);
105 unsigned isl_map_n_out(const struct isl_map *map);
106 unsigned isl_map_n_param(const struct isl_map *map);
108 struct isl_basic_map *isl_basic_map_alloc(struct isl_ctx *ctx,
109 unsigned nparam, unsigned in, unsigned out, unsigned extra,
110 unsigned n_eq, unsigned n_ineq);
111 struct isl_basic_map *isl_basic_map_identity(struct isl_dim *set_dim);
112 struct isl_basic_map *isl_basic_map_identity_like(struct isl_basic_map *model);
113 struct isl_basic_map *isl_basic_map_finalize(struct isl_basic_map *bmap);
114 void isl_basic_map_free(struct isl_basic_map *bmap);
115 struct isl_basic_map *isl_basic_map_copy(struct isl_basic_map *bmap);
116 struct isl_basic_map *isl_basic_map_extend(struct isl_basic_map *base,
117 unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra,
118 unsigned n_eq, unsigned n_ineq);
119 struct isl_basic_map *isl_basic_map_extend_constraints(
120 struct isl_basic_map *base, unsigned n_eq, unsigned n_ineq);
121 struct isl_basic_map *isl_basic_map_equal(struct isl_ctx *ctx,
122 unsigned nparam, unsigned in, unsigned out, unsigned n_equal);
123 struct isl_basic_map *isl_basic_map_less_at(struct isl_ctx *ctx,
124 unsigned nparam, unsigned in, unsigned out, unsigned pos);
125 struct isl_basic_map *isl_basic_map_more_at(struct isl_ctx *ctx,
126 unsigned nparam, unsigned in, unsigned out, unsigned pos);
127 struct isl_basic_map *isl_basic_map_empty(struct isl_ctx *ctx,
128 unsigned nparam, unsigned in, unsigned out);
129 struct isl_basic_map *isl_basic_map_empty_like(struct isl_basic_map *model);
130 struct isl_basic_map *isl_basic_map_empty_like_map(struct isl_map *model);
131 struct isl_basic_map *isl_basic_map_universe(struct isl_dim *dim);
132 struct isl_basic_map *isl_basic_map_convex_hull(struct isl_basic_map *bmap);
134 struct isl_basic_map *isl_basic_map_intersect_domain(
135 struct isl_basic_map *bmap,
136 struct isl_basic_set *bset);
137 struct isl_basic_map *isl_basic_map_intersect(
138 struct isl_basic_map *bmap1,
139 struct isl_basic_map *bmap2);
140 struct isl_map *isl_basic_map_union(
141 struct isl_basic_map *bmap1,
142 struct isl_basic_map *bmap2);
143 struct isl_basic_map *isl_basic_map_apply_domain(
144 struct isl_basic_map *bmap1,
145 struct isl_basic_map *bmap2);
146 struct isl_basic_map *isl_basic_map_apply_range(
147 struct isl_basic_map *bmap1,
148 struct isl_basic_map *bmap2);
149 struct isl_basic_map *isl_basic_map_reverse(struct isl_basic_map *bmap);
150 struct isl_basic_set *isl_basic_map_domain(struct isl_basic_map *bmap);
151 struct isl_basic_set *isl_basic_map_range(struct isl_basic_map *bmap);
152 struct isl_basic_map *isl_basic_map_from_basic_set(struct isl_basic_set *bset,
153 struct isl_dim *dim);
154 struct isl_basic_set *isl_basic_set_from_basic_map(struct isl_basic_map *bmap);
155 struct isl_basic_map *isl_basic_map_simplify(struct isl_basic_map *bmap);
156 #define ISL_FORMAT_POLYLIB 1
157 #define ISL_FORMAT_OMEGA 2
158 struct isl_basic_map *isl_basic_map_read_from_file(struct isl_ctx *ctx,
159 FILE *input, unsigned nparam, unsigned input_format);
161 struct isl_map *isl_basic_map_lexmax(
162 struct isl_basic_map *bmap, struct isl_basic_set *dom,
163 struct isl_set **empty);
164 struct isl_map *isl_basic_map_lexmin(
165 struct isl_basic_map *bmap, struct isl_basic_set *dom,
166 struct isl_set **empty);
168 void isl_basic_map_dump(struct isl_basic_map *bmap, FILE *out, int indent);
170 int isl_basic_map_is_universe(struct isl_basic_map *bmap);
171 int isl_basic_map_is_empty(struct isl_basic_map *bmap);
172 int isl_basic_map_is_subset(struct isl_basic_map *bmap1,
173 struct isl_basic_map *bmap2);
174 int isl_basic_map_is_strict_subset(struct isl_basic_map *bmap1,
175 struct isl_basic_map *bmap2);
177 struct isl_map *isl_map_alloc(struct isl_ctx *ctx,
178 unsigned nparam, unsigned in, unsigned out, int n,
180 struct isl_map *isl_map_empty(struct isl_ctx *ctx,
181 unsigned nparam, unsigned in, unsigned out);
182 struct isl_map *isl_map_empty_like(struct isl_map *model);
183 struct isl_map *isl_map_empty_like_basic_map(struct isl_basic_map *model);
184 struct isl_map *isl_map_dup(struct isl_map *map);
185 struct isl_map *isl_map_add(struct isl_map *map, struct isl_basic_map *bmap);
186 struct isl_map *isl_map_identity(struct isl_dim *set_dim);
187 struct isl_map *isl_map_identity_like(struct isl_basic_map *model);
188 struct isl_map *isl_map_finalize(struct isl_map *map);
189 void isl_map_free(struct isl_map *map);
190 struct isl_map *isl_map_copy(struct isl_map *map);
191 struct isl_map *isl_map_extend(struct isl_map *base,
192 unsigned nparam, unsigned n_in, unsigned n_out);
193 struct isl_map *isl_map_reverse(struct isl_map *map);
194 struct isl_map *isl_map_union(struct isl_map *map1, struct isl_map *map2);
195 struct isl_map *isl_map_union_disjoint(
196 struct isl_map *map1, struct isl_map *map2);
197 struct isl_map *isl_map_intersect_domain(
199 struct isl_set *set);
200 struct isl_map *isl_map_intersect_range(
202 struct isl_set *set);
203 struct isl_map *isl_map_apply_domain(
204 struct isl_map *map1,
205 struct isl_map *map2);
206 struct isl_map *isl_map_apply_range(
207 struct isl_map *map1,
208 struct isl_map *map2);
209 struct isl_map *isl_map_intersect(struct isl_map *map1, struct isl_map *map2);
210 struct isl_map *isl_map_subtract(struct isl_map *map1, struct isl_map *map2);
211 struct isl_map *isl_map_fix_input_si(struct isl_map *map,
212 unsigned input, int value);
213 struct isl_map *isl_map_fix_si(struct isl_map *map,
214 enum isl_dim_type type, unsigned pos, int value);
215 struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap);
216 struct isl_set *isl_map_deltas(struct isl_map *map);
217 struct isl_set *isl_map_range(struct isl_map *map);
218 struct isl_basic_map *isl_map_affine_hull(struct isl_map *map);
219 struct isl_map *isl_map_remove_inputs(struct isl_map *map,
220 unsigned first, unsigned n);
222 struct isl_set *isl_map_domain(struct isl_map *bmap);
223 struct isl_map *isl_map_from_basic_map(struct isl_basic_map *bmap);
224 struct isl_map *isl_map_from_set(struct isl_set *set, struct isl_dim *dim);
225 struct isl_set *isl_set_from_map(struct isl_map *map);
227 int isl_map_is_empty(struct isl_map *map);
228 int isl_map_is_subset(struct isl_map *map1, struct isl_map *map2);
229 int isl_map_is_equal(struct isl_map *map1, struct isl_map *map2);
231 void isl_map_dump(struct isl_map *map, FILE *out, int indent);
233 int isl_map_fast_input_is_fixed(struct isl_map *map,
234 unsigned in, isl_int *val);
236 int isl_map_fast_is_equal(struct isl_map *map1, struct isl_map *map2);
238 #if defined(__cplusplus)