From 6cc7e24114362a5b5f139b080a894c549f5f3000 Mon Sep 17 00:00:00 2001 From: skimo Date: Fri, 30 Jul 2004 14:40:36 +0000 Subject: [PATCH] check for empty polytope --- barvinok.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/barvinok.cc b/barvinok.cc index 0a6622d..44b318a 100644 --- a/barvinok.cc +++ b/barvinok.cc @@ -1930,6 +1930,15 @@ static evalue* enumerate_or(Polyhedron *pos, Polyhedron *neg, return EP; } +static evalue* new_zero_ep() +{ + evalue *EP; + ALLOC(EP); + value_init(EP->d); + evalue_set_si(EP, 0, 1); + return EP; +} + static evalue* barvinok_enumerate_e_r(Polyhedron *P, unsigned exist, unsigned nparam, unsigned MaxRays); @@ -1977,6 +1986,9 @@ static evalue* barvinok_enumerate_e_r(Polyhedron *P, int nvar = P->Dimension - exist - nparam; int len = P->Dimension + 2; + if (emptyQ(P)) + return new_zero_ep(); + if (nvar == 0 && nparam == 0) { evalue *EP; ALLOC(EP); -- 2.11.4.GIT