-
- isl_assert(bset->ctx, n_eq <= nvar, return NULL);
-
- d = isl_vec_alloc(bset->ctx, n_eq);
- B = isl_mat_sub_alloc(bset->ctx, bset->eq, 0, n_eq, 0, 1 + nparam);
- H = isl_mat_sub_alloc(bset->ctx, bset->eq, 0, n_eq, 1 + nparam, nvar);
- H = isl_mat_left_hermite(H, 0, NULL, NULL);
- H = isl_mat_drop_cols(H, n_eq, nvar - n_eq);
- H = isl_mat_lin_to_aff(H);
- H = isl_mat_right_inverse(H);
- if (!H || !d)
- goto error;
- isl_seq_set(d->el, H->row[0][0], d->size);
- H = isl_mat_drop_rows(H, 0, 1);
- H = isl_mat_drop_cols(H, 0, 1);
- B = isl_mat_product(H, B);
- inv = isl_mat_parameter_compression(B, d);
+ n_div = isl_basic_set_dim(bset, isl_dim_div);
+
+ if (isl_seq_first_non_zero(bset->eq[bset->n_eq - 1] + 1 + nparam,
+ nvar + n_div) == -1)
+ 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);
+
+ 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 + n_div);
+ inv = isl_mat_parameter_compression_ext(B, H);