Changeset 657:dacc2cee2b4c in lemon for lemon/preflow.h
 Timestamp:
 04/17/09 18:14:35 (12 years ago)
 Branch:
 default
 Phase:
 public
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/preflow.h
r525 r657 47 47 48 48 /// \brief The type of the flow values. 49 typedef typename CapacityMap::Value Value;49 typedef typename CapacityMap::Value Flow; 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< Value> FlowMap;55 typedef typename Digraph::template ArcMap<Flow> FlowMap; 56 56 57 57 /// \brief Instantiates a FlowMap. 58 58 /// 59 59 /// This function instantiates a \ref FlowMap. 60 /// \param digraph The digraph , towhich we would like to define60 /// \param digraph The digraph for which we would like to define 61 61 /// the flow map. 62 62 static FlowMap* createFlowMap(const Digraph& digraph) { … … 75 75 /// 76 76 /// This function instantiates an \ref Elevator. 77 /// \param digraph The digraph , towhich we would like to define77 /// \param digraph The digraph for which we would like to define 78 78 /// the elevator. 79 79 /// \param max_level The maximum level of the elevator. … … 85 85 /// 86 86 /// The tolerance used by the algorithm to handle inexact computation. 87 typedef lemon::Tolerance< Value> Tolerance;87 typedef lemon::Tolerance<Flow> Tolerance; 88 88 89 89 }; … … 125 125 typedef typename Traits::CapacityMap CapacityMap; 126 126 ///The type of the flow values. 127 typedef typename Traits:: Value Value;127 typedef typename Traits::Flow Flow; 128 128 129 129 ///The type of the flow map. … … 151 151 bool _local_level; 152 152 153 typedef typename Digraph::template NodeMap< Value> ExcessMap;153 typedef typename Digraph::template NodeMap<Flow> ExcessMap; 154 154 ExcessMap* _excess; 155 155 … … 470 470 471 471 for (NodeIt n(_graph); n != INVALID; ++n) { 472 Valueexcess = 0;472 Flow excess = 0; 473 473 for (InArcIt e(_graph, n); e != INVALID; ++e) { 474 474 excess += (*_flow)[e]; … … 519 519 520 520 for (OutArcIt e(_graph, _source); e != INVALID; ++e) { 521 Valuerem = (*_capacity)[e]  (*_flow)[e];521 Flow rem = (*_capacity)[e]  (*_flow)[e]; 522 522 if (_tolerance.positive(rem)) { 523 523 Node u = _graph.target(e); … … 531 531 } 532 532 for (InArcIt e(_graph, _source); e != INVALID; ++e) { 533 Valuerem = (*_flow)[e];533 Flow rem = (*_flow)[e]; 534 534 if (_tolerance.positive(rem)) { 535 535 Node v = _graph.source(e); … … 564 564 565 565 while (num > 0 && n != INVALID) { 566 Valueexcess = (*_excess)[n];566 Flow excess = (*_excess)[n]; 567 567 int new_level = _level>maxLevel(); 568 568 569 569 for (OutArcIt e(_graph, n); e != INVALID; ++e) { 570 Valuerem = (*_capacity)[e]  (*_flow)[e];570 Flow rem = (*_capacity)[e]  (*_flow)[e]; 571 571 if (!_tolerance.positive(rem)) continue; 572 572 Node v = _graph.target(e); … … 591 591 592 592 for (InArcIt e(_graph, n); e != INVALID; ++e) { 593 Valuerem = (*_flow)[e];593 Flow rem = (*_flow)[e]; 594 594 if (!_tolerance.positive(rem)) continue; 595 595 Node v = _graph.source(e); … … 637 637 num = _node_num * 20; 638 638 while (num > 0 && n != INVALID) { 639 Valueexcess = (*_excess)[n];639 Flow excess = (*_excess)[n]; 640 640 int new_level = _level>maxLevel(); 641 641 642 642 for (OutArcIt e(_graph, n); e != INVALID; ++e) { 643 Valuerem = (*_capacity)[e]  (*_flow)[e];643 Flow rem = (*_capacity)[e]  (*_flow)[e]; 644 644 if (!_tolerance.positive(rem)) continue; 645 645 Node v = _graph.target(e); … … 664 664 665 665 for (InArcIt e(_graph, n); e != INVALID; ++e) { 666 Valuerem = (*_flow)[e];666 Flow rem = (*_flow)[e]; 667 667 if (!_tolerance.positive(rem)) continue; 668 668 Node v = _graph.source(e); … … 778 778 Node n; 779 779 while ((n = _level>highestActive()) != INVALID) { 780 Valueexcess = (*_excess)[n];780 Flow excess = (*_excess)[n]; 781 781 int level = _level>highestActiveLevel(); 782 782 int new_level = _level>maxLevel(); 783 783 784 784 for (OutArcIt e(_graph, n); e != INVALID; ++e) { 785 Valuerem = (*_capacity)[e]  (*_flow)[e];785 Flow rem = (*_capacity)[e]  (*_flow)[e]; 786 786 if (!_tolerance.positive(rem)) continue; 787 787 Node v = _graph.target(e); … … 806 806 807 807 for (InArcIt e(_graph, n); e != INVALID; ++e) { 808 Valuerem = (*_flow)[e];808 Flow rem = (*_flow)[e]; 809 809 if (!_tolerance.positive(rem)) continue; 810 810 Node v = _graph.source(e); … … 897 897 /// \pre Either \ref run() or \ref init() must be called before 898 898 /// using this function. 899 ValueflowValue() const {899 Flow flowValue() const { 900 900 return (*_excess)[_target]; 901 901 } … … 908 908 /// \pre Either \ref run() or \ref init() must be called before 909 909 /// using this function. 910 Valueflow(const Arc& arc) const {910 Flow flow(const Arc& arc) const { 911 911 return (*_flow)[arc]; 912 912 }
Note: See TracChangeset
for help on using the changeset viewer.