# HG changeset patch # User Peter Kovacs # Date 2008-12-05 00:22:47 # Node ID 6a2a33ad261bcb82c12c681950084c69e4c6cbdf # Parent ad483acf1654bd4d0c093b807b858ed59529f78e Add missing 'const' for query functions of algorithms diff --git a/lemon/bfs.h b/lemon/bfs.h --- a/lemon/bfs.h +++ b/lemon/bfs.h @@ -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 --git a/lemon/circulation.h b/lemon/circulation.h --- a/lemon/circulation.h +++ b/lemon/circulation.h @@ -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 --git a/lemon/dfs.h b/lemon/dfs.h --- a/lemon/dfs.h +++ b/lemon/dfs.h @@ -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 --git a/lemon/preflow.h b/lemon/preflow.h --- a/lemon/preflow.h +++ b/lemon/preflow.h @@ -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; }