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

Roberto Bagnara bagnara at cs.unipr.it
Thu Sep 24 20:48:45 CEST 2009


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

Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date:   Thu Sep 24 20:46:04 2009 +0200

Added test02().

---

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

diff --git a/tests/PIP_Problem/pipproblem.cc b/tests/PIP_Problem/pipproblem.cc
index 6050cd0..5d0f563 100644
--- a/tests/PIP_Problem/pipproblem.cc
+++ b/tests/PIP_Problem/pipproblem.cc
@@ -91,8 +91,35 @@ test01() {
   return ok;
 }
 
+bool
+test02() {
+  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();
+    display_solution(solution, Variables_Set(i, j));
+  }
+
+  return ok;
+}
+
 } // namespace
 
 BEGIN_MAIN
   DO_TEST(test01);
+  DO_TEST(test02);
 END_MAIN




More information about the PPL-devel mailing list