[Lemon-commits] Peter Kovacs: Test file + doc improvements (#307)

Lemon HG hg at lemon.cs.elte.hu
Mon Aug 31 07:18:50 CEST 2009


details:   http://lemon.cs.elte.hu/hg/lemon/rev/86c49553fea5
changeset: 742:86c49553fea5
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Tue Aug 18 10:35:35 2009 +0200
description:
	Test file + doc improvements (#307)

diffstat:

 lemon/circulation.h      |   8 +++++---
 lemon/preflow.h          |  10 ++++++----
 test/circulation_test.cc |   5 +++++
 test/preflow_test.cc     |   5 +++++
 4 files changed, 21 insertions(+), 7 deletions(-)

diffs (91 lines):

diff --git a/lemon/circulation.h b/lemon/circulation.h
--- a/lemon/circulation.h
+++ b/lemon/circulation.h
@@ -450,9 +450,10 @@
       return *_level;
     }
 
-    /// \brief Sets the tolerance used by algorithm.
+    /// \brief Sets the tolerance used by the algorithm.
     ///
-    /// Sets the tolerance used by algorithm.
+    /// Sets the tolerance object used by the algorithm.
+    /// \return <tt>(*this)</tt>
     Circulation& tolerance(const Tolerance& tolerance) {
       _tol = tolerance;
       return *this;
@@ -460,7 +461,8 @@
 
     /// \brief Returns a const reference to the tolerance.
     ///
-    /// Returns a const reference to the tolerance.
+    /// Returns a const reference to the tolerance object used by
+    /// the algorithm.
     const Tolerance& tolerance() const {
       return _tol;
     }
diff --git a/lemon/preflow.h b/lemon/preflow.h
--- a/lemon/preflow.h
+++ b/lemon/preflow.h
@@ -97,7 +97,7 @@
   /// \e push-relabel algorithm producing a \ref max_flow
   /// "flow of maximum value" in a digraph.
   /// The preflow algorithms are the fastest known maximum
-  /// flow algorithms. The current implementation use a mixture of the
+  /// flow algorithms. The current implementation uses a mixture of the
   /// \e "highest label" and the \e "bound decrease" heuristics.
   /// The worst case time complexity of the algorithm is \f$O(n^2\sqrt{e})\f$.
   ///
@@ -371,9 +371,10 @@
       return *_level;
     }
 
-    /// \brief Sets the tolerance used by algorithm.
+    /// \brief Sets the tolerance used by the algorithm.
     ///
-    /// Sets the tolerance used by algorithm.
+    /// Sets the tolerance object used by the algorithm.
+    /// \return <tt>(*this)</tt>
     Preflow& tolerance(const Tolerance& tolerance) {
       _tolerance = tolerance;
       return *this;
@@ -381,7 +382,8 @@
 
     /// \brief Returns a const reference to the tolerance.
     ///
-    /// Returns a const reference to the tolerance.
+    /// Returns a const reference to the tolerance object used by
+    /// the algorithm.
     const Tolerance& tolerance() const {
       return _tolerance;
     }
diff --git a/test/circulation_test.cc b/test/circulation_test.cc
--- a/test/circulation_test.cc
+++ b/test/circulation_test.cc
@@ -87,6 +87,11 @@
     .upperMap(ucap)
     .supplyMap(supply)
     .flowMap(flow);
+  
+  const CirculationType::Elevator& elev = const_circ_test.elevator();
+  circ_test.elevator(const_cast<CirculationType::Elevator&>(elev));
+  CirculationType::Tolerance tol = const_circ_test.tolerance();
+  circ_test.tolerance(tol);
 
   circ_test.init();
   circ_test.greedyInit();
diff --git a/test/preflow_test.cc b/test/preflow_test.cc
--- a/test/preflow_test.cc
+++ b/test/preflow_test.cc
@@ -94,6 +94,11 @@
             ::Create PreflowType;
   PreflowType preflow_test(g, cap, n, n);
   const PreflowType& const_preflow_test = preflow_test;
+  
+  const PreflowType::Elevator& elev = const_preflow_test.elevator();
+  preflow_test.elevator(const_cast<PreflowType::Elevator&>(elev));
+  PreflowType::Tolerance tol = const_preflow_test.tolerance();
+  preflow_test.tolerance(tol);
 
   preflow_test
     .capacityMap(cap)



More information about the Lemon-commits mailing list