if (to_row(tab, var, 1) < 0)
return -1;
- if (var->is_row)
+ if (var->is_row) {
isl_int_sub(tab->mat->row[var->index][1],
tab->mat->row[var->index][1], tab->mat->row[var->index][0]);
- else {
+ if (var->is_nonneg) {
+ int sgn = restore_row(tab, var);
+ isl_assert(tab->mat->ctx, sgn >= 0, return -1);
+ }
+ } else {
int i;
for (i = 0; i < tab->n_row; ++i) {
void test_coalesce(struct isl_ctx *ctx)
{
+ const char *str;
struct isl_set *set, *set2;
struct isl_map *map, *map2;
assert(isl_map_is_equal(map, map2));
isl_map_free(map);
isl_map_free(map2);
+
+ str = "[n, m] -> { [] -> [o0, o2, o3] : (o3 = 1 and o0 >= 1 + m and "
+ "o0 <= n + m and o2 <= m and o0 >= 2 + n and o2 >= 3) or "
+ "(o0 >= 2 + n and o0 >= 1 + m and o0 <= n + m and n >= 1 and "
+ "o3 <= -1 + o2 and o3 >= 1 - m + o2 and o3 >= 2 and o3 <= n) }";
+ map = isl_map_read_from_str(ctx, str, -1);
+ map = isl_map_coalesce(map);
+ map2 = isl_map_read_from_str(ctx, str, -1);
+ assert(isl_map_is_equal(map, map2));
+ isl_map_free(map);
+ isl_map_free(map2);
}
void test_closure(struct isl_ctx *ctx)