# HG changeset patch # User Peter Kovacs # Date 1228432967 -3600 # Node ID 6a2a33ad261bcb82c12c681950084c69e4c6cbdf # Parent ad483acf1654bd4d0c093b807b858ed59529f78e Add missing 'const' for query functions of algorithms diff -r ad483acf1654 -r 6a2a33ad261b lemon/bfs.h --- a/lemon/bfs.h Tue Dec 02 15:33:22 2008 +0000 +++ b/lemon/bfs.h Fri Dec 05 00:22:47 2008 +0100 @@ -1741,7 +1741,7 @@ /// /// \pre Either \ref run(Node) "run()" or \ref init() /// must be called before using this function. - bool reached(Node v) { return (*_reached)[v]; } + bool reached(Node v) const { return (*_reached)[v]; } ///@} diff -r ad483acf1654 -r 6a2a33ad261b lemon/circulation.h --- a/lemon/circulation.h Tue Dec 02 15:33:22 2008 +0000 +++ b/lemon/circulation.h Fri Dec 05 00:22:47 2008 +0100 @@ -419,7 +419,7 @@ /// /// \pre Either \ref run() or \ref init() must be called before /// using this function. - const Elevator& elevator() { + const Elevator& elevator() const { return *_level; } @@ -644,7 +644,7 @@ /// /// \pre Either \ref run() or \ref init() must be called before /// using this function. - const FlowMap& flowMap() { + const FlowMap& flowMap() const { return *_flow; } @@ -669,7 +669,7 @@ \sa barrierMap() \sa checkBarrier() */ - bool barrier(const Node& node) + bool barrier(const Node& node) const { return (*_level)[node] >= _el; } @@ -692,7 +692,7 @@ /// \sa barrier() /// \sa checkBarrier() template - void barrierMap(BarrierMap &bar) + void barrierMap(BarrierMap &bar) const { for(NodeIt n(_g);n!=INVALID;++n) bar.set(n, (*_level)[n] >= _el); @@ -712,7 +712,7 @@ ///Check if the found flow is a feasible circulation, /// - bool checkFlow() { + bool checkFlow() const { for(ArcIt e(_g);e!=INVALID;++e) if((*_flow)[e]<(*_lo)[e]||(*_flow)[e]>(*_up)[e]) return false; for(NodeIt n(_g);n!=INVALID;++n) @@ -730,7 +730,7 @@ ///Check whether or not the last execution provides a barrier. ///\sa barrier() ///\sa barrierMap() - bool checkBarrier() + bool checkBarrier() const { Value delta=0; for(NodeIt n(_g);n!=INVALID;++n) diff -r ad483acf1654 -r 6a2a33ad261b lemon/dfs.h --- a/lemon/dfs.h Tue Dec 02 15:33:22 2008 +0000 +++ b/lemon/dfs.h Fri Dec 05 00:22:47 2008 +0100 @@ -1625,7 +1625,7 @@ /// /// \pre Either \ref run(Node) "run()" or \ref init() /// must be called before using this function. - bool reached(Node v) { return (*_reached)[v]; } + bool reached(Node v) const { return (*_reached)[v]; } ///@} diff -r ad483acf1654 -r 6a2a33ad261b lemon/preflow.h --- a/lemon/preflow.h Tue Dec 02 15:33:22 2008 +0000 +++ b/lemon/preflow.h Fri Dec 05 00:22:47 2008 +0100 @@ -366,7 +366,7 @@ /// /// \pre Either \ref run() or \ref init() must be called before /// using this function. - const Elevator& elevator() { + const Elevator& elevator() const { return *_level; } @@ -918,7 +918,7 @@ /// /// \pre Either \ref run() or \ref init() must be called before /// using this function. - const FlowMap& flowMap() { + const FlowMap& flowMap() const { return *_flow; }