From 0ec3dc94a8443c4dd056d7e64a7fde28eeb97098 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 22 Aug 2012 20:11:12 +0200 Subject: [PATCH] add isl_pw_aff_list_set_rational Signed-off-by: Sven Verdoolaege --- isl_aff.c | 23 +++++++++++++++++++++++ isl_aff_private.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/isl_aff.c b/isl_aff.c index 41bee5c..3338a3a 100644 --- 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 diff --git a/isl_aff_private.h b/isl_aff_private.h index 546a368..8c1e3d4 100644 --- a/isl_aff_private.h +++ b/isl_aff_private.h @@ -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 -- 2.7.4