# HG changeset patch # User Alpar Juttner # Date 1251695578 -7200 # Node ID 5795e130402e2b81c9c1e625a9526276face53e2 # Parent fb93895f84d9050f68f4e9db6f3d70da4038be69# Parent 86c49553fea53ec66f545929a2bc75c94f1b6a20 Merge diff -r fb93895f84d9 -r 5795e130402e lemon/circulation.h --- a/lemon/circulation.h Thu Aug 20 22:52:16 2009 +0200 +++ b/lemon/circulation.h Mon Aug 31 07:12:58 2009 +0200 @@ -450,19 +450,21 @@ return *_level; } - /// \brief Sets the tolerance used by algorithm. + /// \brief Sets the tolerance used by the algorithm. /// - /// Sets the tolerance used by algorithm. - Circulation& tolerance(const Tolerance& tolerance) const { + /// Sets the tolerance object used by the algorithm. + /// \return (*this) + Circulation& tolerance(const Tolerance& tolerance) { _tol = tolerance; return *this; } /// \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; + return _tol; } /// \name Execution Control diff -r fb93895f84d9 -r 5795e130402e lemon/preflow.h --- a/lemon/preflow.h Thu Aug 20 22:52:16 2009 +0200 +++ b/lemon/preflow.h Mon Aug 31 07:12:58 2009 +0200 @@ -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,19 +371,21 @@ return *_level; } - /// \brief Sets the tolerance used by algorithm. + /// \brief Sets the tolerance used by the algorithm. /// - /// Sets the tolerance used by algorithm. - Preflow& tolerance(const Tolerance& tolerance) const { + /// Sets the tolerance object used by the algorithm. + /// \return (*this) + Preflow& tolerance(const Tolerance& tolerance) { _tolerance = tolerance; return *this; } /// \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; + return _tolerance; } /// \name Execution Control diff -r fb93895f84d9 -r 5795e130402e test/circulation_test.cc --- a/test/circulation_test.cc Thu Aug 20 22:52:16 2009 +0200 +++ b/test/circulation_test.cc Mon Aug 31 07:12:58 2009 +0200 @@ -87,6 +87,11 @@ .upperMap(ucap) .supplyMap(supply) .flowMap(flow); + + const CirculationType::Elevator& elev = const_circ_test.elevator(); + circ_test.elevator(const_cast(elev)); + CirculationType::Tolerance tol = const_circ_test.tolerance(); + circ_test.tolerance(tol); circ_test.init(); circ_test.greedyInit(); diff -r fb93895f84d9 -r 5795e130402e test/preflow_test.cc --- a/test/preflow_test.cc Thu Aug 20 22:52:16 2009 +0200 +++ b/test/preflow_test.cc Mon Aug 31 07:12:58 2009 +0200 @@ -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(elev)); + PreflowType::Tolerance tol = const_preflow_test.tolerance(); + preflow_test.tolerance(tol); preflow_test .capacityMap(cap)