int d;
int i, j, k;
unsigned total;
+ int need_gauss = 0;
if (n == 0)
return bmap;
continue;
eliminate_var_using_equality(bmap, d, bmap->eq[i], 0, NULL);
isl_basic_map_drop_equality(bmap, i);
+ need_gauss = 1;
break;
}
if (i < bmap->n_eq)
bmap = remove_duplicate_constraints(bmap, NULL, 0);
bmap = isl_basic_map_gauss(bmap, NULL);
bmap = isl_basic_map_remove_redundancies(bmap);
+ need_gauss = 0;
if (!bmap)
goto error;
if (ISL_F_ISSET(bmap, ISL_BASIC_MAP_EMPTY))
}
}
ISL_F_CLR(bmap, ISL_BASIC_MAP_NORMALIZED);
+ if (need_gauss)
+ bmap = isl_basic_map_gauss(bmap, NULL);
return bmap;
error:
isl_basic_map_free(bmap);
(struct isl_basic_map *)bset, pos, n);
}
+/* Eliminate the specified n dimensions starting at first from the
+ * constraints using Fourier-Motzkin. The dimensions themselves
+ * are not removed.
+ */
+__isl_give isl_basic_map *isl_basic_map_eliminate(
+ __isl_take isl_basic_map *bmap,
+ enum isl_dim_type type, unsigned first, unsigned n)
+{
+ if (!bmap)
+ return NULL;
+ if (n == 0)
+ return bmap;
+
+ if (first + n > isl_basic_map_dim(bmap, type))
+ isl_die(bmap->ctx, isl_error_invalid,
+ "index out of bounds", goto error);
+
+ first += isl_basic_map_offset(bmap, type) - 1;
+ bmap = isl_basic_map_eliminate_vars(bmap, first, n);
+ return isl_basic_map_finalize(bmap);
+error:
+ isl_basic_map_free(bmap);
+ return NULL;
+}
+
/* Don't assume equalities are in order, because align_divs
* may have changed the order of the divs.
*/
(struct isl_basic_map *)context);
}
+__isl_give isl_set *isl_set_gist_params_basic_set(__isl_take isl_set *set,
+ __isl_take isl_basic_set *context)
+{
+ isl_space *space = isl_set_get_space(set);
+ isl_basic_set *dom_context = isl_basic_set_universe(space);
+ dom_context = isl_basic_set_intersect_params(dom_context, context);
+ return isl_set_gist_basic_set(set, dom_context);
+}
+
__isl_give isl_set *isl_set_gist(__isl_take isl_set *set,
__isl_take isl_set *context)
{
(struct isl_map *)context);
}
+__isl_give isl_map *isl_map_gist_domain(__isl_take isl_map *map,
+ __isl_take isl_set *context)
+{
+ isl_map *map_context = isl_map_universe(isl_map_get_space(map));
+ map_context = isl_map_intersect_domain(map_context, context);
+ return isl_map_gist(map, map_context);
+}
+
+__isl_give isl_map *isl_map_gist_params(__isl_take isl_map *map,
+ __isl_take isl_set *context)
+{
+ isl_map *map_context = isl_map_universe(isl_map_get_space(map));
+ map_context = isl_map_intersect_params(map_context, context);
+ return isl_map_gist(map, map_context);
+}
+
+__isl_give isl_set *isl_set_gist_params(__isl_take isl_set *set,
+ __isl_take isl_set *context)
+{
+ return isl_map_gist_params(set, context);
+}
+
/* Quick check to see if two basic maps are disjoint.
* In particular, we reduce the equalities and inequalities of
* one basic map in the context of the equalities of the other