isl_map_convex_hull: normalize map first
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 2 Mar 2009 22:20:19 +0000 (23:20 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 8 Mar 2009 18:01:48 +0000 (19:01 +0100)
isl_convex_hull.c
isl_map_private.h

index 7fa1e38..780c1a0 100644 (file)
@@ -1040,12 +1040,7 @@ static struct isl_basic_set *uset_convex_hull(struct isl_set *set)
 
        if (!set)
                goto error;
-       for (i = 0; i < set->n; ++i) {
-               set->p[i] = isl_basic_set_convex_hull(set->p[i]);
-               if (!set->p[i])
-                       goto error;
-       }
-       set = isl_set_remove_empty_parts(set);
+       set = isl_set_normalize(set);
        if (!set)
                return NULL;
        if (set->n == 1) {
@@ -1091,12 +1086,7 @@ static struct isl_basic_set *uset_convex_hull_wrap(struct isl_set *set)
 
        if (!set)
                goto error;
-       for (i = 0; i < set->n; ++i) {
-               set->p[i] = isl_basic_set_convex_hull(set->p[i]);
-               if (!set->p[i])
-                       goto error;
-       }
-       set = isl_set_remove_empty_parts(set);
+       set = isl_set_normalize(set);
        if (!set)
                goto error;
        if (set->n == 1) {
index 1784882..1c4f68b 100644 (file)
@@ -81,6 +81,8 @@ struct isl_map *isl_map_drop(struct isl_map *map,
 struct isl_map *isl_map_remove_empty_parts(struct isl_map *map);
 struct isl_set *isl_set_remove_empty_parts(struct isl_set *set);
 
+struct isl_set *isl_set_normalize(struct isl_set *set);
+
 struct isl_set *isl_set_drop_vars(
                struct isl_set *set, unsigned first, unsigned n);