[GIT] ppl/ppl(master): Moved the compatibility_check static methods to PIP_Tree_Node.

Module: ppl/ppl Branch: master Commit: f010ef5edd820af3fb4589c75c8c9be73b2930ac URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=f010ef5edd820...
Author: François Galea francois.galea@uvsq.fr Date: Sun Mar 7 20:27:09 2010 +0100
Moved the compatibility_check static methods to PIP_Tree_Node.
---
src/PIP_Tree.cc | 4 ++-- src/PIP_Tree.defs.hh | 34 ++++++++++++++++------------------ 2 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc index 45427ae..a5a7915 100644 --- a/src/PIP_Tree.cc +++ b/src/PIP_Tree.cc @@ -1230,7 +1230,7 @@ PIP_Solution_Node::row_sign(const Row& x, }
bool -PIP_Solution_Node::compatibility_check(const Matrix& context, const Row& row) { +PIP_Tree_Node::compatibility_check(const Matrix& context, const Row& row) { // CHECKME: do `context' and `row' have compatible (row) capacity? Matrix s(context); s.add_row(row); @@ -1238,7 +1238,7 @@ PIP_Solution_Node::compatibility_check(const Matrix& context, const Row& row) { }
bool -PIP_Solution_Node::compatibility_check(Matrix& s) { +PIP_Tree_Node::compatibility_check(Matrix& s) { PPL_ASSERT(s.OK()); // Note: num_rows may increase. dimension_type num_rows = s.num_rows(); diff --git a/src/PIP_Tree.defs.hh b/src/PIP_Tree.defs.hh index ef6e23a..ada4280 100644 --- a/src/PIP_Tree.defs.hh +++ b/src/PIP_Tree.defs.hh @@ -238,6 +238,22 @@ protected: static void indent_and_print(std::ostream& s, unsigned indent, const char* str);
+ /*! \brief + Checks whether a context matrix is satisfiable. + + The satisfiability check is implemented by the revised dual simplex + algorithm on the context matrix. The algorithm ensures the feasible + solution is integer by applying a cut generation method when + intermediate non-integer solutions are found. + */ + static bool compatibility_check(Matrix& s); + + /*! \brief + Helper method: checks for satisfiability of the restricted context + obtained by adding \p row to \p context. + */ + static bool compatibility_check(const Matrix& context, const Row& row); + }; // class PIP_Tree_Node
@@ -571,22 +587,6 @@ private: //! Returns the sign of row \p x. static Row_Sign row_sign(const Row& x, dimension_type big_dimension);
- /*! \brief - Checks whether a context matrix is satisfiable. - - The satisfiability check is implemented by the revised dual simplex - algorithm on the context matrix. The algorithm ensures the feasible - solution is integer by applying a cut generation method when - intermediate non-integer solutions are found. - */ - static bool compatibility_check(Matrix& s); - - /*! \brief - Helper method: checks for satisfiability of the restricted context - obtained by adding \p row to \p context. - */ - static bool compatibility_check(const Matrix& context, const Row& row); - protected: //! Copy constructor. PIP_Solution_Node(const PIP_Solution_Node& y); @@ -603,8 +603,6 @@ protected:
// PIP_Problem::ascii load() method needs access set_owner(). friend bool PIP_Problem::ascii_load(std::istream& s); - // PIP_Problem::solve() method needs access compatibility_check(). - friend PIP_Problem_Status PIP_Problem::solve() const;
//! Sets the pointer to the PIP_Problem owning object. virtual void set_owner(const PIP_Problem* owner);
participants (1)
-
François Galea