add isl_union_map_simple_hull
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 3 Jan 2011 11:08:40 +0000 (12:08 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 7 Jan 2011 15:11:17 +0000 (16:11 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/union_map.h
include/isl/union_set.h
isl_union_map.c

index 2f01c13..cabc3b8 100644 (file)
@@ -1315,6 +1315,8 @@ variables, then the result of these operations is currently undefined.
                __isl_take isl_set *set);
        __isl_give isl_basic_map *isl_map_simple_hull(
                __isl_take isl_map *map);
+       __isl_give isl_union_map *isl_union_map_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 9a10f8f..b62dcd2 100644 (file)
@@ -35,6 +35,8 @@ __isl_give isl_union_map *isl_union_map_affine_hull(
        __isl_take isl_union_map *umap);
 __isl_give isl_union_map *isl_union_map_polyhedral_hull(
        __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_coalesce(
        __isl_take isl_union_map *umap);
 __isl_give isl_union_map *isl_union_map_compute_divs(
index a30064e..e81d5b3 100644 (file)
@@ -20,6 +20,8 @@ __isl_give isl_union_set *isl_union_set_affine_hull(
        __isl_take isl_union_set *uset);
 __isl_give isl_union_set *isl_union_set_polyhedral_hull(
        __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_coalesce(
        __isl_take isl_union_set *uset);
 __isl_give isl_union_set *isl_union_set_compute_divs(
index 550666c..27807f5 100644 (file)
@@ -954,6 +954,27 @@ __isl_give isl_union_set *isl_union_set_polyhedral_hull(
        return isl_union_map_polyhedral_hull(uset);
 }
 
+static int simple_entry(void **entry, void *user)
+{
+       isl_map **map = (isl_map **)entry;
+
+       *map = isl_map_from_basic_map(isl_map_simple_hull(*map));
+
+       return *map ? 0 : -1;
+}
+
+__isl_give isl_union_map *isl_union_map_simple_hull(
+       __isl_take isl_union_map *umap)
+{
+       return un_op(umap, &simple_entry);
+}
+
+__isl_give isl_union_set *isl_union_set_simple_hull(
+       __isl_take isl_union_set *uset)
+{
+       return isl_union_map_simple_hull(uset);
+}
+
 static int inplace_entry(void **entry, void *user)
 {
        __isl_give isl_map *(*fn)(__isl_take isl_map *) = user;