From dd7489581f30d8fa3ffd548cbf4f3bad4f952c4a Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 29 Apr 2009 19:21:26 +0100 Subject: [PATCH] barvinok_enumerate_series: don't check for revlex positive rays on recursive call remove_all_equalities may have destroyed that property and we would only check the property again if some extra equalities were discovered during the computation of the vertices. --- series.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/series.cc b/series.cc index e1c8aac..4ebf160 100644 --- a/series.cc +++ b/series.cc @@ -24,7 +24,7 @@ static bool Polyhedron_has_positive_rays(Polyhedron *P, unsigned nparam) return true; } -gen_fun *barvinok_enumerate_series(Polyhedron *P, unsigned nparam, +static gen_fun *enumerate_series(Polyhedron *P, unsigned nparam, barvinok_options *options) { Matrix *CP = NULL; @@ -34,9 +34,6 @@ gen_fun *barvinok_enumerate_series(Polyhedron *P, unsigned nparam, if (emptyQ2(P)) return new gen_fun(Empty_Polyhedron(nparam)); - assert(!Polyhedron_is_unbounded(P, nparam, options->MaxRays)); - assert(P->NbBid == 0); - assert(Polyhedron_has_revlex_positive_rays(P, nparam)); if (P->NbEq != 0) remove_all_equalities(&P, NULL, &CP, NULL, nparam, options->MaxRays); assert(emptyQ2(P) || P->NbEq == 0); @@ -52,7 +49,7 @@ gen_fun *barvinok_enumerate_series(Polyhedron *P, unsigned nparam, } else { POL_ENSURE_VERTICES(P); if (P->NbEq) - gf = barvinok_enumerate_series(P, nparam, options); + gf = enumerate_series(P, nparam, options); else { gf_base *red; red = gf_base::create(Polyhedron_Project(P, nparam), @@ -71,6 +68,18 @@ gen_fun *barvinok_enumerate_series(Polyhedron *P, unsigned nparam, return gf; } +gen_fun *barvinok_enumerate_series(Polyhedron *P, unsigned nparam, + barvinok_options *options) +{ + if (emptyQ2(P)) + return new gen_fun(Empty_Polyhedron(nparam)); + + assert(!Polyhedron_is_unbounded(P, nparam, options->MaxRays)); + assert(P->NbBid == 0); + assert(Polyhedron_has_revlex_positive_rays(P, nparam)); + return enumerate_series(P, nparam, options); +} + gen_fun * barvinok_series_with_options(Polyhedron *P, Polyhedron* C, barvinok_options *options) { -- 2.11.4.GIT