From 6e524e26c4b66f743d78bbc0070f654b36d966cd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 8 Sep 2011 22:08:03 +0200 Subject: [PATCH] add isl_local_space_lifting Signed-off-by: Sven Verdoolaege --- doc/user.pod | 9 +++++++++ include/isl/local_space.h | 4 ++++ isl_local_space.c | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/doc/user.pod b/doc/user.pod index 74a1e69..59d086d 100644 --- a/doc/user.pod +++ b/doc/user.pod @@ -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, +can be constructed using the following function. + + #include + __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( diff --git a/include/isl/local_space.h b/include/isl/local_space.h index be116c6..7f73e0b 100644 --- a/include/isl/local_space.h +++ b/include/isl/local_space.h @@ -4,6 +4,7 @@ #include #include #include +#include #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); diff --git a/isl_local_space.c b/isl_local_space.c index 0bbd0e0..8a27e81 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -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; +} -- 2.7.4