add isl_pw_aff_list_set_rational
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 22 Aug 2012 18:11:12 +0000 (20:11 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Tue, 18 Sep 2012 13:08:20 +0000 (15:08 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_aff.c
isl_aff_private.h

index 41bee5c..3338a3a 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -2530,6 +2530,29 @@ __isl_give isl_pw_aff *isl_pw_aff_set_rational(__isl_take isl_pw_aff *pwaff)
        return pwaff;
 }
 
+/* Mark the domains of the elements of "list" as rational.
+ */
+__isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational(
+       __isl_take isl_pw_aff_list *list)
+{
+       int i;
+
+       if (!list)
+               return NULL;
+       if (list->n == 0)
+               return list;
+
+       for (i = 0; i < list->n; ++i) {
+               isl_pw_aff *pa;
+
+               pa = isl_pw_aff_list_get_pw_aff(list, i);
+               pa = isl_pw_aff_set_rational(pa);
+               list = isl_pw_aff_list_set_pw_aff(list, i, pa);
+       }
+
+       return list;
+}
+
 #undef BASE
 #define BASE aff
 
index 546a368..8c1e3d4 100644 (file)
@@ -75,6 +75,8 @@ __isl_give isl_pw_aff *isl_pw_aff_union_opt(__isl_take isl_pw_aff *pwaff1,
        __isl_take isl_pw_aff *pwaff2, int max);
 
 __isl_give isl_pw_aff *isl_pw_aff_set_rational(__isl_take isl_pw_aff *pwaff);
+__isl_give isl_pw_aff_list *isl_pw_aff_list_set_rational(
+       __isl_take isl_pw_aff_list *list);
 
 #undef BASE
 #define BASE aff