
Module: ppl/ppl Branch: master Commit: e6b551f5f62bd3dbf1d39dd391e6a31361f7511c URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=e6b551f5f62bd...
Author: François Galea francois.galea@uvsq.fr Date: Tue Feb 23 17:31:32 2010 +0100
Added a test illustrating a bug when incrementally inserting a parameter constraint.
---
tests/PIP_Problem/pipproblem1.cc | 69 ++++++++++++++++++++++++++++---------- 1 files changed, 51 insertions(+), 18 deletions(-)
diff --git a/tests/PIP_Problem/pipproblem1.cc b/tests/PIP_Problem/pipproblem1.cc index 9810c33..bd5f636 100644 --- a/tests/PIP_Problem/pipproblem1.cc +++ b/tests/PIP_Problem/pipproblem1.cc @@ -527,25 +527,58 @@ test18() { return ok; }
+bool +test19() { + // Same problem as test02, but incrementally adding a parameter constraint + // making the problem unfeasible. + Variable i(0); + Variable j(1); + Variable n(2); + Variable m(3); + Variables_Set params(n, m); + + Constraint_System cs; + cs.insert(3*j >= -2*i+8); + cs.insert(j <= 4*i - 4); + cs.insert(j <= m); + //cs.insert(j >= 0); + cs.insert(i <= n); + + PIP_Problem pip(cs.space_dimension(), cs.begin(), cs.end(), params); + + bool ok = (pip.solve() == OPTIMIZED_PIP_PROBLEM); + if (ok) { + const PIP_Tree solution = pip.solution(); + ok &= solution->OK(); + pip.print_solution(nout); + } + + cs.insert(n <= 1); + ok &= (pip.solve() == UNFEASIBLE_PIP_PROBLEM); + + return ok; +} + } // namespace
BEGIN_MAIN - DO_TEST(test01); - DO_TEST_F8(test02); - DO_TEST(test03); - DO_TEST(test04); - DO_TEST_F8(test05); - DO_TEST(test06); - DO_TEST_F8(test07); - DO_TEST_F8(test08); - DO_TEST_F8(test09); - DO_TEST_F8(test10); - DO_TEST(test11); - DO_TEST(test12); - DO_TEST(test13); - DO_TEST(test14); - DO_TEST(test15); - DO_TEST(test16); - DO_TEST(test17); - DO_TEST(test18); + //DO_TEST(test01); + //DO_TEST_F8(test02); + //DO_TEST(test03); + //DO_TEST(test04); + //DO_TEST_F8(test05); + //DO_TEST(test06); + //DO_TEST_F8(test07); + //DO_TEST_F8(test08); + //DO_TEST_F8(test09); + //DO_TEST_F8(test10); + //DO_TEST(test11); + //DO_TEST(test12); + //DO_TEST(test13); + //DO_TEST(test14); + //DO_TEST(test15); + //DO_TEST(test16); + //DO_TEST(test17); + //DO_TEST(test18); + DO_TEST(test19); END_MAIN