add isl_local_space_from_domain
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 12 Jun 2011 09:42:14 +0000 (11:42 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 12 Jun 2011 12:22:45 +0000 (14:22 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/local_space.h
isl_local_space.c

index 15bebe9..c4f6c93 100644 (file)
@@ -604,6 +604,12 @@ They can be inspected, copied and freed using the following functions.
                __isl_keep isl_local_space *ls);
        void *isl_local_space_free(__isl_take isl_local_space *ls);
 
+Local spaces can be created from other local spaces
+using the following function.
+
+       __isl_give isl_local_space *isl_local_space_from_domain(
+               __isl_take isl_local_space *ls);
+
 =head2 Input and Output
 
 C<isl> supports its own input/output format, which is similar
index 24c02b5..bceab92 100644 (file)
@@ -27,6 +27,9 @@ __isl_give isl_dim *isl_local_space_get_dim(__isl_keep isl_local_space *ls);
 __isl_give isl_div *isl_local_space_get_div(__isl_keep isl_local_space *ls,
        int pos);
 
+__isl_give isl_local_space *isl_local_space_from_domain(
+       __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 3fd5ad8..502b742 100644 (file)
@@ -319,3 +319,18 @@ int isl_local_space_divs_known(__isl_keep isl_local_space *ls)
 
        return 1;
 }
+
+/* Construct a local space for a map that has the given local
+ * space as domain and that has a zero-dimensional range.
+ */
+__isl_give isl_local_space *isl_local_space_from_domain(
+       __isl_take isl_local_space *ls)
+{
+       ls = isl_local_space_cow(ls);
+       if (!ls)
+               return NULL;
+       ls->dim = isl_dim_from_domain(ls->dim);
+       if (!ls->dim)
+               return isl_local_space_free(ls);
+       return ls;
+}