The "extra" variable is used to indicate both the number
of extra variables in the columns beyond those in dim
and the number of rows in the div array.
We can therefore not increase extra, without also extending this array.
isl_seq_clr(c + rem, n);
}
isl_seq_clr(c + rem, n);
}
+/* Drop n dimensions starting at first.
+ *
+ * In principle, this frees up some extra variables as the number
+ * of columns remains constant, but we would have to extend
+ * the div array too as the number of rows in this array is assumed
+ * to be equal to extra.
+ */
struct isl_basic_set *isl_basic_set_drop_dims(
struct isl_basic_set *bset, unsigned first, unsigned n)
{
struct isl_basic_set *isl_basic_set_drop_dims(
struct isl_basic_set *bset, unsigned first, unsigned n)
{
bset->dim = isl_dim_drop_outputs(bset->dim, first, n);
if (!bset->dim)
goto error;
bset->dim = isl_dim_drop_outputs(bset->dim, first, n);
if (!bset->dim)
goto error;
F_CLR(bset, ISL_BASIC_SET_NORMALIZED);
bset = isl_basic_set_simplify(bset);
F_CLR(bset, ISL_BASIC_SET_NORMALIZED);
bset = isl_basic_set_simplify(bset);
+/* Drop n input dimensions starting at first.
+ *
+ * In principle, this frees up some extra variables as the number
+ * of columns remains constant, but we would have to extend
+ * the div array too as the number of rows in this array is assumed
+ * to be equal to extra.
+ */
struct isl_basic_map *isl_basic_map_drop_inputs(
struct isl_basic_map *bmap, unsigned first, unsigned n)
{
struct isl_basic_map *isl_basic_map_drop_inputs(
struct isl_basic_map *bmap, unsigned first, unsigned n)
{
bmap->dim = isl_dim_drop_inputs(bmap->dim, first, n);
if (!bmap->dim)
goto error;
bmap->dim = isl_dim_drop_inputs(bmap->dim, first, n);
if (!bmap->dim)
goto error;
F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
bmap = isl_basic_map_simplify(bmap);
F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
bmap = isl_basic_map_simplify(bmap);
+/* Replace the variables x in bset by x' given by x = M x', with
+ * M the matrix mat.
+ *
+ * If there are fewer variables x' then there are x, then we perform
+ * the transformation in place, which that, in principle,
+ * this frees up some extra variables as the number
+ * of columns remains constant, but we would have to extend
+ * the div array too as the number of rows in this array is assumed
+ * to be equal to extra.
+ */
struct isl_basic_set *isl_basic_set_preimage(struct isl_ctx *ctx,
struct isl_basic_set *bset, struct isl_mat *mat)
{
struct isl_basic_set *isl_basic_set_preimage(struct isl_ctx *ctx,
struct isl_basic_set *bset, struct isl_mat *mat)
{
if (!bset->dim)
goto error;
bset->dim->n_out -= mat->n_row - mat->n_col;
if (!bset->dim)
goto error;
bset->dim->n_out -= mat->n_row - mat->n_col;
- bset->extra += mat->n_row - mat->n_col;
}
t = isl_mat_sub_alloc(ctx, bset->eq, 0, bset->n_eq, 0, mat->n_row);
}
t = isl_mat_sub_alloc(ctx, bset->eq, 0, bset->n_eq, 0, mat->n_row);