add isl_set_foreach_basic_set
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Oct 2009 09:18:13 +0000 (11:18 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 2 Oct 2009 05:43:45 +0000 (07:43 +0200)
include/isl_set.h
isl_map.c

index 8fc1ae7..084aca5 100644 (file)
@@ -245,6 +245,9 @@ uint32_t isl_set_get_hash(struct isl_set *set);
 
 int isl_set_dim_is_unique(struct isl_set *set, unsigned dim);
 
+int isl_set_foreach_basic_set(__isl_keep isl_set *set,
+       int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user);
+
 #if defined(__cplusplus)
 }
 #endif
index 2de215e..5dfea5b 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -5315,6 +5315,21 @@ int isl_map_foreach_basic_map(__isl_keep isl_map *map,
        return 0;
 }
 
+int isl_set_foreach_basic_set(__isl_keep isl_set *set,
+       int (*fn)(__isl_take isl_basic_set *bset, void *user), void *user)
+{
+       int i;
+
+       if (!set)
+               return -1;
+
+       for (i = 0; i < set->n; ++i)
+               if (fn(isl_basic_set_copy(set->p[i]), user) < 0)
+                       return -1;
+
+       return 0;
+}
+
 __isl_give isl_map *isl_set_lifting(__isl_take isl_set *set)
 {
        struct isl_dim *dim;