Small improvements for NetworkSimplex (#298)
authorPeter Kovacs <kpeter@inf.elte.hu>
Fri, 25 Sep 2009 11:58:34 +0200
changeset 776be48a648d28f
parent 759 6d5f547e5bfb
child 777 4a45c8808b33
Small improvements for NetworkSimplex (#298)
lemon/network_simplex.h
     1.1 --- a/lemon/network_simplex.h	Mon Aug 31 20:27:38 2009 +0200
     1.2 +++ b/lemon/network_simplex.h	Fri Sep 25 11:58:34 2009 +0200
     1.3 @@ -161,8 +161,6 @@
     1.4  
     1.5      TEMPLATE_DIGRAPH_TYPEDEFS(GR);
     1.6  
     1.7 -    typedef std::vector<Arc> ArcVector;
     1.8 -    typedef std::vector<Node> NodeVector;
     1.9      typedef std::vector<int> IntVector;
    1.10      typedef std::vector<bool> BoolVector;
    1.11      typedef std::vector<Value> ValueVector;
    1.12 @@ -685,17 +683,8 @@
    1.13          if ((i += k) >= _arc_num) i = (i % k) + 1;
    1.14        }
    1.15        
    1.16 -      // Initialize maps
    1.17 -      for (int i = 0; i != _node_num; ++i) {
    1.18 -        _supply[i] = 0;
    1.19 -      }
    1.20 -      for (int i = 0; i != _arc_num; ++i) {
    1.21 -        _lower[i] = 0;
    1.22 -        _upper[i] = INF;
    1.23 -        _cost[i] = 1;
    1.24 -      }
    1.25 -      _have_lower = false;
    1.26 -      _stype = GEQ;
    1.27 +      // Reset parameters
    1.28 +      reset();
    1.29      }
    1.30  
    1.31      /// \name Parameters
    1.32 @@ -768,7 +757,6 @@
    1.33      /// This function sets the supply values of the nodes.
    1.34      /// If neither this function nor \ref stSupply() is used before
    1.35      /// calling \ref run(), the supply of each node will be set to zero.
    1.36 -    /// (It makes sense only if non-zero lower bounds are given.)
    1.37      ///
    1.38      /// \param map A node map storing the supply values.
    1.39      /// Its \c Value type must be convertible to the \c Value type
    1.40 @@ -789,7 +777,6 @@
    1.41      /// and the required flow value.
    1.42      /// If neither this function nor \ref supplyMap() is used before
    1.43      /// calling \ref run(), the supply of each node will be set to zero.
    1.44 -    /// (It makes sense only if non-zero lower bounds are given.)
    1.45      ///
    1.46      /// Using this function has the same effect as using \ref supplyMap()
    1.47      /// with such a map in which \c k is assigned to \c s, \c -k is