[PPL-devel] [GIT] ppl/ppl(master): Improved code coverage.

Enea Zaffanella zaffanella at cs.unipr.it
Sat Feb 20 14:41:14 CET 2010


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

Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date:   Sat Feb 20 14:38:26 2010 +0100

Improved code coverage.
Removed useless (and not accessible by user) Tableau::total_memory_in_bytes().

---

 src/PIP_Tree.cc                       |    5 -----
 src/PIP_Tree.defs.hh                  |   14 ++++++++++++--
 tests/PIP_Problem/ascii_dump_load1.cc |    3 +++
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/PIP_Tree.cc b/src/PIP_Tree.cc
index ba3d1ec..7af66eb 100644
--- a/src/PIP_Tree.cc
+++ b/src/PIP_Tree.cc
@@ -2465,11 +2465,6 @@ PIP_Solution_Node::Tableau::external_memory_in_bytes() const {
 }
 
 memory_size_type
-PIP_Solution_Node::Tableau::total_memory_in_bytes() const {
-  return sizeof(*this) + external_memory_in_bytes();
-}
-
-memory_size_type
 PIP_Solution_Node::external_memory_in_bytes() const {
   memory_size_type n = PIP_Tree_Node::external_memory_in_bytes();
   n += tableau.external_memory_in_bytes();
diff --git a/src/PIP_Tree.defs.hh b/src/PIP_Tree.defs.hh
index 12b1292..5a8dfa6 100644
--- a/src/PIP_Tree.defs.hh
+++ b/src/PIP_Tree.defs.hh
@@ -452,12 +452,22 @@ private:
     //! Returns the value of the denominator.
     Coefficient_traits::const_reference denominator() const;
 
+    //! Dumps to \p s an ASCII representation of \p *this.
     void ascii_dump(std::ostream& s) const;
+
+    /*! \brief
+      Loads from \p s an ASCII representation (as produced by
+      ascii_dump(std::ostream&) const) and sets \p *this accordingly.
+      Returns \c true if successful, \c false otherwise.
+    */
     bool ascii_load(std::istream& s);
 
-    //! Returns the total size in bytes of the memory occupied by \p *this.
-    memory_size_type total_memory_in_bytes() const;
     //! Returns the size in bytes of the memory managed by \p *this.
+    /*!
+      \note
+      No need for a \c total_memory_in_bytes() method, since
+      class Tableau is a private inner class of PIP_Solution_Node.
+    */
     memory_size_type external_memory_in_bytes() const;
 
     //! Returns \c true if and only if \p *this is well formed.
diff --git a/tests/PIP_Problem/ascii_dump_load1.cc b/tests/PIP_Problem/ascii_dump_load1.cc
index 5bc8041..faa6c28 100644
--- a/tests/PIP_Problem/ascii_dump_load1.cc
+++ b/tests/PIP_Problem/ascii_dump_load1.cc
@@ -260,7 +260,10 @@ test09() {
   cs.insert(i <= n);
 
   PIP_Problem pip(cs.space_dimension(), cs.begin(), cs.end(), params);
+  // Compute the solution tree.
   (void) pip.solve();
+  // Printing ensures parametric solution values are generated.
+  pip.print_solution(nout);
 
   std::stringstream ss;
   pip.ascii_dump(ss);




More information about the PPL-devel mailing list