[PPL-devel] [GIT] ppl/ppl(pip): Added comments and more infrastructure.
Roberto Bagnara
bagnara at cs.unipr.it
Sun Jun 14 21:17:51 CEST 2009
Module: ppl/ppl
Branch: pip
Commit: 298c26af185d60c224e6feed493863aeadd10eca
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=298c26af185d60c224e6feed493863aeadd10eca
Author: Roberto Bagnara <bagnara at cs.unipr.it>
Date: Sun Jun 14 21:16:52 2009 +0200
Added comments and more infrastructure.
---
src/Makefile.am | 7 ++++++-
src/PIP_Problem.cc | 32 ++++++++++++++++++++++++++++++++
src/PIP_Problem.defs.hh | 4 ++--
src/PIP_Tree.cc | 9 ++++++++-
src/PIP_Tree.defs.hh | 30 +++++++++++++++++++++++++-----
src/PIP_Tree.types.hh | 23 +++++++++++++++++++++++
6 files changed, 96 insertions(+), 9 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 5849079..28ff582 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -152,7 +152,8 @@ Generator_System.types.hh \
Grid_Generator_System.types.hh \
Congruence_System.types.hh \
Scalar_Products.types.hh \
-MIP_Problem.types.hh \
+PIP_Tree.types.hh \
+PIP_Problem.types.hh \
Poly_Con_Relation.types.hh \
Poly_Gen_Relation.types.hh \
BHRZ03_Certificate.types.hh \
@@ -270,6 +271,8 @@ Scalar_Products.inlines.hh \
MIP_Problem.defs.hh \
MIP_Problem.inlines.hh \
MIP_Problem.templates.hh \
+PIP_Tree.defs.hh \
+PIP_Problem.defs.hh \
Poly_Con_Relation.defs.hh \
Poly_Con_Relation.inlines.hh \
Poly_Gen_Relation.defs.hh \
@@ -375,6 +378,8 @@ Linear_System.cc \
Matrix.cc \
Scalar_Products.cc \
MIP_Problem.cc \
+PIP_Tree.cc \
+PIP_Problem.cc \
Poly_Con_Relation.cc \
Poly_Gen_Relation.cc \
BHRZ03_Certificate.cc \
diff --git a/src/PIP_Problem.cc b/src/PIP_Problem.cc
new file mode 100644
index 0000000..069f179
--- /dev/null
+++ b/src/PIP_Problem.cc
@@ -0,0 +1,32 @@
+/* PIP_Problem class implementation: non-inline functions.
+ Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
+
+This file is part of the Parma Polyhedra Library (PPL).
+
+The PPL is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The PPL is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
+
+For the most up-to-date information see the Parma Polyhedra Library
+site: http://www.cs.unipr.it/ppl/ . */
+
+#include <ppl-config.h>
+#include "PIP_Problem.defs.hh"
+
+namespace PPL = Parma_Polyhedra_Library;
+
+/*! \relates Parma_Polyhedra_Library::PIP_Problem */
+std::ostream&
+PPL::IO_Operators::operator<<(std::ostream& s, const PIP_Problem& /*p*/) {
+ return s;
+}
diff --git a/src/PIP_Problem.defs.hh b/src/PIP_Problem.defs.hh
index 63ba1d4..ecd34f2 100644
--- a/src/PIP_Problem.defs.hh
+++ b/src/PIP_Problem.defs.hh
@@ -334,7 +334,7 @@ void swap(Parma_Polyhedra_Library::PIP_Problem& x,
} // namespace std
-#include "PIP_Problem.inlines.hh"
-#include "PIP_Problem.templates.hh"
+//#include "PIP_Problem.inlines.hh"
+//#include "PIP_Problem.templates.hh"
#endif // !defined(PPL_PIP_Problem_defs_hh)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc
index cf6d9ae..aaecb31 100644
--- a/src/PIP_Tree.cc
+++ b/src/PIP_Tree.cc
@@ -21,7 +21,7 @@ For the most up-to-date information see the Parma Polyhedra Library
site: http://www.cs.unipr.it/ppl/ . */
#include <ppl-config.h>
-#include <PIP_Tree.defs.hh>
+#include "PIP_Tree.defs.hh"
namespace Parma_Polyhedra_Library {
@@ -34,30 +34,37 @@ const PIP_Solution_Node*
PIP_Tree_Node::as_solution() const {
return 0;
}
+
PIP_Solution_Node*
PIP_Tree_Node::as_solution() {
return 0;
}
+
const PIP_Decision_Node*
PIP_Tree_Node::as_decision() const {
return 0;
}
+
PIP_Decision_Node*
PIP_Tree_Node::as_decision() {
return 0;
}
+
const PIP_Solution_Node*
PIP_Solution_Node::as_solution() const {
return this;
}
+
PIP_Solution_Node*
PIP_Solution_Node::as_solution() {
return this;
}
+
const PIP_Decision_Node*
PIP_Decision_Node::as_decision() const {
return this;
}
+
PIP_Decision_Node*
PIP_Decision_Node::as_decision() {
return this;
diff --git a/src/PIP_Tree.defs.hh b/src/PIP_Tree.defs.hh
index f9b1cc6..20847bd 100644
--- a/src/PIP_Tree.defs.hh
+++ b/src/PIP_Tree.defs.hh
@@ -23,30 +23,46 @@ site: http://www.cs.unipr.it/ppl/ . */
#ifndef PPL_PIP_Tree_defs_hh
#define PPL_PIP_Tree_defs_hh 1
-namespace Parma_Polyhedra_Library {
+#include "PIP_Tree.types.hh"
-class PIP_Solution_Node;
-class PIP_Decision_Node;
+namespace Parma_Polyhedra_Library {
+/*! \brief
+ The base class for the nodes of the trees representing the solutions
+ of PIP problems.
+*/
class PIP_Tree_Node {
public:
+ //! Returns \p this if \p *this is a solution node, 0 otherwise.
virtual const PIP_Solution_Node* as_solution() const;
+
+ //! Returns \p this if \p *this is a solution node, 0 otherwise.
virtual PIP_Solution_Node* as_solution();
+
+ //! Returns \p this if \p *this is a decision node, 0 otherwise.
virtual const PIP_Decision_Node* as_decision() const;
+
+ //! Returns \p this if \p *this is a decision node, 0 otherwise.
virtual PIP_Decision_Node* as_decision();
+
+ //! Destructor.
virtual ~PIP_Tree_Node();
};
+//! A tree node representing part of the space of solutions.
class PIP_Solution_Node : public PIP_Tree_Node {
public:
+ //! Returns \p *this.
const PIP_Solution_Node* as_solution() const;
+
+ //! Returns \p *this.
PIP_Solution_Node* as_solution();
+
// get_bindings();
};
+//! A tree node representing a decision in the space of solutions.
class PIP_Decision_Node : public PIP_Tree_Node {
- PIP_Tree_Node* if_false;
- PIP_Tree_Node* if_true;
public:
~PIP_Decision_Node();
const PIP_Decision_Node* as_decision() const;
@@ -54,6 +70,10 @@ public:
const PIP_Tree_Node* if_node(bool v) const;
PIP_Tree_Node* if_node(bool v);
// Constraint_System* get_constraints();
+
+private:
+ PIP_Tree_Node* if_false;
+ PIP_Tree_Node* if_true;
};
typedef PIP_Tree_Node* PIP_Tree;
diff --git a/src/PIP_Tree.types.hh b/src/PIP_Tree.types.hh
new file mode 100644
index 0000000..d21cf1b
--- /dev/null
+++ b/src/PIP_Tree.types.hh
@@ -0,0 +1,23 @@
+/* Copyright (C) 2001-2009 Roberto Bagnara <bagnara at cs.unipr.it>
+
+This file is free software; as a special exception the author gives
+unlimited permission to copy and/or distribute it, with or without
+modifications, as long as this notice is preserved.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+PURPOSE. */
+
+#ifndef PPL_PIP_Tree_types_hh
+#define PPL_PIP_Tree_types_hh 1
+
+namespace Parma_Polyhedra_Library {
+
+class PIP_Solution_Node;
+class PIP_Decision_Node;
+class PIP_Tree_Node;
+
+} // namespace Parma_Polyhedra_Library
+
+#endif // !defined(PPL_PIP_Tree_types_hh)
More information about the PPL-devel
mailing list