add isl_set_recession_cone
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Apr 2010 15:17:42 +0000 (17:17 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Thu, 1 Apr 2010 17:54:17 +0000 (19:54 +0200)
include/isl_set.h
isl_affine_hull.c

index 8af864f..3359113 100644 (file)
@@ -213,6 +213,7 @@ __isl_give isl_basic_set *isl_set_affine_hull(__isl_take isl_set *set);
 __isl_give isl_basic_set *isl_set_convex_hull(__isl_take isl_set *set);
 struct isl_basic_set *isl_set_simple_hull(struct isl_set *set);
 struct isl_basic_set *isl_set_bounded_simple_hull(struct isl_set *set);
+__isl_give isl_set *isl_set_recession_cone(__isl_take isl_set *set);
 
 struct isl_set *isl_set_union_disjoint(
                        struct isl_set *set1, struct isl_set *set2);
index cc99009..ffae59c 100644 (file)
@@ -318,6 +318,32 @@ error:
        return NULL;
 }
 
+__isl_give isl_set *isl_set_recession_cone(__isl_take isl_set *set)
+{
+       int i;
+
+       if (!set)
+               return NULL;
+       if (set->n == 0)
+               return set;
+
+       set = isl_set_remove_divs(set);
+       set = isl_set_cow(set);
+       if (!set)
+               return NULL;
+
+       for (i = 0; i < set->n; ++i) {
+               set->p[i] = isl_basic_set_recession_cone(set->p[i]);
+               if (!set->p[i])
+                       goto error;
+       }
+
+       return set;
+error:
+       isl_set_free(set);
+       return NULL;
+}
+
 /* Extend an initial (under-)approximation of the affine hull of basic
  * set represented by the tableau "tab"
  * by looking for points that do not satisfy one of the equalities