
Module: ppl/ppl Branch: pip Commit: d9871d90f57430a5a934d3aeba752513755aa9a1 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=d9871d90f5743...
Author: Roberto Bagnara bagnara@cs.unipr.it Date: Sun Jun 14 21:25:06 2009 +0200
More comments added. Some fields renamed.
---
src/PIP_Tree.cc | 7 +++++-- src/PIP_Tree.defs.hh | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc index aaecb31..ebd1042 100644 --- a/src/PIP_Tree.cc +++ b/src/PIP_Tree.cc @@ -25,9 +25,12 @@ site: http://www.cs.unipr.it/ppl/ . */
namespace Parma_Polyhedra_Library {
+PIP_Tree_Node::~PIP_Tree_Node() { +} + PIP_Decision_Node::~PIP_Decision_Node() { - delete if_false; - delete if_true; + delete false_child; + delete true_child; }
const PIP_Solution_Node* diff --git a/src/PIP_Tree.defs.hh b/src/PIP_Tree.defs.hh index 20847bd..b74d0ea 100644 --- a/src/PIP_Tree.defs.hh +++ b/src/PIP_Tree.defs.hh @@ -52,10 +52,13 @@ public: //! A tree node representing part of the space of solutions. class PIP_Solution_Node : public PIP_Tree_Node { public: - //! Returns \p *this. + //! Destructor. + ~PIP_Solution_Node(); + + //! Returns \p this. const PIP_Solution_Node* as_solution() const;
- //! Returns \p *this. + //! Returns \p this. PIP_Solution_Node* as_solution();
// get_bindings(); @@ -64,16 +67,26 @@ public: //! A tree node representing a decision in the space of solutions. class PIP_Decision_Node : public PIP_Tree_Node { public: + //! Destructor. ~PIP_Decision_Node(); + + //! Returns \p this. const PIP_Decision_Node* as_decision() const; + + //! Returns \p this. PIP_Decision_Node* as_decision(); - const PIP_Tree_Node* if_node(bool v) const; - PIP_Tree_Node* if_node(bool v); + + //! Returns a const pointer to the \v (true or false) branch of \p *this. + const PIP_Tree_Node* child_node(bool v) const; + + //! Returns a pointer to the \v (true or false) branch of \p *this. + PIP_Tree_Node* child_node(bool v); + // Constraint_System* get_constraints();
private: - PIP_Tree_Node* if_false; - PIP_Tree_Node* if_true; + PIP_Tree_Node* false_child; + PIP_Tree_Node* true_child; };
typedef PIP_Tree_Node* PIP_Tree;