add isl_local_space_lifting
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 8 Sep 2011 20:08:03 +0000 (22:08 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Oct 2011 09:03:37 +0000 (11:03 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/local_space.h
isl_local_space.c

index 74a1e69..59d086d 100644 (file)
@@ -2088,6 +2088,15 @@ existentially quantified variables.
        __isl_give isl_union_set *isl_union_set_lift(
                __isl_take isl_union_set *uset);
 
+Given a local space that contains the existentially quantified
+variables of a set, a basic relation that, when applied to
+a basic set, has essentially the same effect as C<isl_basic_set_lift>,
+can be constructed using the following function.
+
+       #include <isl/local_space.h>
+       __isl_give isl_basic_map *isl_local_space_lifting(
+               __isl_take isl_local_space *ls);
+
 =item * Internal Product
 
        __isl_give isl_basic_map *isl_basic_map_zip(
index be116c6..7f73e0b 100644 (file)
@@ -4,6 +4,7 @@
 #include <isl/aff_type.h>
 #include <isl/space.h>
 #include <isl/printer.h>
+#include <isl/map_type.h>
 
 #if defined(__cplusplus)
 extern "C" {
@@ -55,6 +56,9 @@ __isl_give isl_local_space *isl_local_space_intersect(
 int isl_local_space_is_equal(__isl_keep isl_local_space *ls1,
        __isl_keep isl_local_space *ls2);
 
+__isl_give isl_basic_map *isl_local_space_lifting(
+       __isl_take isl_local_space *ls);
+
 __isl_give isl_printer *isl_printer_print_local_space(__isl_take isl_printer *p,
        __isl_keep isl_local_space *ls);
 void isl_local_space_dump(__isl_keep isl_local_space *ls);
index 0bbd0e0..8a27e81 100644 (file)
@@ -856,3 +856,27 @@ __isl_give isl_local_space *isl_local_space_lift(
 
        return ls;
 }
+
+/* Construct a basic map that maps a set living in local space "ls"
+ * to the corresponding lifted local space.
+ */
+__isl_give isl_basic_map *isl_local_space_lifting(
+       __isl_take isl_local_space *ls)
+{
+       isl_basic_map *lifting;
+       isl_basic_set *bset;
+
+       if (!ls)
+               return NULL;
+       if (!isl_local_space_is_set(ls))
+               isl_die(isl_local_space_get_ctx(ls), isl_error_invalid,
+                       "lifting only defined on set spaces",
+                       return isl_local_space_free(ls));
+
+       bset = isl_basic_set_from_local_space(ls);
+       lifting = isl_basic_set_unwrap(isl_basic_set_lift(bset));
+       lifting = isl_basic_map_domain_map(lifting);
+       lifting = isl_basic_map_reverse(lifting);
+
+       return lifting;
+}