add isl_union_{set,map}_plain_unshifted_simple_hull
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 19 Jan 2025 19:47:11 +0000 (19 20:47 +0100)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Tue, 21 Jan 2025 22:57:10 +0000 (21 23:57 +0100)
These extend isl_{set,map}_plain_unshifted_simple_hull
to union sets and maps.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
doc/user.pod
include/isl/union_map.h
include/isl/union_set.h
isl_union_map.c

index 3e9e0b8..5061e1f 100644 (file)
@@ -6450,9 +6450,17 @@ variables, then the result of these operations is currently undefined.
                __isl_take isl_map *map,
                __isl_take isl_map_list *list);
 
+       #include <isl/union_set.h>
+       __isl_give isl_union_set *
+       isl_union_set_plain_unshifted_simple_hull(
+               __isl_take isl_union_set *uset);
+
        #include <isl/union_map.h>
        __isl_give isl_union_map *isl_union_map_simple_hull(
                __isl_take isl_union_map *umap);
+       __isl_give isl_union_map *
+       isl_union_map_plain_unshifted_simple_hull(
+               __isl_take isl_union_map *umap);
 
 These functions compute a single basic set or relation
 that contains the whole input set or relation.
index c17c27d..e71c030 100644 (file)
@@ -82,6 +82,8 @@ __isl_give isl_union_map *isl_union_map_remove_redundancies(
        __isl_take isl_union_map *umap);
 __isl_give isl_union_map *isl_union_map_simple_hull(
        __isl_take isl_union_map *umap);
+__isl_give isl_union_map *isl_union_map_plain_unshifted_simple_hull(
+       __isl_take isl_union_map *umap);
 __isl_export
 __isl_give isl_union_map *isl_union_map_coalesce(
        __isl_take isl_union_map *umap);
index b86196d..792ef93 100644 (file)
@@ -52,6 +52,8 @@ __isl_give isl_union_set *isl_union_set_remove_redundancies(
        __isl_take isl_union_set *uset);
 __isl_give isl_union_set *isl_union_set_simple_hull(
        __isl_take isl_union_set *uset);
+__isl_give isl_union_set *isl_union_set_plain_unshifted_simple_hull(
+       __isl_take isl_union_set *uset);
 __isl_export
 __isl_give isl_union_set *isl_union_set_coalesce(
        __isl_take isl_union_set *uset);
index 5a0f40e..c8393f5 100644 (file)
@@ -2198,6 +2198,45 @@ __isl_give isl_union_set *isl_union_set_simple_hull(
        return isl_union_map_simple_hull(uset);
 }
 
+/* Compute a superset of the convex hull of "map" that is described
+ * by only the constraints in the constituents of "map" and
+ * return the result as an isl_map.
+ * In particular, the result is composed of constraints that appear
+ * in each of the basic maps of "map".
+ */
+static __isl_give isl_map *isl_map_plain_unshifted_simple_hull_map(
+       __isl_take isl_map *map)
+{
+       return isl_map_from_basic_map(isl_map_plain_unshifted_simple_hull(map));
+}
+
+/* For each map in "umap", compute a superset of the convex hull
+ * that is described by only the constraints in the constituents of that map and
+ * collect the results.
+ * In particular, each result is composed of constraints that appear
+ * in each of the basic maps of the corresponding map.
+ */
+__isl_give isl_union_map *isl_union_map_plain_unshifted_simple_hull(
+       __isl_take isl_union_map *umap)
+{
+       return total(umap, &isl_map_plain_unshifted_simple_hull_map);
+}
+
+/* For each set in "uset", compute a superset of the convex hull
+ * that is described by only the constraints in the constituents of that set and
+ * collect the results.
+ * In particular, each result is composed of constraints that appear
+ * in each of the basic sets of the corresponding set.
+ */
+__isl_give isl_union_set *isl_union_set_plain_unshifted_simple_hull(
+       __isl_take isl_union_set *uset)
+{
+       isl_union_map *umap;
+
+       umap = isl_union_map_plain_unshifted_simple_hull(uset_to_umap(uset));
+       return uset_from_umap(umap);
+}
+
 static __isl_give isl_union_map *inplace(__isl_take isl_union_map *umap,
        __isl_give isl_map *(*fn)(__isl_take isl_map *))
 {