[PPL-devel] [GIT] ppl/ppl(master): Added a test generating a solution node with two context constraints.

François Galea francois.galea at uvsq.fr
Sat Mar 20 11:43:47 CET 2010


Module: ppl/ppl
Branch: master
Commit: ca9a894625c3c0251d4b429ffbfe1c5c07846321
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=ca9a894625c3c0251d4b429ffbfe1c5c07846321

Author: François Galea <francois.galea at uvsq.fr>
Date:   Sat Mar 20 11:41:44 2010 +0100

Added a test generating a solution node with two context constraints.

---

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

diff --git a/tests/PIP_Problem/pipproblem1.cc b/tests/PIP_Problem/pipproblem1.cc
index 438663e..fc35a16 100644
--- a/tests/PIP_Problem/pipproblem1.cc
+++ b/tests/PIP_Problem/pipproblem1.cc
@@ -755,6 +755,31 @@ test25() {
   return ok;
 }
 
+bool
+test26() {
+  // Problem generating a solution node with two context constraints.
+  Variable x(0);
+  Variable y(1);
+  Variable p(2);
+  Variable q(3);
+  Variables_Set params(p, q);
+
+  Constraint_System cs;
+  cs.insert(x + p <= 2);
+  cs.insert(y + q <= 1);
+
+  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);
+  }
+
+  return ok;
+}
+
 } // namespace
 
 BEGIN_MAIN
@@ -783,4 +808,5 @@ BEGIN_MAIN
   DO_TEST_F8(test23);
   DO_TEST(test24);
   DO_TEST(test25);
+  DO_TEST(test26);
 END_MAIN




More information about the PPL-devel mailing list