For the purpose of compressing parameters, there should be no need
to make a distinction between set variables and existentially quantified
variables.
There does not appear to be any reason for not allowing existentially
quantified variables before other than the fact that we didn't need
to apply this function of basic sets with existentially quantified
variables before. However, this will turn out to be useful when
we want to compress the unknown divs within isl_basic_map_compute_divs.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
{
unsigned nparam;
unsigned nvar;
{
unsigned nparam;
unsigned nvar;
int n_eq;
isl_mat *H, *B;
isl_vec *d;
int n_eq;
isl_mat *H, *B;
isl_vec *d;
if (bset->n_eq == 0)
return isl_morph_identity(bset);
if (bset->n_eq == 0)
return isl_morph_identity(bset);
- isl_assert(bset->ctx, bset->n_div == 0, return NULL);
-
n_eq = bset->n_eq;
nparam = isl_basic_set_dim(bset, isl_dim_param);
nvar = isl_basic_set_dim(bset, isl_dim_set);
n_eq = bset->n_eq;
nparam = isl_basic_set_dim(bset, isl_dim_param);
nvar = isl_basic_set_dim(bset, isl_dim_set);
+ n_div = isl_basic_set_dim(bset, isl_dim_div);
if (isl_seq_first_non_zero(bset->eq[bset->n_eq - 1] + 1 + nparam,
if (isl_seq_first_non_zero(bset->eq[bset->n_eq - 1] + 1 + nparam,
isl_die(isl_basic_set_get_ctx(bset), isl_error_invalid,
"input not allowed to have parameter equalities",
return NULL);
isl_die(isl_basic_set_get_ctx(bset), isl_error_invalid,
"input not allowed to have parameter equalities",
return NULL);
+ if (n_eq > nvar + n_div)
isl_die(isl_basic_set_get_ctx(bset), isl_error_invalid,
"input not gaussed", return NULL);
d = isl_vec_alloc(bset->ctx, n_eq);
B = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, n_eq, 0, 1 + nparam);
isl_die(isl_basic_set_get_ctx(bset), isl_error_invalid,
"input not gaussed", return NULL);
d = isl_vec_alloc(bset->ctx, n_eq);
B = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, n_eq, 0, 1 + nparam);
- H = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, n_eq, 1 + nparam, nvar);
+ H = isl_mat_sub_alloc6(bset->ctx, bset->eq,
+ 0, n_eq, 1 + nparam, nvar + n_div);
H = isl_mat_left_hermite(H, 0, NULL, NULL);
H = isl_mat_left_hermite(H, 0, NULL, NULL);
- H = isl_mat_drop_cols(H, n_eq, nvar - n_eq);
+ H = isl_mat_drop_cols(H, n_eq, (nvar + n_div) - n_eq);
H = isl_mat_lin_to_aff(H);
H = isl_mat_right_inverse(H);
if (!H || !d)
H = isl_mat_lin_to_aff(H);
H = isl_mat_right_inverse(H);
if (!H || !d)