add isl_union_map_gist_params
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 16 Oct 2011 13:07:44 +0000 (15:07 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 16 Oct 2011 13:07:44 +0000 (15:07 +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 bc26688..3b83443 100644 (file)
@@ -2372,6 +2372,9 @@ instead.
        __isl_give isl_union_set *isl_union_set_gist(
                __isl_take isl_union_set *uset,
                __isl_take isl_union_set *context);
+       __isl_give isl_union_set *isl_union_set_gist_params(
+               __isl_take isl_union_set *uset,
+               __isl_take isl_set *set);
        __isl_give isl_basic_map *isl_basic_map_gist(
                __isl_take isl_basic_map *bmap,
                __isl_take isl_basic_map *context);
@@ -2383,6 +2386,9 @@ instead.
        __isl_give isl_union_map *isl_union_map_gist(
                __isl_take isl_union_map *umap,
                __isl_take isl_union_map *context);
+       __isl_give isl_union_map *isl_union_map_gist_params(
+               __isl_take isl_union_map *umap,
+               __isl_take isl_set *set);
 
 The gist operation returns a set or relation that has the
 same intersection with the context as the input set or relation.
index 15918f7..6e21dad 100644 (file)
@@ -81,6 +81,9 @@ __isl_give isl_union_map *isl_union_map_flat_range_product(
 __isl_export
 __isl_give isl_union_map *isl_union_map_gist(__isl_take isl_union_map *umap,
        __isl_take isl_union_map *context);
+__isl_export
+__isl_give isl_union_map *isl_union_map_gist_params(
+       __isl_take isl_union_map *umap, __isl_take isl_set *set);
 
 __isl_export
 __isl_give isl_union_map *isl_union_map_intersect_domain(
index b1c3b27..50219de 100644 (file)
@@ -59,6 +59,9 @@ __isl_give isl_union_set *isl_union_set_product(__isl_take isl_union_set *uset1,
 __isl_export
 __isl_give isl_union_set *isl_union_set_gist(__isl_take isl_union_set *uset,
        __isl_take isl_union_set *context);
+__isl_export
+__isl_give isl_union_set *isl_union_set_gist_params(
+       __isl_take isl_union_set *uset, __isl_take isl_set *set);
 
 __isl_export
 __isl_give isl_union_set *isl_union_set_apply(
index 5ccc46e..810697c 100644 (file)
@@ -744,6 +744,38 @@ error:
        return NULL;
 }
 
+static int gist_params_entry(void **entry, void *user)
+{
+       struct isl_union_map_gen_bin_set_data *data = user;
+       isl_map *map = *entry;
+       int empty;
+
+       map = isl_map_copy(map);
+       map = isl_map_gist_params(map, isl_set_copy(data->set));
+
+       empty = isl_map_is_empty(map);
+       if (empty < 0) {
+               isl_map_free(map);
+               return -1;
+       }
+
+       data->res = isl_union_map_add_map(data->res, map);
+
+       return 0;
+}
+
+__isl_give isl_union_map *isl_union_map_gist_params(
+       __isl_take isl_union_map *umap, __isl_take isl_set *set)
+{
+       return gen_bin_set_op(umap, set, &gist_params_entry);
+}
+
+__isl_give isl_union_set *isl_union_set_gist_params(
+       __isl_take isl_union_set *uset, __isl_take isl_set *set)
+{
+       return isl_union_map_gist_params(uset, set);
+}
+
 __isl_give isl_union_map *isl_union_map_gist(__isl_take isl_union_map *umap,
        __isl_take isl_union_map *context)
 {