diff -r 6c408d864fa1 -r 756a5ec551c8 lemon/preflow.h --- a/lemon/preflow.h Wed Apr 29 03:15:24 2009 +0200 +++ b/lemon/preflow.h Wed Apr 29 14:25:51 2009 +0200 @@ -46,13 +46,13 @@ typedef CAP CapacityMap; /// \brief The type of the flow values. - typedef typename CapacityMap::Value Flow; + typedef typename CapacityMap::Value Value; /// \brief The type of the map that stores the flow values. /// /// The type of the map that stores the flow values. /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept. - typedef typename Digraph::template ArcMap FlowMap; + typedef typename Digraph::template ArcMap FlowMap; /// \brief Instantiates a FlowMap. /// @@ -84,7 +84,7 @@ /// \brief The tolerance used by the algorithm /// /// The tolerance used by the algorithm to handle inexact computation. - typedef lemon::Tolerance Tolerance; + typedef lemon::Tolerance Tolerance; }; @@ -125,7 +125,7 @@ ///The type of the capacity map. typedef typename Traits::CapacityMap CapacityMap; ///The type of the flow values. - typedef typename Traits::Flow Flow; + typedef typename Traits::Value Value; ///The type of the flow map. typedef typename Traits::FlowMap FlowMap; @@ -151,7 +151,7 @@ Elevator* _level; bool _local_level; - typedef typename Digraph::template NodeMap ExcessMap; + typedef typename Digraph::template NodeMap ExcessMap; ExcessMap* _excess; Tolerance _tolerance; @@ -470,7 +470,7 @@ } for (NodeIt n(_graph); n != INVALID; ++n) { - Flow excess = 0; + Value excess = 0; for (InArcIt e(_graph, n); e != INVALID; ++e) { excess += (*_flow)[e]; } @@ -519,7 +519,7 @@ _level->initFinish(); for (OutArcIt e(_graph, _source); e != INVALID; ++e) { - Flow rem = (*_capacity)[e] - (*_flow)[e]; + Value rem = (*_capacity)[e] - (*_flow)[e]; if (_tolerance.positive(rem)) { Node u = _graph.target(e); if ((*_level)[u] == _level->maxLevel()) continue; @@ -531,7 +531,7 @@ } } for (InArcIt e(_graph, _source); e != INVALID; ++e) { - Flow rem = (*_flow)[e]; + Value rem = (*_flow)[e]; if (_tolerance.positive(rem)) { Node v = _graph.source(e); if ((*_level)[v] == _level->maxLevel()) continue; @@ -564,11 +564,11 @@ int num = _node_num; while (num > 0 && n != INVALID) { - Flow excess = (*_excess)[n]; + Value excess = (*_excess)[n]; int new_level = _level->maxLevel(); for (OutArcIt e(_graph, n); e != INVALID; ++e) { - Flow rem = (*_capacity)[e] - (*_flow)[e]; + Value rem = (*_capacity)[e] - (*_flow)[e]; if (!_tolerance.positive(rem)) continue; Node v = _graph.target(e); if ((*_level)[v] < level) { @@ -591,7 +591,7 @@ } for (InArcIt e(_graph, n); e != INVALID; ++e) { - Flow rem = (*_flow)[e]; + Value rem = (*_flow)[e]; if (!_tolerance.positive(rem)) continue; Node v = _graph.source(e); if ((*_level)[v] < level) { @@ -637,11 +637,11 @@ num = _node_num * 20; while (num > 0 && n != INVALID) { - Flow excess = (*_excess)[n]; + Value excess = (*_excess)[n]; int new_level = _level->maxLevel(); for (OutArcIt e(_graph, n); e != INVALID; ++e) { - Flow rem = (*_capacity)[e] - (*_flow)[e]; + Value rem = (*_capacity)[e] - (*_flow)[e]; if (!_tolerance.positive(rem)) continue; Node v = _graph.target(e); if ((*_level)[v] < level) { @@ -664,7 +664,7 @@ } for (InArcIt e(_graph, n); e != INVALID; ++e) { - Flow rem = (*_flow)[e]; + Value rem = (*_flow)[e]; if (!_tolerance.positive(rem)) continue; Node v = _graph.source(e); if ((*_level)[v] < level) { @@ -778,12 +778,12 @@ Node n; while ((n = _level->highestActive()) != INVALID) { - Flow excess = (*_excess)[n]; + Value excess = (*_excess)[n]; int level = _level->highestActiveLevel(); int new_level = _level->maxLevel(); for (OutArcIt e(_graph, n); e != INVALID; ++e) { - Flow rem = (*_capacity)[e] - (*_flow)[e]; + Value rem = (*_capacity)[e] - (*_flow)[e]; if (!_tolerance.positive(rem)) continue; Node v = _graph.target(e); if ((*_level)[v] < level) { @@ -806,7 +806,7 @@ } for (InArcIt e(_graph, n); e != INVALID; ++e) { - Flow rem = (*_flow)[e]; + Value rem = (*_flow)[e]; if (!_tolerance.positive(rem)) continue; Node v = _graph.source(e); if ((*_level)[v] < level) { @@ -897,18 +897,18 @@ /// /// \pre Either \ref run() or \ref init() must be called before /// using this function. - Flow flowValue() const { + Value flowValue() const { return (*_excess)[_target]; } - /// \brief Returns the flow on the given arc. + /// \brief Returns the flow value on the given arc. /// - /// Returns the flow on the given arc. This method can + /// Returns the flow value on the given arc. This method can /// be called after the second phase of the algorithm. /// /// \pre Either \ref run() or \ref init() must be called before /// using this function. - Flow flow(const Arc& arc) const { + Value flow(const Arc& arc) const { return (*_flow)[arc]; }