Changeset 688:756a5ec551c8 in lemon for lemon/preflow.h
- Timestamp:
- 04/29/09 14:25:51 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/preflow.h
r658 r688 47 47 48 48 /// \brief The type of the flow values. 49 typedef typename CapacityMap::Value Flow;49 typedef typename CapacityMap::Value Value; 50 50 51 51 /// \brief The type of the map that stores the flow values. … … 53 53 /// The type of the map that stores the flow values. 54 54 /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept. 55 typedef typename Digraph::template ArcMap< Flow> FlowMap;55 typedef typename Digraph::template ArcMap<Value> FlowMap; 56 56 57 57 /// \brief Instantiates a FlowMap. … … 85 85 /// 86 86 /// The tolerance used by the algorithm to handle inexact computation. 87 typedef lemon::Tolerance< Flow> Tolerance;87 typedef lemon::Tolerance<Value> Tolerance; 88 88 89 89 }; … … 126 126 typedef typename Traits::CapacityMap CapacityMap; 127 127 ///The type of the flow values. 128 typedef typename Traits:: Flow Flow;128 typedef typename Traits::Value Value; 129 129 130 130 ///The type of the flow map. … … 152 152 bool _local_level; 153 153 154 typedef typename Digraph::template NodeMap< Flow> ExcessMap;154 typedef typename Digraph::template NodeMap<Value> ExcessMap; 155 155 ExcessMap* _excess; 156 156 … … 471 471 472 472 for (NodeIt n(_graph); n != INVALID; ++n) { 473 Flowexcess = 0;473 Value excess = 0; 474 474 for (InArcIt e(_graph, n); e != INVALID; ++e) { 475 475 excess += (*_flow)[e]; … … 520 520 521 521 for (OutArcIt e(_graph, _source); e != INVALID; ++e) { 522 Flowrem = (*_capacity)[e] - (*_flow)[e];522 Value rem = (*_capacity)[e] - (*_flow)[e]; 523 523 if (_tolerance.positive(rem)) { 524 524 Node u = _graph.target(e); … … 532 532 } 533 533 for (InArcIt e(_graph, _source); e != INVALID; ++e) { 534 Flowrem = (*_flow)[e];534 Value rem = (*_flow)[e]; 535 535 if (_tolerance.positive(rem)) { 536 536 Node v = _graph.source(e); … … 565 565 566 566 while (num > 0 && n != INVALID) { 567 Flowexcess = (*_excess)[n];567 Value excess = (*_excess)[n]; 568 568 int new_level = _level->maxLevel(); 569 569 570 570 for (OutArcIt e(_graph, n); e != INVALID; ++e) { 571 Flowrem = (*_capacity)[e] - (*_flow)[e];571 Value rem = (*_capacity)[e] - (*_flow)[e]; 572 572 if (!_tolerance.positive(rem)) continue; 573 573 Node v = _graph.target(e); … … 592 592 593 593 for (InArcIt e(_graph, n); e != INVALID; ++e) { 594 Flowrem = (*_flow)[e];594 Value rem = (*_flow)[e]; 595 595 if (!_tolerance.positive(rem)) continue; 596 596 Node v = _graph.source(e); … … 638 638 num = _node_num * 20; 639 639 while (num > 0 && n != INVALID) { 640 Flowexcess = (*_excess)[n];640 Value excess = (*_excess)[n]; 641 641 int new_level = _level->maxLevel(); 642 642 643 643 for (OutArcIt e(_graph, n); e != INVALID; ++e) { 644 Flowrem = (*_capacity)[e] - (*_flow)[e];644 Value rem = (*_capacity)[e] - (*_flow)[e]; 645 645 if (!_tolerance.positive(rem)) continue; 646 646 Node v = _graph.target(e); … … 665 665 666 666 for (InArcIt e(_graph, n); e != INVALID; ++e) { 667 Flowrem = (*_flow)[e];667 Value rem = (*_flow)[e]; 668 668 if (!_tolerance.positive(rem)) continue; 669 669 Node v = _graph.source(e); … … 779 779 Node n; 780 780 while ((n = _level->highestActive()) != INVALID) { 781 Flowexcess = (*_excess)[n];781 Value excess = (*_excess)[n]; 782 782 int level = _level->highestActiveLevel(); 783 783 int new_level = _level->maxLevel(); 784 784 785 785 for (OutArcIt e(_graph, n); e != INVALID; ++e) { 786 Flowrem = (*_capacity)[e] - (*_flow)[e];786 Value rem = (*_capacity)[e] - (*_flow)[e]; 787 787 if (!_tolerance.positive(rem)) continue; 788 788 Node v = _graph.target(e); … … 807 807 808 808 for (InArcIt e(_graph, n); e != INVALID; ++e) { 809 Flowrem = (*_flow)[e];809 Value rem = (*_flow)[e]; 810 810 if (!_tolerance.positive(rem)) continue; 811 811 Node v = _graph.source(e); … … 898 898 /// \pre Either \ref run() or \ref init() must be called before 899 899 /// using this function. 900 FlowflowValue() const {900 Value flowValue() const { 901 901 return (*_excess)[_target]; 902 902 } 903 903 904 /// \brief Returns the flow on the given arc.905 /// 906 /// Returns the flow on the given arc. This method can904 /// \brief Returns the flow value on the given arc. 905 /// 906 /// Returns the flow value on the given arc. This method can 907 907 /// be called after the second phase of the algorithm. 908 908 /// 909 909 /// \pre Either \ref run() or \ref init() must be called before 910 910 /// using this function. 911 Flowflow(const Arc& arc) const {911 Value flow(const Arc& arc) const { 912 912 return (*_flow)[arc]; 913 913 }
Note: See TracChangeset
for help on using the changeset viewer.