[PPL-devel] [GIT] ppl/ppl(pip): Added test problem.

François Galea francois.galea at uvsq.fr
Mon Oct 5 09:15:34 CEST 2009


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

Author: François Galea <francois.galea at uvsq.fr>
Date:   Sun Oct  4 12:09:57 2009 +0200

Added test problem.

---

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

diff --git a/tests/PIP_Problem/pipproblem1.cc b/tests/PIP_Problem/pipproblem1.cc
index 5169f0f..b29f062 100644
--- a/tests/PIP_Problem/pipproblem1.cc
+++ b/tests/PIP_Problem/pipproblem1.cc
@@ -114,6 +114,28 @@ test02() {
   if (ok) {
     const PIP_Tree solution = pip.solution();
     display_solution(solution, Variables_Set(i, j));
+
+bool
+test03() {
+  Variable i(0);
+  Variable j(1);
+  Variable k(2);
+  Variable m(3);
+  Variable n(4);
+  Variables_Set params(k, n);
+
+  Constraint_System cs;
+  cs.insert(i <= m);
+  cs.insert(j <= n);
+  cs.insert(2*i+j <= 2*m+n-k);
+  cs.insert(2*i+j >= 2*m+n-k);
+
+  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();
+    display_solution(solution, params, Variables_Set(i, j));
   }
 
   return ok;
@@ -124,4 +146,5 @@ test02() {
 BEGIN_MAIN
   DO_TEST(test01);
   DO_TEST(test02);
+  DO_TEST(test03);
 END_MAIN




More information about the PPL-devel mailing list