add isl_union_map_universe
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 4 May 2011 10:59:23 +0000 (12:59 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 5 May 2011 10:33:47 +0000 (12:33 +0200)
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 a2ebc66..92c5716 100644 (file)
@@ -752,6 +752,10 @@ is only used to specify the parameters.
                __isl_take isl_dim *dim);
        __isl_give isl_map *isl_map_universe(
                __isl_take isl_dim *dim);
+       __isl_give isl_union_set *isl_union_set_universe(
+               __isl_take isl_union_set *uset);
+       __isl_give isl_union_map *isl_union_map_universe(
+               __isl_take isl_union_map *umap);
 
 The sets and relations constructed by the functions above
 contain all integer values, while those constructed by the
index c6cfd0e..129cee0 100644 (file)
@@ -24,6 +24,8 @@ void isl_union_map_free(__isl_take isl_union_map *umap);
 isl_ctx *isl_union_map_get_ctx(__isl_keep isl_union_map *umap);
 __isl_give isl_dim *isl_union_map_get_dim(__isl_keep isl_union_map *umap);
 
+__isl_give isl_union_map *isl_union_map_universe(
+       __isl_take isl_union_map *umap);
 __isl_give isl_union_set *isl_union_map_domain(__isl_take isl_union_map *umap);
 __isl_give isl_union_set *isl_union_map_range(__isl_take isl_union_map *umap);
 __isl_give isl_union_map *isl_union_map_domain_map(
index bccc682..84b374f 100644 (file)
@@ -16,6 +16,9 @@ void isl_union_set_free(__isl_take isl_union_set *uset);
 isl_ctx *isl_union_set_get_ctx(__isl_keep isl_union_set *uset);
 __isl_give isl_dim *isl_union_set_get_dim(__isl_keep isl_union_set *uset);
 
+__isl_give isl_union_set *isl_union_set_universe(
+       __isl_take isl_union_set *uset);
+
 __isl_give isl_union_set *isl_union_set_detect_equalities(
        __isl_take isl_union_set *uset);
 __isl_give isl_union_set *isl_union_set_affine_hull(
index 530ec59..f8d48bb 100644 (file)
@@ -1175,6 +1175,27 @@ error:
        return NULL;
 }
 
+static int universe_entry(void **entry, void *user)
+{
+       isl_map *map = *entry;
+       isl_union_map **res = user;
+
+       map = isl_map_universe(isl_map_get_dim(map));
+       *res = isl_union_map_add_map(*res, map);
+
+       return 0;
+}
+
+__isl_give isl_union_map *isl_union_map_universe(__isl_take isl_union_map *umap)
+{
+       return cond_un_op(umap, &universe_entry);
+}
+
+__isl_give isl_union_set *isl_union_set_universe(__isl_take isl_union_set *uset)
+{
+       return isl_union_map_universe(uset);
+}
+
 static int reverse_entry(void **entry, void *user)
 {
        isl_map *map = *entry;