[GIT] ppl/ppl(devel): New test07() shows a bug in the filtering of minimized NNC generators.

Module: ppl/ppl Branch: devel Commit: 0ea33aae911bf0fe56896b6579cd30118459e686 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=0ea33aae911bf...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Thu Aug 3 14:44:46 2017 +0200
New test07() shows a bug in the filtering of minimized NNC generators.
The bug should only affect output operations; it is not going to affect the result of methods such as NNC_Polyhedron::is_topologically_closed().
The bug has been discovered while working on an alternative representation and implementation for NNC polyhedra, requiring no epsilon dimension. The conversion algorithm for this new representation will be described in the undergraduate thesis of Anna Becchi (work in progress).
---
tests/Polyhedron/nncminimize1.cc | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/tests/Polyhedron/nncminimize1.cc b/tests/Polyhedron/nncminimize1.cc index 7f22ed3..a8325b6 100644 --- a/tests/Polyhedron/nncminimize1.cc +++ b/tests/Polyhedron/nncminimize1.cc @@ -368,6 +368,33 @@ test06() { return ok; }
+bool +test07() { + Variable A(0); + Variable B(1); + + Generator_System gs; + gs.insert(closure_point(A + 2*B)); + gs.insert(closure_point(A + 2*B, 2)); + gs.insert(point(A + 2*B)); + gs.insert(point(A + 2*B, 2)); + + NNC_Polyhedron ph(gs); + + nout << endl << "Before NNC minimization:" << endl; + print_constraints(ph.constraints(), "*** ph constraints ***"); + print_generators(ph.generators(), "*** ph generators ***"); + + const Generator_System& min_gs = ph.minimized_generators(); + bool ok = (2 == std::distance(min_gs.begin(), min_gs.end())); + + nout << endl << "After NNC minimization:" << endl; + print_constraints(ph.constraints(), "*** ph constraints ***"); + print_generators(ph.generators(), "*** ph generators ***"); + + return ok; +} + } // namespace
BEGIN_MAIN @@ -377,4 +404,5 @@ BEGIN_MAIN DO_TEST_F8(test04); DO_TEST(test05); DO_TEST(test06); + DO_TEST(test07); END_MAIN
participants (1)
-
Enea Zaffanella