* Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
*/
+#include <isl_ctx_private.h>
#include <isl_map_private.h>
#include "isl_equalities.h"
#include <isl/map.h>
return bmap;
if (div_eq < bmap->n_eq) {
- B = isl_mat_sub_alloc(bmap->ctx, bmap->eq, div_eq,
+ B = isl_mat_sub_alloc6(bmap->ctx, bmap->eq, div_eq,
bmap->n_eq - div_eq, 0, 1 + total);
C = isl_mat_variable_compression(B, &C2);
if (!C || !C2)
--j;
isl_int_set(d->block.data[i], bmap->eq[i][1 + total + j]);
}
- B = isl_mat_sub_alloc(bmap->ctx, bmap->eq, 0, div_eq, 0, 1 + total);
+ B = isl_mat_sub_alloc6(bmap->ctx, bmap->eq, 0, div_eq, 0, 1 + total);
if (C) {
B = isl_mat_product(B, C);
return NULL;
total = isl_basic_set_total_dim(bset);
- B = isl_mat_sub_alloc(bset->ctx, bset->eq, 0, bset->n_eq, 0, 1 + total);
+ B = isl_mat_sub_alloc6(bset->ctx, bset->eq, 0, bset->n_eq, 0, 1 + total);
C = isl_mat_variable_compression(B, NULL);
if (!C)
return bset;
isl_mat_free(C);
return isl_basic_set_set_to_empty(bset);
}
- B = isl_mat_sub_alloc(bset->ctx, bset->ineq,
+ B = isl_mat_sub_alloc6(bset->ctx, bset->ineq,
0, bset->n_ineq, 0, 1 + total);
C = isl_mat_product(B, C);
if (!C)
* We first compute the integer affine hull of the intersection,
* compute the gist inside this affine hull and then add back
* those equalities that are not implied by the context.
+ *
+ * If two constraints are mutually redundant, then uset_gist_full
+ * will remove the second of those constraints. We therefore first
+ * sort the constraints so that constraints not involving existentially
+ * quantified variables are given precedence over those that do.
+ * We have to perform this sorting before the variable compression,
+ * because that may effect the order of the variables.
*/
static __isl_give isl_basic_set *uset_gist(__isl_take isl_basic_set *bset,
__isl_take isl_basic_set *context)
isl_basic_set_free(context);
return bset;
}
+ bset = isl_basic_set_sort_constraints(bset);
aff = isl_basic_set_affine_hull(isl_basic_set_copy(bset));
if (!aff)
goto error;
return uset_gist_full(bset, context);
}
total = isl_basic_set_total_dim(bset);
- eq = isl_mat_sub_alloc(bset->ctx, aff->eq, 0, aff->n_eq, 0, 1 + total);
+ eq = isl_mat_sub_alloc6(bset->ctx, aff->eq, 0, aff->n_eq, 0, 1 + total);
eq = isl_mat_cow(eq);
T = isl_mat_variable_compression(eq, &T2);
if (T && T->n_col == 0) {