[PPL-devel] [GIT] ppl/ppl(master): Drafted implementation for PIP_Problem's operator<<.

Enea Zaffanella zaffanella at cs.unipr.it
Wed Feb 17 14:51:36 CET 2010


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Wed Feb 17 14:50:11 2010 +0100

Drafted implementation for PIP_Problem's operator<<.

---

 src/MIP_Problem.cc |    2 +-
 src/PIP_Problem.cc |   18 +++++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/MIP_Problem.cc b/src/MIP_Problem.cc
index 9c05c72..d5a6562 100644
--- a/src/MIP_Problem.cc
+++ b/src/MIP_Problem.cc
@@ -2245,5 +2245,5 @@ PPL::IO_Operators::operator<<(std::ostream& s, const MIP_Problem& lp) {
 	? "MAXIMIZATION"
 	: "MINIMIZATION");
   s << "\nInteger variables: " << lp.integer_space_dimensions();
- return s;
+  return s;
 }
diff --git a/src/PIP_Problem.cc b/src/PIP_Problem.cc
index bdefa78..f24043f 100644
--- a/src/PIP_Problem.cc
+++ b/src/PIP_Problem.cc
@@ -28,8 +28,18 @@ namespace PPL = Parma_Polyhedra_Library;
 
 /*! \relates Parma_Polyhedra_Library::PIP_Problem */
 std::ostream&
-PPL::IO_Operators::operator<<(std::ostream& s, const PIP_Problem& /*p*/) {
-  // FIXME: to be implemented.
+PPL::IO_Operators::operator<<(std::ostream& s, const PIP_Problem& pip) {
+  s << "Space dimension: " << pip.space_dimension();
+  s << "\nConstraints:";
+  for (PIP_Problem::const_iterator i = pip.constraints_begin(),
+	 i_end = pip.constraints_end(); i != i_end; ++i)
+    s << "\n" << *i;
+  s << "\nProblem parameters: " << pip.parameter_space_dimensions();
+  if (pip.get_big_parameter_dimension() == not_a_dimension())
+    s << "\nNo big-parameter set.\n";
+  else
+    s << "\bBig-parameter: " << Variable(pip.get_big_parameter_dimension());
+  s << "\n";
   return s;
 }
 
@@ -265,9 +275,7 @@ PPL::PIP_Problem::OK() const {
   if (big_parameter_dimension != not_a_dimension()
       && parameters.count(big_parameter_dimension) == 0) {
 #ifndef NDEBUG
-    cerr << "The current value for the big parameter is not a parameter "
-         << "dimension."
-	 << endl;
+    cerr << "The big parameter is set, but it is not a parameter." << endl;
     ascii_dump(cerr);
 #endif
     return false;




More information about the PPL-devel mailing list