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
36 struct isl_basic_map {
38 #define ISL_BASIC_MAP_FINAL (1 << 0)
58 struct isl_blk block2;
62 /* A "map" is a (disjoint) union of basic maps.
64 * Currently, the isl_set structure is identical to the isl_map structure
65 * and the library depends on this correspondence internally.
66 * However, users should not depend on this correspondence.
70 #define ISL_MAP_DISJOINT (1 << 0)
80 struct isl_basic_map *p[0];
84 struct isl_basic_map *isl_basic_map_alloc(struct isl_ctx *ctx,
85 unsigned nparam, unsigned in, unsigned out, unsigned extra,
86 unsigned n_eq, unsigned n_ineq);
87 struct isl_basic_map *isl_basic_map_identity(struct isl_ctx *ctx,
88 unsigned nparam, unsigned dim);
89 struct isl_basic_map *isl_basic_map_finalize(struct isl_ctx *ctx,
90 struct isl_basic_map *bmap);
91 void isl_basic_map_free(struct isl_ctx *ctx, struct isl_basic_map *bmap);
92 struct isl_basic_map *isl_basic_map_copy(struct isl_ctx *ctx,
93 struct isl_basic_map *bmap);
94 struct isl_basic_map *isl_basic_map_extend(struct isl_ctx *ctx,
95 struct isl_basic_map *base,
96 unsigned nparam, unsigned n_in, unsigned n_out, unsigned extra,
97 unsigned n_eq, unsigned n_ineq);
98 struct isl_basic_map *isl_basic_map_equal(struct isl_ctx *ctx,
99 unsigned nparam, unsigned in, unsigned out, unsigned n_equal);
100 struct isl_basic_map *isl_basic_map_less_at(struct isl_ctx *ctx,
101 unsigned nparam, unsigned in, unsigned out, unsigned pos);
102 struct isl_basic_map *isl_basic_map_more_at(struct isl_ctx *ctx,
103 unsigned nparam, unsigned in, unsigned out, unsigned pos);
104 struct isl_basic_map *isl_basic_map_empty(struct isl_ctx *ctx,
105 unsigned nparam, unsigned in, unsigned out);
107 struct isl_basic_map *isl_basic_map_intersect_domain(
108 struct isl_ctx *ctx, struct isl_basic_map *bmap,
109 struct isl_basic_set *bset);
110 struct isl_basic_map *isl_basic_map_intersect(
111 struct isl_ctx *ctx, struct isl_basic_map *bmap1,
112 struct isl_basic_map *bmap2);
113 struct isl_map *isl_basic_map_union(
114 struct isl_ctx *ctx, struct isl_basic_map *bmap1,
115 struct isl_basic_map *bmap2);
116 struct isl_basic_map *isl_basic_map_apply_domain(
117 struct isl_ctx *ctx, struct isl_basic_map *bmap1,
118 struct isl_basic_map *bmap2);
119 struct isl_basic_map *isl_basic_map_apply_range(
120 struct isl_ctx *ctx, struct isl_basic_map *bmap1,
121 struct isl_basic_map *bmap2);
122 struct isl_basic_map *isl_basic_map_reverse(struct isl_ctx *ctx,
123 struct isl_basic_map *bmap);
124 struct isl_basic_set *isl_basic_map_domain(struct isl_ctx *ctx,
125 struct isl_basic_map *bmap);
126 struct isl_basic_set *isl_basic_map_range(struct isl_ctx *ctx,
127 struct isl_basic_map *bmap);
128 struct isl_basic_map *isl_basic_map_from_basic_set(
129 struct isl_ctx *ctx, struct isl_basic_set *bset,
130 unsigned n_in, unsigned n_out);
131 struct isl_basic_set *isl_basic_set_from_basic_map(
132 struct isl_ctx *ctx, struct isl_basic_map *bmap);
133 struct isl_basic_map *isl_basic_map_simplify(
134 struct isl_ctx *ctx, struct isl_basic_map *bmap);
136 struct isl_map *isl_basic_map_lexmax(struct isl_ctx *ctx,
137 struct isl_basic_map *bmap, struct isl_basic_set *dom,
138 struct isl_set **empty);
139 struct isl_map *isl_basic_map_lexmin(struct isl_ctx *ctx,
140 struct isl_basic_map *bmap, struct isl_basic_set *dom,
141 struct isl_set **empty);
143 void isl_basic_map_dump(struct isl_ctx *ctx, struct isl_basic_map *bmap,
144 FILE *out, int indent);
146 int isl_basic_map_is_empty(struct isl_ctx *ctx,
147 struct isl_basic_map *bmap);
148 int isl_basic_map_is_subset(struct isl_ctx *ctx,
149 struct isl_basic_map *bmap1,
150 struct isl_basic_map *bmap2);
151 int isl_basic_map_is_strict_subset(struct isl_ctx *ctx,
152 struct isl_basic_map *bmap1,
153 struct isl_basic_map *bmap2);
155 struct isl_map *isl_map_alloc(struct isl_ctx *ctx,
156 unsigned nparam, unsigned in, unsigned out, int n,
158 struct isl_map *isl_map_empty(struct isl_ctx *ctx,
159 unsigned nparam, unsigned in, unsigned out);
160 struct isl_map *isl_map_dup(struct isl_ctx *ctx, struct isl_map *map);
161 struct isl_map *isl_map_add(struct isl_ctx *ctx, struct isl_map *map,
162 struct isl_basic_map *bmap);
163 struct isl_map *isl_map_identity(struct isl_ctx *ctx,
164 unsigned nparam, unsigned dim);
165 struct isl_map *isl_map_finalize(struct isl_ctx *ctx, struct isl_map *map);
166 void isl_map_free(struct isl_ctx *ctx, struct isl_map *map);
167 struct isl_map *isl_map_copy(struct isl_ctx *ctx, struct isl_map *map);
168 struct isl_map *isl_map_extend(struct isl_ctx *ctx, struct isl_map *base,
169 unsigned nparam, unsigned n_in, unsigned n_out);
170 struct isl_map *isl_map_reverse(struct isl_ctx *ctx, struct isl_map *map);
171 struct isl_map *isl_map_union(struct isl_ctx *ctx,
172 struct isl_map *map1, struct isl_map *map2);
173 struct isl_map *isl_map_union_disjoint(struct isl_ctx *ctx,
174 struct isl_map *map1, struct isl_map *map2);
175 struct isl_map *isl_map_intersect_domain(
176 struct isl_ctx *ctx, struct isl_map *map,
177 struct isl_set *set);
178 struct isl_map *isl_map_intersect_range(
179 struct isl_ctx *ctx, struct isl_map *map,
180 struct isl_set *set);
181 struct isl_map *isl_map_apply_domain(
182 struct isl_ctx *ctx, struct isl_map *map1,
183 struct isl_map *map2);
184 struct isl_map *isl_map_apply_range(
185 struct isl_ctx *ctx, struct isl_map *map1,
186 struct isl_map *map2);
187 struct isl_map *isl_map_intersect(struct isl_ctx *ctx, struct isl_map *map1,
188 struct isl_map *map2);
189 struct isl_map *isl_map_subtract(struct isl_ctx *ctx, struct isl_map *map1,
190 struct isl_map *map2);
191 struct isl_map *isl_map_fix_input_si(struct isl_ctx *ctx, struct isl_map *map,
192 unsigned input, int value);
193 struct isl_basic_set *isl_basic_map_deltas(struct isl_ctx *ctx,
194 struct isl_basic_map *bmap);
195 struct isl_set *isl_map_range(struct isl_ctx *ctx, struct isl_map *map);
196 struct isl_basic_map *isl_map_affine_hull(struct isl_ctx *ctx,
197 struct isl_map *map);
199 struct isl_set *isl_map_domain(struct isl_ctx *ctx, struct isl_map *bmap);
200 struct isl_map *isl_map_from_basic_map(struct isl_ctx *ctx,
201 struct isl_basic_map *bmap);
202 struct isl_map *isl_map_from_set(
203 struct isl_ctx *ctx, struct isl_set *set,
204 unsigned n_in, unsigned n_out);
206 int isl_map_is_empty(struct isl_ctx *ctx, struct isl_map *map);
207 int isl_map_is_subset(struct isl_ctx *ctx, struct isl_map *map1,
208 struct isl_map *map2);
209 int isl_map_is_equal(struct isl_ctx *ctx,
210 struct isl_map *map1, struct isl_map *map2);
212 void isl_map_dump(struct isl_ctx *ctx, struct isl_map *map, FILE *out,
215 #if defined(__cplusplus)