isl_convex_hull.c: wrap_facet: allow unbounded facets again.
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 5 Feb 2010 13:29:44 +0000 (14:29 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 8 Feb 2010 18:42:01 +0000 (19:42 +0100)
This reverts commit 7c08353 (isl_convex_hull.c: update wrap_facet to
the fact we only apply it on polytopes).
We want to export wrap_facet and allow it to be called on unbounded
polyhedra.

isl_convex_hull.c

index 77dcc2a..e91bf12 100644 (file)
@@ -457,8 +457,9 @@ static struct isl_basic_set *wrap_constraints(struct isl_set *set)
  * In the original space, we need to take the same combination of the
  * corresponding constraints "facet" and "ridge".
  *
- * Note that a is always finite, since we only apply the wrapping
- * technique to a union of polytopes.
+ * If a = -infty = "-1/0", then we just return the original facet constraint.
+ * This means that the facet is unbounded, but has a bounded intersection
+ * with the union of sets.
  */
 static isl_int *wrap_facet(struct isl_set *set, isl_int *facet, isl_int *ridge)
 {
@@ -508,7 +509,8 @@ static isl_int *wrap_facet(struct isl_set *set, isl_int *facet, isl_int *ridge)
        isl_vec_free(obj);
        isl_basic_set_free(lp);
        isl_set_free(set);
-       isl_assert(set->ctx, res == isl_lp_ok, return NULL);
+       isl_assert(set->ctx, res == isl_lp_ok || res == isl_lp_unbounded, 
+                  return NULL);
        return facet;
 error:
        isl_basic_set_free(lp);