[PPL-devel] [GIT] ppl/ppl(pip): Implemented missing methods.
François Galea
francois.galea at uvsq.fr
Thu Oct 8 07:28:27 CEST 2009
Module: ppl/ppl
Branch: pip
Commit: abd54a672679643b404fd3019528e2d9382d6873
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=abd54a672679643b404fd3019528e2d9382d6873
Author: François Galea <francois.galea at uvsq.fr>
Date: Wed Oct 7 20:44:37 2009 +0200
Implemented missing methods.
---
src/PIP_Problem.cc | 28 ++++++++++++++++++++++++++++
src/PIP_Tree.cc | 1 -
2 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/src/PIP_Problem.cc b/src/PIP_Problem.cc
index 7042940..d8bdd2c 100644
--- a/src/PIP_Problem.cc
+++ b/src/PIP_Problem.cc
@@ -323,3 +323,31 @@ PPL::PIP_Problem
status = PARTIALLY_SATISFIABLE;
PPL_ASSERT(OK());
}
+
+void
+PPL::PIP_Problem::add_constraint(const Constraint& c) {
+ if (c.space_dimension() > external_space_dim) {
+ std::ostringstream s;
+ s << "PPL::PIP_Problem::add_constraint(c):\n"
+ << "dim == "<< external_space_dim << " and c.space_dimension() =="
+ << " " << c.space_dimension() << " are dimension"
+ "incompatible.";
+ throw std::invalid_argument(s.str());
+ }
+
+ // Check the constraint.
+ if (c.is_strict_inequality())
+ throw std::invalid_argument("PPL::PIP_Problem::add_constraint(c):\n"
+ "constraint c is"
+ "a strict inequality constraint.");
+ input_cs.push_back(c);
+}
+
+void
+PPL::PIP_Problem::add_constraints(const Constraint_System &cs) {
+ Constraint_System::const_iterator c;
+ Constraint_System::const_iterator end = cs.end();
+ for (c=cs.begin(); c!=end; ++c)
+ add_constraint(*c);
+}
+
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc
index 5e6bcd1..b4c208e 100644
--- a/src/PIP_Tree.cc
+++ b/src/PIP_Tree.cc
@@ -22,7 +22,6 @@ site: http://www.cs.unipr.it/ppl/ . */
#include <ppl-config.h>
#include "PIP_Tree.defs.hh"
-#include "PIP_Problem.defs.hh"
#include <algorithm>
More information about the PPL-devel
mailing list