[Lemon-commits] Peter Kovacs: Add missing 'const' for query func...

Lemon HG hg at lemon.cs.elte.hu
Fri Dec 5 11:46:06 CET 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/6a2a33ad261b
changeset: 437:6a2a33ad261b
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Fri Dec 05 00:22:47 2008 +0100
description:
	Add missing 'const' for query functions of algorithms

diffstat:

4 files changed, 10 insertions(+), 10 deletions(-)
lemon/bfs.h         |    2 +-
lemon/circulation.h |   12 ++++++------
lemon/dfs.h         |    2 +-
lemon/preflow.h     |    4 ++--

diffs (102 lines):

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<class BarrierMap>
-    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;
     }
 



More information about the Lemon-commits mailing list