tab_total = isl_basic_map_total_dim(tab->bmap);
bmap_total = isl_basic_map_total_dim(bmap);
- dim = isl_dim_total(tab->bmap->dim);
+ dim = isl_space_dim(tab->bmap->dim, isl_dim_all);
if (isl_tab_extend_cons(tab, 2 * bmap->n_eq + bmap->n_ineq) < 0)
return -1;
tab_total = isl_basic_map_total_dim(tab->bmap);
bmap_total = isl_basic_map_total_dim(bmap);
- dim = isl_dim_total(tab->bmap->dim);
+ dim = isl_space_dim(tab->bmap->dim, isl_dim_all);
v = isl_vec_alloc(bmap->ctx, 1 + tab_total);
if (!v)
if (!map1 || !map2)
goto error;
- isl_assert(map1->ctx, isl_dim_equal(map1->dim, map2->dim), goto error);
+ isl_assert(map1->ctx, isl_space_is_equal(map1->dim, map2->dim), goto error);
if (isl_map_is_empty(map2)) {
isl_map_free(map2);
(struct isl_map *)set1, (struct isl_map *)set2);
}
+/* Remove the elements of "dom" from the domain of "map".
+ */
+static __isl_give isl_map *map_subtract_domain(__isl_take isl_map *map,
+ __isl_take isl_set *dom)
+{
+ isl_map *ext_dom;
+
+ if (!isl_map_compatible_domain(map, dom))
+ isl_die(isl_set_get_ctx(dom), isl_error_invalid,
+ "incompatible spaces", goto error);
+
+ ext_dom = isl_map_universe(isl_map_get_space(map));
+ ext_dom = isl_map_intersect_domain(ext_dom, dom);
+ return isl_map_subtract(map, ext_dom);
+error:
+ isl_map_free(map);
+ isl_set_free(dom);
+ return NULL;
+}
+
+__isl_give isl_map *isl_map_subtract_domain(__isl_take isl_map *map,
+ __isl_take isl_set *dom)
+{
+ return isl_map_align_params_map_map_and(map, dom, &map_subtract_domain);
+}
+
+/* Remove the elements of "dom" from the range of "map".
+ */
+static __isl_give isl_map *map_subtract_range(__isl_take isl_map *map,
+ __isl_take isl_set *dom)
+{
+ isl_map *ext_dom;
+
+ if (!isl_map_compatible_range(map, dom))
+ isl_die(isl_set_get_ctx(dom), isl_error_invalid,
+ "incompatible spaces", goto error);
+
+ ext_dom = isl_map_universe(isl_map_get_space(map));
+ ext_dom = isl_map_intersect_range(ext_dom, dom);
+ return isl_map_subtract(map, ext_dom);
+error:
+ isl_map_free(map);
+ isl_set_free(dom);
+ return NULL;
+}
+
+__isl_give isl_map *isl_map_subtract_range(__isl_take isl_map *map,
+ __isl_take isl_set *dom)
+{
+ return isl_map_align_params_map_map_and(map, dom, &map_subtract_range);
+}
+
/* A diff collector that aborts as soon as its add function is called,
* setting empty to 0.
*/
}
isl_int_clear(m);
- return isl_point_alloc(isl_basic_map_get_dim(bmap), point);
+ return isl_point_alloc(isl_basic_map_get_space(bmap), point);
error:
isl_int_clear(m);
isl_vec_free(point);
return is_subset;
}
-int isl_map_is_subset(struct isl_map *map1, struct isl_map *map2)
+static int map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2)
{
int is_subset = 0;
if (!map1 || !map2)
return -1;
- if (!isl_map_has_equal_dim(map1, map2))
+ if (!isl_map_has_equal_space(map1, map2))
return 0;
if (isl_map_is_empty(map1))
return is_subset;
}
+int isl_map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2)
+{
+ return isl_map_align_params_map_map_and_test(map1, map2,
+ &map_is_subset);
+}
+
int isl_set_is_subset(struct isl_set *set1, struct isl_set *set2)
{
return isl_map_is_subset(
if (!set)
return NULL;
- universe = isl_set_universe(isl_set_get_dim(set));
+ universe = isl_set_universe(isl_set_get_space(set));
return isl_set_subtract(universe, set);
}