[Lemon-commits] Peter Kovacs: Rename a private type in MCF class...

Lemon HG hg at lemon.cs.elte.hu
Mon Dec 14 06:17:47 CET 2009


details:   http://lemon.cs.elte.hu/hg/lemon/rev/7ef7a5fbb85d
changeset: 886:7ef7a5fbb85d
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Fri Nov 13 00:37:55 2009 +0100
description:
	Rename a private type in MCF classes (#180)

	The new MCF algorithms define a private map type VectorMap, which
	could be misleading, since there is an other VectorMap defined in
	lemon/bits/vector_map.h. Thus the new type is is renamed to
	StaticVectorMap.

diffstat:

 lemon/cost_scaling.h    |   8 ++++----
 lemon/cycle_canceling.h |  12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diffs (70 lines):

diff --git a/lemon/cost_scaling.h b/lemon/cost_scaling.h
--- a/lemon/cost_scaling.h
+++ b/lemon/cost_scaling.h
@@ -205,12 +205,12 @@
   private:
   
     template <typename KT, typename VT>
-    class VectorMap {
+    class StaticVectorMap {
     public:
       typedef KT Key;
       typedef VT Value;
       
-      VectorMap(std::vector<Value>& v) : _v(v) {}
+      StaticVectorMap(std::vector<Value>& v) : _v(v) {}
       
       const Value& operator[](const Key& key) const {
         return _v[StaticDigraph::id(key)];
@@ -228,8 +228,8 @@
       std::vector<Value>& _v;
     };
 
-    typedef VectorMap<StaticDigraph::Node, LargeCost> LargeCostNodeMap;
-    typedef VectorMap<StaticDigraph::Arc, LargeCost> LargeCostArcMap;
+    typedef StaticVectorMap<StaticDigraph::Node, LargeCost> LargeCostNodeMap;
+    typedef StaticVectorMap<StaticDigraph::Arc, LargeCost> LargeCostArcMap;
 
   private:
 
diff --git a/lemon/cycle_canceling.h b/lemon/cycle_canceling.h
--- a/lemon/cycle_canceling.h
+++ b/lemon/cycle_canceling.h
@@ -152,12 +152,12 @@
   private:
   
     template <typename KT, typename VT>
-    class VectorMap {
+    class StaticVectorMap {
     public:
       typedef KT Key;
       typedef VT Value;
       
-      VectorMap(std::vector<Value>& v) : _v(v) {}
+      StaticVectorMap(std::vector<Value>& v) : _v(v) {}
       
       const Value& operator[](const Key& key) const {
         return _v[StaticDigraph::id(key)];
@@ -175,8 +175,8 @@
       std::vector<Value>& _v;
     };
 
-    typedef VectorMap<StaticDigraph::Node, Cost> CostNodeMap;
-    typedef VectorMap<StaticDigraph::Arc, Cost> CostArcMap;
+    typedef StaticVectorMap<StaticDigraph::Node, Cost> CostNodeMap;
+    typedef StaticVectorMap<StaticDigraph::Arc, Cost> CostArcMap;
 
   private:
 
@@ -800,9 +800,9 @@
       const int BF_FIRST_LIMIT  = 2;
       const double BF_LIMIT_FACTOR = 1.5;
       
-      typedef VectorMap<StaticDigraph::Arc, Value> FilterMap;
+      typedef StaticVectorMap<StaticDigraph::Arc, Value> FilterMap;
       typedef FilterArcs<StaticDigraph, FilterMap> ResDigraph;
-      typedef VectorMap<StaticDigraph::Node, StaticDigraph::Arc> PredMap;
+      typedef StaticVectorMap<StaticDigraph::Node, StaticDigraph::Arc> PredMap;
       typedef typename BellmanFord<ResDigraph, CostArcMap>
         ::template SetDistMap<CostNodeMap>
         ::template SetPredMap<PredMap>::Create BF;



More information about the Lemon-commits mailing list