# [PPL-devel] [GIT] ppl/ppl(termination): Added one more test for incremental solving.

FranÃ§ois Galea francois.galea at uvsq.fr
Mon Mar 8 10:44:16 CET 2010

```Module: ppl/ppl
Branch: termination

Author: François Galea <francois.galea at uvsq.fr>
Date:   Sun Mar  7 20:25:00 2010 +0100

Added one more test for incremental solving.

---

tests/PIP_Problem/pipproblem1.cc |   37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/tests/PIP_Problem/pipproblem1.cc b/tests/PIP_Problem/pipproblem1.cc
index 4c7568b..e361a7b 100644
--- a/tests/PIP_Problem/pipproblem1.cc
+++ b/tests/PIP_Problem/pipproblem1.cc
@@ -666,6 +666,42 @@ test22() {
return ok;
}

+bool
+test23() {
+  // Same problem as test02, but incrementally adding a parameter constraint
+  // removing one level in the decision tree.
+  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(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);
+  }
+
+  ok &= (pip.solve() == OPTIMIZED_PIP_PROBLEM);
+  if (ok) {
+    const PIP_Tree solution = pip.solution();
+    ok &= solution->OK();
+    pip.print_solution(nout);
+  }
+
+  return ok;
+}
+
} // namespace

BEGIN_MAIN
@@ -691,4 +727,5 @@ BEGIN_MAIN
DO_TEST_F8(test20);
DO_TEST_F8(test21);
DO_TEST_F8(test22);
+  DO_TEST_F8(test23);
END_MAIN

```