[PPL-devel] [GIT] ppl/ppl(sparse_matrices): Restored public accessibility of several OK () methods.
Enea Zaffanella
zaffanella at cs.unipr.it
Sun Dec 11 23:43:54 CET 2011
Module: ppl/ppl
Branch: sparse_matrices
Commit: c966621b36a3909b5da4b8d79eca90485fd752c9
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=c966621b36a3909b5da4b8d79eca90485fd752c9
Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date: Sun Dec 11 21:58:55 2011 +0100
Restored public accessibility of several OK() methods.
---
src/Congruence.cc | 2 +-
src/Congruence.defs.hh | 6 +++---
src/Constraint.defs.hh | 6 +++---
src/Constraint_System.defs.hh | 6 +++---
src/Generator.defs.hh | 6 +++---
src/Generator_System.defs.hh | 7 +++----
src/Grid_Generator.defs.hh | 6 +++---
src/Grid_Generator_System.defs.hh | 7 +++----
src/Linear_Expression.cc | 5 +++++
src/Linear_Expression.defs.hh | 3 +++
src/Linear_Expression_Impl.defs.hh | 8 ++++----
src/Linear_Expression_Impl.templates.hh | 6 ++++++
src/Linear_Expression_Interface.cc | 3 ---
src/Linear_Expression_Interface.defs.hh | 2 ++
14 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/src/Congruence.cc b/src/Congruence.cc
index 9282028..d17dae4 100644
--- a/src/Congruence.cc
+++ b/src/Congruence.cc
@@ -217,7 +217,7 @@ PPL_OUTPUT_DEFINITIONS(Congruence)
bool
PPL::Congruence::ascii_load(std::istream& s) {
expr.ascii_load(s);
-
+
std::string str;
if (!(s >> str) || str != "m")
return false;
diff --git a/src/Congruence.defs.hh b/src/Congruence.defs.hh
index 92b85af..f2276a0 100644
--- a/src/Congruence.defs.hh
+++ b/src/Congruence.defs.hh
@@ -326,6 +326,9 @@ public:
//! Returns the size in bytes of the memory managed by \p *this.
memory_size_type external_memory_in_bytes() const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -337,9 +340,6 @@ public:
//! Swaps \p *this with \p y.
void m_swap(Congruence& y);
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
//! Copy-constructs with the specified space dimension.
/*!
\note The new Congruence will have the same representation as `cg',
diff --git a/src/Constraint.defs.hh b/src/Constraint.defs.hh
index 38cf961..fd82d23 100644
--- a/src/Constraint.defs.hh
+++ b/src/Constraint.defs.hh
@@ -493,6 +493,9 @@ public:
*/
bool is_equal_to(const Constraint& y) const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -724,9 +727,6 @@ private:
*/
bool check_strong_normalized() const;
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
/*! \brief
Builds a new copy of the zero-dimension space constraint
\f$\epsilon \geq 0\f$ (used to implement NNC polyhedra).
diff --git a/src/Constraint_System.defs.hh b/src/Constraint_System.defs.hh
index f1157c7..71f58e9 100644
--- a/src/Constraint_System.defs.hh
+++ b/src/Constraint_System.defs.hh
@@ -231,6 +231,9 @@ public:
//! Returns the past-the-end const_iterator.
const_iterator end() const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -582,9 +585,6 @@ private:
*/
void add_universe_rows_and_space_dimensions(dimension_type n);
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
friend class Polyhedron;
friend class Termination_Helpers;
};
diff --git a/src/Generator.defs.hh b/src/Generator.defs.hh
index f1c0307..b43143d 100644
--- a/src/Generator.defs.hh
+++ b/src/Generator.defs.hh
@@ -511,6 +511,9 @@ public:
*/
bool is_equal_to(const Generator& y) const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -724,9 +727,6 @@ private:
//! This is used by operator<<();
void fancy_print(std::ostream& s) const;
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
friend class Linear_System<Generator>;
friend class Parma_Polyhedra_Library::Scalar_Products;
friend class Parma_Polyhedra_Library::Topology_Adjusted_Scalar_Product_Sign;
diff --git a/src/Generator_System.defs.hh b/src/Generator_System.defs.hh
index 9217eb7..da1bb12 100644
--- a/src/Generator_System.defs.hh
+++ b/src/Generator_System.defs.hh
@@ -269,6 +269,9 @@ public:
//! Returns the past-the-end const_iterator.
const_iterator end() const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -650,10 +653,6 @@ private:
friend bool
operator==(const Generator_System& x, const Generator_System& y);
- // FIXME: This is useless: it always returns true.
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
friend class Polyhedron;
};
diff --git a/src/Grid_Generator.defs.hh b/src/Grid_Generator.defs.hh
index 67b56c8..445a2b2 100644
--- a/src/Grid_Generator.defs.hh
+++ b/src/Grid_Generator.defs.hh
@@ -498,6 +498,9 @@ public:
*/
bool all_homogeneous_terms_are_zero() const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -507,9 +510,6 @@ public:
*/
bool ascii_load(std::istream& s);
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
//! Swaps \p *this with \p y.
void m_swap(Grid_Generator& y);
diff --git a/src/Grid_Generator_System.defs.hh b/src/Grid_Generator_System.defs.hh
index c07272e..2d4eb3b 100644
--- a/src/Grid_Generator_System.defs.hh
+++ b/src/Grid_Generator_System.defs.hh
@@ -357,6 +357,9 @@ public:
//! Returns <CODE>true</CODE> if \p *this is identical to \p y.
bool is_equal_to(const Grid_Generator_System& y) const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
@@ -502,10 +505,6 @@ private:
*/
void remove_invalid_lines_and_parameters();
- // FIXME: This is useless: it always returns true.
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
friend class Polyhedron;
friend class Grid;
};
diff --git a/src/Linear_Expression.cc b/src/Linear_Expression.cc
index 78b55c8..c0446de 100644
--- a/src/Linear_Expression.cc
+++ b/src/Linear_Expression.cc
@@ -281,3 +281,8 @@ PPL::Linear_Expression::set_representation(Representation r) {
}
PPL_OUTPUT_DEFINITIONS(Linear_Expression)
+
+bool
+PPL::Linear_Expression::OK() const {
+ return impl->OK();
+}
diff --git a/src/Linear_Expression.defs.hh b/src/Linear_Expression.defs.hh
index a054f56..ce3f914 100644
--- a/src/Linear_Expression.defs.hh
+++ b/src/Linear_Expression.defs.hh
@@ -700,6 +700,9 @@ public:
//! Returns the size in bytes of the memory managed by \p *this.
memory_size_type external_memory_in_bytes() const;
+ //! Checks if all the invariants are satisfied.
+ bool OK() const;
+
PPL_OUTPUT_DECLARATIONS
/*! \brief
diff --git a/src/Linear_Expression_Impl.defs.hh b/src/Linear_Expression_Impl.defs.hh
index 4b49074..aad5e64 100644
--- a/src/Linear_Expression_Impl.defs.hh
+++ b/src/Linear_Expression_Impl.defs.hh
@@ -107,10 +107,13 @@ public:
//! Copy constructor from any implementation of Linear_Expression_Interface.
Linear_Expression_Impl(const Linear_Expression_Interface& e);
-
+
//! Destructor.
virtual ~Linear_Expression_Impl();
+ //! Checks if all the invariants are satisfied.
+ virtual bool OK() const;
+
/*! \brief
Builds the linear expression corresponding
to the inhomogeneous term \p n.
@@ -562,9 +565,6 @@ public:
*/
Linear_Expression_Impl(const Congruence& cg, dimension_type space_dim);
- //! Checks if all the invariants are satisfied.
- bool OK() const;
-
//! Linearly combines \p *this with \p y so that the coefficient of \p v
//! is 0.
/*!
diff --git a/src/Linear_Expression_Impl.templates.hh b/src/Linear_Expression_Impl.templates.hh
index 0e0462b..8f66bde 100644
--- a/src/Linear_Expression_Impl.templates.hh
+++ b/src/Linear_Expression_Impl.templates.hh
@@ -1249,6 +1249,12 @@ Linear_Expression_Impl<Row>::ascii_load(std::istream& s) {
return true;
}
+template <typename Row>
+bool
+Linear_Expression_Impl<Row>::OK() const {
+ return row.OK();
+}
+
} // namespace Parma_Polyhedra_Library
#endif // !defined(PPL_Linear_Expression_Impl_templates_hh)
diff --git a/src/Linear_Expression_Interface.cc b/src/Linear_Expression_Interface.cc
index 0b62a87..f5dcee4 100644
--- a/src/Linear_Expression_Interface.cc
+++ b/src/Linear_Expression_Interface.cc
@@ -21,7 +21,6 @@ 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://bugseng.com/products/ppl/ . */
-
#include "ppl-config.h"
#include "Linear_Expression_Interface.defs.hh"
@@ -29,10 +28,8 @@ site: http://bugseng.com/products/ppl/ . */
namespace PPL = Parma_Polyhedra_Library;
PPL::Linear_Expression_Interface::~Linear_Expression_Interface() {
-
}
PPL::Linear_Expression_Interface::const_iterator_interface
::~const_iterator_interface() {
-
}
diff --git a/src/Linear_Expression_Interface.defs.hh b/src/Linear_Expression_Interface.defs.hh
index c83ee8f..4454d01 100644
--- a/src/Linear_Expression_Interface.defs.hh
+++ b/src/Linear_Expression_Interface.defs.hh
@@ -49,6 +49,8 @@ class Parma_Polyhedra_Library::Linear_Expression_Interface {
public:
virtual ~Linear_Expression_Interface();
+ virtual bool OK() const = 0;
+
//! Returns the current representation of this linear expression.
virtual Representation representation() const = 0;
More information about the PPL-devel
mailing list