Rename field in min cost flow codes (#478)
authorPeter Kovacs <kpeter@inf.elte.hu>
Thu, 17 Oct 2013 09:30:57 +0200
changeset 1297c0c2f5c87aa6
parent 1296 330264b171cf
child 1298 a78e5b779b69
Rename field in min cost flow codes (#478)
lemon/capacity_scaling.h
lemon/cost_scaling.h
lemon/cycle_canceling.h
lemon/network_simplex.h
     1.1 --- a/lemon/capacity_scaling.h	Thu Oct 17 09:29:37 2013 +0200
     1.2 +++ b/lemon/capacity_scaling.h	Thu Oct 17 09:30:57 2013 +0200
     1.3 @@ -160,7 +160,7 @@
     1.4      int _root;
     1.5  
     1.6      // Parameters of the problem
     1.7 -    bool _have_lower;
     1.8 +    bool _has_lower;
     1.9      Value _sum_supply;
    1.10  
    1.11      // Data structures for storing the digraph
    1.12 @@ -353,7 +353,7 @@
    1.13      /// \return <tt>(*this)</tt>
    1.14      template <typename LowerMap>
    1.15      CapacityScaling& lowerMap(const LowerMap& map) {
    1.16 -      _have_lower = true;
    1.17 +      _has_lower = true;
    1.18        for (ArcIt a(_graph); a != INVALID; ++a) {
    1.19          _lower[_arc_idf[a]] = map[a];
    1.20        }
    1.21 @@ -539,7 +539,7 @@
    1.22          _upper[j] = INF;
    1.23          _cost[j] = _forward[j] ? 1 : -1;
    1.24        }
    1.25 -      _have_lower = false;
    1.26 +      _has_lower = false;
    1.27        return *this;
    1.28      }
    1.29  
    1.30 @@ -750,7 +750,7 @@
    1.31        // Remove non-zero lower bounds
    1.32        const Value MAX = std::numeric_limits<Value>::max();
    1.33        int last_out;
    1.34 -      if (_have_lower) {
    1.35 +      if (_has_lower) {
    1.36          for (int i = 0; i != _root; ++i) {
    1.37            last_out = _first_out[i+1];
    1.38            for (int j = _first_out[i]; j != last_out; ++j) {
    1.39 @@ -853,7 +853,7 @@
    1.40          pt = startWithoutScaling();
    1.41  
    1.42        // Handle non-zero lower bounds
    1.43 -      if (_have_lower) {
    1.44 +      if (_has_lower) {
    1.45          int limit = _first_out[_root];
    1.46          for (int j = 0; j != limit; ++j) {
    1.47            if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
     2.1 --- a/lemon/cost_scaling.h	Thu Oct 17 09:29:37 2013 +0200
     2.2 +++ b/lemon/cost_scaling.h	Thu Oct 17 09:30:57 2013 +0200
     2.3 @@ -251,7 +251,7 @@
     2.4      int _root;
     2.5  
     2.6      // Parameters of the problem
     2.7 -    bool _have_lower;
     2.8 +    bool _has_lower;
     2.9      Value _sum_supply;
    2.10      int _sup_node_num;
    2.11  
    2.12 @@ -367,7 +367,7 @@
    2.13      /// \return <tt>(*this)</tt>
    2.14      template <typename LowerMap>
    2.15      CostScaling& lowerMap(const LowerMap& map) {
    2.16 -      _have_lower = true;
    2.17 +      _has_lower = true;
    2.18        for (ArcIt a(_graph); a != INVALID; ++a) {
    2.19          _lower[_arc_idf[a]] = map[a];
    2.20        }
    2.21 @@ -562,7 +562,7 @@
    2.22          _scost[j] = 0;
    2.23          _scost[_reverse[j]] = 0;
    2.24        }
    2.25 -      _have_lower = false;
    2.26 +      _has_lower = false;
    2.27        return *this;
    2.28      }
    2.29  
    2.30 @@ -774,7 +774,7 @@
    2.31        // Remove infinite upper bounds and check negative arcs
    2.32        const Value MAX = std::numeric_limits<Value>::max();
    2.33        int last_out;
    2.34 -      if (_have_lower) {
    2.35 +      if (_has_lower) {
    2.36          for (int i = 0; i != _root; ++i) {
    2.37            last_out = _first_out[i+1];
    2.38            for (int j = _first_out[i]; j != last_out; ++j) {
    2.39 @@ -831,7 +831,7 @@
    2.40        for (NodeIt n(_graph); n != INVALID; ++n) {
    2.41          sup[n] = _supply[_node_id[n]];
    2.42        }
    2.43 -      if (_have_lower) {
    2.44 +      if (_has_lower) {
    2.45          for (ArcIt a(_graph); a != INVALID; ++a) {
    2.46            int j = _arc_idf[a];
    2.47            Value c = _lower[j];
    2.48 @@ -985,7 +985,7 @@
    2.49        }
    2.50  
    2.51        // Handle non-zero lower bounds
    2.52 -      if (_have_lower) {
    2.53 +      if (_has_lower) {
    2.54          int limit = _first_out[_root];
    2.55          for (int j = 0; j != limit; ++j) {
    2.56            if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
     3.1 --- a/lemon/cycle_canceling.h	Thu Oct 17 09:29:37 2013 +0200
     3.2 +++ b/lemon/cycle_canceling.h	Thu Oct 17 09:30:57 2013 +0200
     3.3 @@ -195,7 +195,7 @@
     3.4      int _root;
     3.5  
     3.6      // Parameters of the problem
     3.7 -    bool _have_lower;
     3.8 +    bool _has_lower;
     3.9      Value _sum_supply;
    3.10  
    3.11      // Data structures for storing the digraph
    3.12 @@ -278,7 +278,7 @@
    3.13      /// \return <tt>(*this)</tt>
    3.14      template <typename LowerMap>
    3.15      CycleCanceling& lowerMap(const LowerMap& map) {
    3.16 -      _have_lower = true;
    3.17 +      _has_lower = true;
    3.18        for (ArcIt a(_graph); a != INVALID; ++a) {
    3.19          _lower[_arc_idf[a]] = map[a];
    3.20        }
    3.21 @@ -470,7 +470,7 @@
    3.22          _cost[j] = 0;
    3.23          _cost[_reverse[j]] = 0;
    3.24        }
    3.25 -      _have_lower = false;
    3.26 +      _has_lower = false;
    3.27        return *this;
    3.28      }
    3.29  
    3.30 @@ -683,7 +683,7 @@
    3.31        // Remove infinite upper bounds and check negative arcs
    3.32        const Value MAX = std::numeric_limits<Value>::max();
    3.33        int last_out;
    3.34 -      if (_have_lower) {
    3.35 +      if (_has_lower) {
    3.36          for (int i = 0; i != _root; ++i) {
    3.37            last_out = _first_out[i+1];
    3.38            for (int j = _first_out[i]; j != last_out; ++j) {
    3.39 @@ -726,7 +726,7 @@
    3.40        for (NodeIt n(_graph); n != INVALID; ++n) {
    3.41          sup[n] = _supply[_node_id[n]];
    3.42        }
    3.43 -      if (_have_lower) {
    3.44 +      if (_has_lower) {
    3.45          for (ArcIt a(_graph); a != INVALID; ++a) {
    3.46            int j = _arc_idf[a];
    3.47            Value c = _lower[j];
    3.48 @@ -834,7 +834,7 @@
    3.49        }
    3.50  
    3.51        // Handle non-zero lower bounds
    3.52 -      if (_have_lower) {
    3.53 +      if (_has_lower) {
    3.54          int limit = _first_out[_root];
    3.55          for (int j = 0; j != limit; ++j) {
    3.56            if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
     4.1 --- a/lemon/network_simplex.h	Thu Oct 17 09:29:37 2013 +0200
     4.2 +++ b/lemon/network_simplex.h	Thu Oct 17 09:30:57 2013 +0200
     4.3 @@ -198,7 +198,7 @@
     4.4      int _search_arc_num;
     4.5  
     4.6      // Parameters of the problem
     4.7 -    bool _have_lower;
     4.8 +    bool _has_lower;
     4.9      SupplyType _stype;
    4.10      Value _sum_supply;
    4.11  
    4.12 @@ -682,7 +682,7 @@
    4.13      /// \return <tt>(*this)</tt>
    4.14      template <typename LowerMap>
    4.15      NetworkSimplex& lowerMap(const LowerMap& map) {
    4.16 -      _have_lower = true;
    4.17 +      _has_lower = true;
    4.18        for (ArcIt a(_graph); a != INVALID; ++a) {
    4.19          _lower[_arc_id[a]] = map[a];
    4.20        }
    4.21 @@ -879,7 +879,7 @@
    4.22          _upper[i] = INF;
    4.23          _cost[i] = 1;
    4.24        }
    4.25 -      _have_lower = false;
    4.26 +      _has_lower = false;
    4.27        _stype = GEQ;
    4.28        return *this;
    4.29      }
    4.30 @@ -1072,7 +1072,7 @@
    4.31            "Upper bounds must be greater or equal to the lower bounds");
    4.32  
    4.33        // Remove non-zero lower bounds
    4.34 -      if (_have_lower) {
    4.35 +      if (_has_lower) {
    4.36          for (int i = 0; i != _arc_num; ++i) {
    4.37            Value c = _lower[i];
    4.38            if (c >= 0) {
    4.39 @@ -1612,7 +1612,7 @@
    4.40        }
    4.41  
    4.42        // Transform the solution and the supply map to the original form
    4.43 -      if (_have_lower) {
    4.44 +      if (_has_lower) {
    4.45          for (int i = 0; i != _arc_num; ++i) {
    4.46            Value c = _lower[i];
    4.47            if (c != 0) {