add isl_map_foreach_basic_map
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 30 Sep 2009 10:20:18 +0000 (12:20 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 2 Oct 2009 05:43:45 +0000 (07:43 +0200)
include/isl_map.h
isl_map.c

index 062bf4d..970d6d0 100644 (file)
@@ -303,6 +303,9 @@ __isl_give isl_map *isl_map_coalesce(__isl_take isl_map *map);
 
 int isl_map_fast_is_equal(__isl_keep isl_map *map1, __isl_keep isl_map *map2);
 
+int isl_map_foreach_basic_map(__isl_keep isl_map *map,
+       int (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user);
+
 #if defined(__cplusplus)
 }
 #endif
index c022b31..72fdb41 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -5297,3 +5297,18 @@ int isl_set_dim_is_unique(struct isl_set *set, unsigned dim)
        }
        return 1;
 }
+
+int isl_map_foreach_basic_map(__isl_keep isl_map *map,
+       int (*fn)(__isl_take isl_basic_map *bmap, void *user), void *user)
+{
+       int i;
+
+       if (!map)
+               return -1;
+
+       for (i = 0; i < map->n; ++i)
+               if (fn(isl_basic_map_copy(map->p[i]), user) < 0)
+                       return -1;
+
+       return 0;
+}