1.1 --- a/lemon/circulation.h Thu Aug 20 22:52:16 2009 +0200
1.2 +++ b/lemon/circulation.h Mon Aug 31 07:12:58 2009 +0200
1.3 @@ -450,19 +450,21 @@
1.4 return *_level;
1.5 }
1.6
1.7 - /// \brief Sets the tolerance used by algorithm.
1.8 + /// \brief Sets the tolerance used by the algorithm.
1.9 ///
1.10 - /// Sets the tolerance used by algorithm.
1.11 - Circulation& tolerance(const Tolerance& tolerance) const {
1.12 + /// Sets the tolerance object used by the algorithm.
1.13 + /// \return <tt>(*this)</tt>
1.14 + Circulation& tolerance(const Tolerance& tolerance) {
1.15 _tol = tolerance;
1.16 return *this;
1.17 }
1.18
1.19 /// \brief Returns a const reference to the tolerance.
1.20 ///
1.21 - /// Returns a const reference to the tolerance.
1.22 + /// Returns a const reference to the tolerance object used by
1.23 + /// the algorithm.
1.24 const Tolerance& tolerance() const {
1.25 - return tolerance;
1.26 + return _tol;
1.27 }
1.28
1.29 /// \name Execution Control
2.1 --- a/lemon/preflow.h Thu Aug 20 22:52:16 2009 +0200
2.2 +++ b/lemon/preflow.h Mon Aug 31 07:12:58 2009 +0200
2.3 @@ -97,7 +97,7 @@
2.4 /// \e push-relabel algorithm producing a \ref max_flow
2.5 /// "flow of maximum value" in a digraph.
2.6 /// The preflow algorithms are the fastest known maximum
2.7 - /// flow algorithms. The current implementation use a mixture of the
2.8 + /// flow algorithms. The current implementation uses a mixture of the
2.9 /// \e "highest label" and the \e "bound decrease" heuristics.
2.10 /// The worst case time complexity of the algorithm is \f$O(n^2\sqrt{e})\f$.
2.11 ///
2.12 @@ -371,19 +371,21 @@
2.13 return *_level;
2.14 }
2.15
2.16 - /// \brief Sets the tolerance used by algorithm.
2.17 + /// \brief Sets the tolerance used by the algorithm.
2.18 ///
2.19 - /// Sets the tolerance used by algorithm.
2.20 - Preflow& tolerance(const Tolerance& tolerance) const {
2.21 + /// Sets the tolerance object used by the algorithm.
2.22 + /// \return <tt>(*this)</tt>
2.23 + Preflow& tolerance(const Tolerance& tolerance) {
2.24 _tolerance = tolerance;
2.25 return *this;
2.26 }
2.27
2.28 /// \brief Returns a const reference to the tolerance.
2.29 ///
2.30 - /// Returns a const reference to the tolerance.
2.31 + /// Returns a const reference to the tolerance object used by
2.32 + /// the algorithm.
2.33 const Tolerance& tolerance() const {
2.34 - return tolerance;
2.35 + return _tolerance;
2.36 }
2.37
2.38 /// \name Execution Control
3.1 --- a/test/circulation_test.cc Thu Aug 20 22:52:16 2009 +0200
3.2 +++ b/test/circulation_test.cc Mon Aug 31 07:12:58 2009 +0200
3.3 @@ -87,6 +87,11 @@
3.4 .upperMap(ucap)
3.5 .supplyMap(supply)
3.6 .flowMap(flow);
3.7 +
3.8 + const CirculationType::Elevator& elev = const_circ_test.elevator();
3.9 + circ_test.elevator(const_cast<CirculationType::Elevator&>(elev));
3.10 + CirculationType::Tolerance tol = const_circ_test.tolerance();
3.11 + circ_test.tolerance(tol);
3.12
3.13 circ_test.init();
3.14 circ_test.greedyInit();
4.1 --- a/test/preflow_test.cc Thu Aug 20 22:52:16 2009 +0200
4.2 +++ b/test/preflow_test.cc Mon Aug 31 07:12:58 2009 +0200
4.3 @@ -94,6 +94,11 @@
4.4 ::Create PreflowType;
4.5 PreflowType preflow_test(g, cap, n, n);
4.6 const PreflowType& const_preflow_test = preflow_test;
4.7 +
4.8 + const PreflowType::Elevator& elev = const_preflow_test.elevator();
4.9 + preflow_test.elevator(const_cast<PreflowType::Elevator&>(elev));
4.10 + PreflowType::Tolerance tol = const_preflow_test.tolerance();
4.11 + preflow_test.tolerance(tol);
4.12
4.13 preflow_test
4.14 .capacityMap(cap)