add isl_pw_aff_from_aff
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 24 Jul 2011 08:49:17 +0000 (10:49 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 28 Jul 2011 14:23:50 +0000 (16:23 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/aff.h
isl_aff.c

index 6605fe3..fc77645 100644 (file)
@@ -2351,6 +2351,8 @@ be created using the following functions.
                __isl_take isl_dim *dim);
        __isl_give isl_pw_aff *isl_pw_aff_alloc(
                __isl_take isl_set *set, __isl_take isl_aff *aff);
+       __isl_give isl_pw_aff *isl_pw_aff_from_aff(
+               __isl_take isl_aff *aff);
 
 Quasi affine expressions can be copied and freed using
 
index 96b994d..2fd1c0b 100644 (file)
@@ -90,6 +90,7 @@ void isl_aff_dump(__isl_keep isl_aff *aff);
 isl_ctx *isl_pw_aff_get_ctx(__isl_keep isl_pw_aff *pwaff);
 __isl_give isl_dim *isl_pw_aff_get_dim(__isl_keep isl_pw_aff *pwaff);
 
+__isl_give isl_pw_aff *isl_pw_aff_from_aff(__isl_take isl_aff *aff);
 __isl_give isl_pw_aff *isl_pw_aff_empty(__isl_take isl_dim *dim);
 __isl_give isl_pw_aff *isl_pw_aff_alloc(__isl_take isl_set *set,
        __isl_take isl_aff *aff);
index 2fde6f0..99ea33e 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -1033,6 +1033,12 @@ __isl_give isl_pw_aff *isl_pw_aff_set_tuple_id(__isl_take isl_pw_aff *pwaff,
        return isl_pw_aff_reset_dim(pwaff, dim);
 }
 
+__isl_give isl_pw_aff *isl_pw_aff_from_aff(__isl_take isl_aff *aff)
+{
+       isl_set *dom = isl_set_universe(isl_aff_get_dim(aff));
+       return isl_pw_aff_alloc(dom, aff);
+}
+
 #undef PW
 #define PW isl_pw_aff
 #undef EL