lemon/preflow.h
changeset 646 e01957e96c67
parent 611 85cb3aa71cce
child 688 1f08e846df29
child 713 4ac30454f1c1
     1.1 --- a/lemon/preflow.h	Wed Apr 29 16:15:29 2009 +0100
     1.2 +++ b/lemon/preflow.h	Wed Apr 29 19:22:14 2009 +0100
     1.3 @@ -46,13 +46,13 @@
     1.4      typedef CAP CapacityMap;
     1.5  
     1.6      /// \brief The type of the flow values.
     1.7 -    typedef typename CapacityMap::Value Flow;
     1.8 +    typedef typename CapacityMap::Value Value;
     1.9  
    1.10      /// \brief The type of the map that stores the flow values.
    1.11      ///
    1.12      /// The type of the map that stores the flow values.
    1.13      /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    1.14 -    typedef typename Digraph::template ArcMap<Flow> FlowMap;
    1.15 +    typedef typename Digraph::template ArcMap<Value> FlowMap;
    1.16  
    1.17      /// \brief Instantiates a FlowMap.
    1.18      ///
    1.19 @@ -84,7 +84,7 @@
    1.20      /// \brief The tolerance used by the algorithm
    1.21      ///
    1.22      /// The tolerance used by the algorithm to handle inexact computation.
    1.23 -    typedef lemon::Tolerance<Flow> Tolerance;
    1.24 +    typedef lemon::Tolerance<Value> Tolerance;
    1.25  
    1.26    };
    1.27  
    1.28 @@ -125,7 +125,7 @@
    1.29      ///The type of the capacity map.
    1.30      typedef typename Traits::CapacityMap CapacityMap;
    1.31      ///The type of the flow values.
    1.32 -    typedef typename Traits::Flow Flow;
    1.33 +    typedef typename Traits::Value Value;
    1.34  
    1.35      ///The type of the flow map.
    1.36      typedef typename Traits::FlowMap FlowMap;
    1.37 @@ -151,7 +151,7 @@
    1.38      Elevator* _level;
    1.39      bool _local_level;
    1.40  
    1.41 -    typedef typename Digraph::template NodeMap<Flow> ExcessMap;
    1.42 +    typedef typename Digraph::template NodeMap<Value> ExcessMap;
    1.43      ExcessMap* _excess;
    1.44  
    1.45      Tolerance _tolerance;
    1.46 @@ -470,7 +470,7 @@
    1.47        }
    1.48  
    1.49        for (NodeIt n(_graph); n != INVALID; ++n) {
    1.50 -        Flow excess = 0;
    1.51 +        Value excess = 0;
    1.52          for (InArcIt e(_graph, n); e != INVALID; ++e) {
    1.53            excess += (*_flow)[e];
    1.54          }
    1.55 @@ -519,7 +519,7 @@
    1.56        _level->initFinish();
    1.57  
    1.58        for (OutArcIt e(_graph, _source); e != INVALID; ++e) {
    1.59 -        Flow rem = (*_capacity)[e] - (*_flow)[e];
    1.60 +        Value rem = (*_capacity)[e] - (*_flow)[e];
    1.61          if (_tolerance.positive(rem)) {
    1.62            Node u = _graph.target(e);
    1.63            if ((*_level)[u] == _level->maxLevel()) continue;
    1.64 @@ -531,7 +531,7 @@
    1.65          }
    1.66        }
    1.67        for (InArcIt e(_graph, _source); e != INVALID; ++e) {
    1.68 -        Flow rem = (*_flow)[e];
    1.69 +        Value rem = (*_flow)[e];
    1.70          if (_tolerance.positive(rem)) {
    1.71            Node v = _graph.source(e);
    1.72            if ((*_level)[v] == _level->maxLevel()) continue;
    1.73 @@ -564,11 +564,11 @@
    1.74          int num = _node_num;
    1.75  
    1.76          while (num > 0 && n != INVALID) {
    1.77 -          Flow excess = (*_excess)[n];
    1.78 +          Value excess = (*_excess)[n];
    1.79            int new_level = _level->maxLevel();
    1.80  
    1.81            for (OutArcIt e(_graph, n); e != INVALID; ++e) {
    1.82 -            Flow rem = (*_capacity)[e] - (*_flow)[e];
    1.83 +            Value rem = (*_capacity)[e] - (*_flow)[e];
    1.84              if (!_tolerance.positive(rem)) continue;
    1.85              Node v = _graph.target(e);
    1.86              if ((*_level)[v] < level) {
    1.87 @@ -591,7 +591,7 @@
    1.88            }
    1.89  
    1.90            for (InArcIt e(_graph, n); e != INVALID; ++e) {
    1.91 -            Flow rem = (*_flow)[e];
    1.92 +            Value rem = (*_flow)[e];
    1.93              if (!_tolerance.positive(rem)) continue;
    1.94              Node v = _graph.source(e);
    1.95              if ((*_level)[v] < level) {
    1.96 @@ -637,11 +637,11 @@
    1.97  
    1.98          num = _node_num * 20;
    1.99          while (num > 0 && n != INVALID) {
   1.100 -          Flow excess = (*_excess)[n];
   1.101 +          Value excess = (*_excess)[n];
   1.102            int new_level = _level->maxLevel();
   1.103  
   1.104            for (OutArcIt e(_graph, n); e != INVALID; ++e) {
   1.105 -            Flow rem = (*_capacity)[e] - (*_flow)[e];
   1.106 +            Value rem = (*_capacity)[e] - (*_flow)[e];
   1.107              if (!_tolerance.positive(rem)) continue;
   1.108              Node v = _graph.target(e);
   1.109              if ((*_level)[v] < level) {
   1.110 @@ -664,7 +664,7 @@
   1.111            }
   1.112  
   1.113            for (InArcIt e(_graph, n); e != INVALID; ++e) {
   1.114 -            Flow rem = (*_flow)[e];
   1.115 +            Value rem = (*_flow)[e];
   1.116              if (!_tolerance.positive(rem)) continue;
   1.117              Node v = _graph.source(e);
   1.118              if ((*_level)[v] < level) {
   1.119 @@ -778,12 +778,12 @@
   1.120  
   1.121        Node n;
   1.122        while ((n = _level->highestActive()) != INVALID) {
   1.123 -        Flow excess = (*_excess)[n];
   1.124 +        Value excess = (*_excess)[n];
   1.125          int level = _level->highestActiveLevel();
   1.126          int new_level = _level->maxLevel();
   1.127  
   1.128          for (OutArcIt e(_graph, n); e != INVALID; ++e) {
   1.129 -          Flow rem = (*_capacity)[e] - (*_flow)[e];
   1.130 +          Value rem = (*_capacity)[e] - (*_flow)[e];
   1.131            if (!_tolerance.positive(rem)) continue;
   1.132            Node v = _graph.target(e);
   1.133            if ((*_level)[v] < level) {
   1.134 @@ -806,7 +806,7 @@
   1.135          }
   1.136  
   1.137          for (InArcIt e(_graph, n); e != INVALID; ++e) {
   1.138 -          Flow rem = (*_flow)[e];
   1.139 +          Value rem = (*_flow)[e];
   1.140            if (!_tolerance.positive(rem)) continue;
   1.141            Node v = _graph.source(e);
   1.142            if ((*_level)[v] < level) {
   1.143 @@ -897,18 +897,18 @@
   1.144      ///
   1.145      /// \pre Either \ref run() or \ref init() must be called before
   1.146      /// using this function.
   1.147 -    Flow flowValue() const {
   1.148 +    Value flowValue() const {
   1.149        return (*_excess)[_target];
   1.150      }
   1.151  
   1.152 -    /// \brief Returns the flow on the given arc.
   1.153 +    /// \brief Returns the flow value on the given arc.
   1.154      ///
   1.155 -    /// Returns the flow on the given arc. This method can
   1.156 +    /// Returns the flow value on the given arc. This method can
   1.157      /// be called after the second phase of the algorithm.
   1.158      ///
   1.159      /// \pre Either \ref run() or \ref init() must be called before
   1.160      /// using this function.
   1.161 -    Flow flow(const Arc& arc) const {
   1.162 +    Value flow(const Arc& arc) const {
   1.163        return (*_flow)[arc];
   1.164      }
   1.165