10 #if defined(__cplusplus)
16 * All structures are reference counted to allow reuse without duplication.
17 * A *_copy operation will increase the reference count, while a *_free
18 * operation will decrease the reference count and only actually release
19 * the structures when the reference count drops to zero.
21 * Functions that return an isa structure will in general _destroy_
22 * all argument isa structures (the obvious execption begin the _copy
23 * functions). A pointer passed to such a function may therefore
24 * never be used after the function call. If you want to keep a
25 * reference to the old structure(s), use the appropriate _copy function.
28 /* A "basic map" is a relation between two sets of variables,
29 * called the "in" and "out" variables.
31 * It is implemented as a set with two extra fields:
32 * n_in is the number of in variables
33 * n_out is the number of out variables
34 * n_in + n_out should be equal to set.dim
37 struct isl_basic_map {
39 #define ISL_BASIC_MAP_FINAL (1 << 0)
40 #define ISL_BASIC_MAP_EMPTY (1 << 1)
41 #define ISL_BASIC_MAP_NO_IMPLICIT (1 << 2)
42 #define ISL_BASIC_MAP_NO_REDUNDANT (1 << 3)
43 #define ISL_BASIC_MAP_RATIONAL (1 << 4)
64 struct isl_vec *sample;
67 struct isl_blk block2;
71 /* A "map" is a (disjoint) union of basic maps.
73 * Currently, the isl_set structure is identical to the isl_map structure
74 * and the library depends on this correspondence internally.
75 * However, users should not depend on this correspondence.
79 #define ISL_MAP_DISJOINT (1 << 0)
91 struct isl_basic_map *p[0];
95 struct isl_basic_map *isl_basic_map_alloc(struct isl_ctx *ctx,
96 unsigned nparam, unsigned in, unsigned out, unsigned extra,
97 unsigned n_eq, unsigned n_ineq);
98 struct isl_basic_map *isl_basic_map_identity(struct isl_ctx *ctx,
99 unsigned nparam, unsigned dim);
100 struct isl_basic_map *isl_basic_map_finalize(struct isl_basic_map *bmap);
101 void isl_basic_map_free(struct isl_basic_map *bmap);
102 struct isl_basic_map *isl_basic_map_copy(struct isl_basic_map *bmap);
103 struct isl_basic_map *isl_basic_map_extend(struct isl_basic_map *base,
104 unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra,
105 unsigned n_eq, unsigned n_ineq);
106 struct isl_basic_map *isl_basic_map_equal(struct isl_ctx *ctx,
107 unsigned nparam, unsigned in, unsigned out, unsigned n_equal);
108 struct isl_basic_map *isl_basic_map_less_at(struct isl_ctx *ctx,
109 unsigned nparam, unsigned in, unsigned out, unsigned pos);
110 struct isl_basic_map *isl_basic_map_more_at(struct isl_ctx *ctx,
111 unsigned nparam, unsigned in, unsigned out, unsigned pos);
112 struct isl_basic_map *isl_basic_map_empty(struct isl_ctx *ctx,
113 unsigned nparam, unsigned in, unsigned out);
114 struct isl_basic_map *isl_basic_map_universe(struct isl_ctx *ctx,
115 unsigned nparam, unsigned in, unsigned out);
116 struct isl_basic_map *isl_basic_map_convex_hull(struct isl_basic_map *bmap);
118 struct isl_basic_map *isl_basic_map_intersect_domain(
119 struct isl_basic_map *bmap,
120 struct isl_basic_set *bset);
121 struct isl_basic_map *isl_basic_map_intersect(
122 struct isl_basic_map *bmap1,
123 struct isl_basic_map *bmap2);
124 struct isl_map *isl_basic_map_union(
125 struct isl_basic_map *bmap1,
126 struct isl_basic_map *bmap2);
127 struct isl_basic_map *isl_basic_map_apply_domain(
128 struct isl_basic_map *bmap1,
129 struct isl_basic_map *bmap2);
130 struct isl_basic_map *isl_basic_map_apply_range(
131 struct isl_basic_map *bmap1,
132 struct isl_basic_map *bmap2);
133 struct isl_basic_map *isl_basic_map_reverse(struct isl_basic_map *bmap);
134 struct isl_basic_set *isl_basic_map_domain(struct isl_basic_map *bmap);
135 struct isl_basic_set *isl_basic_map_range(struct isl_basic_map *bmap);
136 struct isl_basic_map *isl_basic_map_from_basic_set(struct isl_basic_set *bset,
137 unsigned n_in, unsigned n_out);
138 struct isl_basic_set *isl_basic_set_from_basic_map(struct isl_basic_map *bmap);
139 struct isl_basic_map *isl_basic_map_simplify(struct isl_basic_map *bmap);
140 #define ISL_FORMAT_POLYLIB 1
141 #define ISL_FORMAT_OMEGA 2
142 struct isl_basic_map *isl_basic_map_read_from_file(struct isl_ctx *ctx,
143 FILE *input, unsigned nparam, unsigned input_format);
145 struct isl_map *isl_basic_map_lexmax(
146 struct isl_basic_map *bmap, struct isl_basic_set *dom,
147 struct isl_set **empty);
148 struct isl_map *isl_basic_map_lexmin(
149 struct isl_basic_map *bmap, struct isl_basic_set *dom,
150 struct isl_set **empty);
152 void isl_basic_map_dump(struct isl_basic_map *bmap, FILE *out, int indent);
154 int isl_basic_map_is_universe(struct isl_basic_map *bmap);
155 int isl_basic_map_is_empty(struct isl_basic_map *bmap);
156 int isl_basic_map_is_subset(struct isl_basic_map *bmap1,
157 struct isl_basic_map *bmap2);
158 int isl_basic_map_is_strict_subset(struct isl_basic_map *bmap1,
159 struct isl_basic_map *bmap2);
161 struct isl_map *isl_map_alloc(struct isl_ctx *ctx,
162 unsigned nparam, unsigned in, unsigned out, int n,
164 struct isl_map *isl_map_empty(struct isl_ctx *ctx,
165 unsigned nparam, unsigned in, unsigned out);
166 struct isl_map *isl_map_dup(struct isl_map *map);
167 struct isl_map *isl_map_add(struct isl_map *map, struct isl_basic_map *bmap);
168 struct isl_map *isl_map_identity(struct isl_ctx *ctx,
169 unsigned nparam, unsigned dim);
170 struct isl_map *isl_map_finalize(struct isl_map *map);
171 void isl_map_free(struct isl_map *map);
172 struct isl_map *isl_map_copy(struct isl_map *map);
173 struct isl_map *isl_map_extend(struct isl_map *base,
174 unsigned nparam, unsigned n_in, unsigned n_out);
175 struct isl_map *isl_map_reverse(struct isl_map *map);
176 struct isl_map *isl_map_union(struct isl_map *map1, struct isl_map *map2);
177 struct isl_map *isl_map_union_disjoint(
178 struct isl_map *map1, struct isl_map *map2);
179 struct isl_map *isl_map_intersect_domain(
181 struct isl_set *set);
182 struct isl_map *isl_map_intersect_range(
184 struct isl_set *set);
185 struct isl_map *isl_map_apply_domain(
186 struct isl_map *map1,
187 struct isl_map *map2);
188 struct isl_map *isl_map_apply_range(
189 struct isl_map *map1,
190 struct isl_map *map2);
191 struct isl_map *isl_map_intersect(struct isl_map *map1, struct isl_map *map2);
192 struct isl_map *isl_map_subtract(struct isl_map *map1, struct isl_map *map2);
193 struct isl_map *isl_map_fix_input_si(struct isl_map *map,
194 unsigned input, int value);
195 struct isl_basic_set *isl_basic_map_deltas(struct isl_basic_map *bmap);
196 struct isl_set *isl_map_deltas(struct isl_map *map);
197 struct isl_set *isl_map_range(struct isl_map *map);
198 struct isl_basic_map *isl_map_affine_hull(struct isl_map *map);
199 struct isl_map *isl_map_remove_inputs(struct isl_map *map,
200 unsigned first, unsigned n);
202 struct isl_set *isl_map_domain(struct isl_map *bmap);
203 struct isl_map *isl_map_from_basic_map(struct isl_basic_map *bmap);
204 struct isl_map *isl_map_from_set(struct isl_set *set,
205 unsigned n_in, unsigned n_out);
206 struct isl_set *isl_set_from_map(struct isl_map *map);
208 int isl_map_is_empty(struct isl_map *map);
209 int isl_map_is_subset(struct isl_map *map1, struct isl_map *map2);
210 int isl_map_is_equal(struct isl_map *map1, struct isl_map *map2);
212 void isl_map_dump(struct isl_map *map, FILE *out, int indent);
214 int isl_map_fast_input_is_fixed(struct isl_map *map,
215 unsigned in, isl_int *val);
217 #if defined(__cplusplus)