The function is supposed to increment the coefficient of the given
div by one, but instead it would simply set the coefficient to one.
This is fine if the div is new and therefore has a zero coefficient,
but it does not work if the div already appeared in the constraint.
Reported-by: Armin Größlinger <armin.groesslinger@uni-passau.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
} else {
int dcol = tab->var[tab->n_var - tab->n_div + div].index;
- isl_int_set_si(tab->mat->row[row][2 + tab->M + dcol], 1);
+ isl_int_add_ui(tab->mat->row[row][2 + tab->M + dcol],
+ tab->mat->row[row][2 + tab->M + dcol], 1);
}
return tab;
assert(isl_map_is_equal(map, map2));
isl_map_free(map);
isl_map_free(map2);
+
+ str = "{ T[a] -> S[b, c] : a = 4b-2c and c >= b }";
+ map = isl_map_read_from_str(ctx, str);
+ map = isl_map_lexmin(map);
+ str = "{ T[a] -> S[b, c] : 2b = a and 2c = a }";
+ map2 = isl_map_read_from_str(ctx, str);
+ assert(isl_map_is_equal(map, map2));
+ isl_map_free(map);
+ isl_map_free(map2);
}
struct must_may {