57 /// |
57 /// |
58 ///\param Graph The directed graph type the algorithm runs on. |
58 ///\param Graph The directed graph type the algorithm runs on. |
59 ///\param Num The number type of the capacities and the flow values. |
59 ///\param Num The number type of the capacities and the flow values. |
60 ///\param CapacityMap The capacity map type. |
60 ///\param CapacityMap The capacity map type. |
61 ///\param FlowMap The flow map type. |
61 ///\param FlowMap The flow map type. |
62 ///\param Tolerance The tolerance type. |
62 ///\param Tol The tolerance type. |
63 /// |
63 /// |
64 ///\author Jacint Szabo |
64 ///\author Jacint Szabo |
65 ///\todo Second template parameter is superfluous |
65 ///\todo Second template parameter is superfluous |
66 template <typename Graph, typename Num, |
66 template <typename Graph, typename Num, |
67 typename CapacityMap=typename Graph::template EdgeMap<Num>, |
67 typename CapacityMap=typename Graph::template EdgeMap<Num>, |
68 typename FlowMap=typename Graph::template EdgeMap<Num>, |
68 typename FlowMap=typename Graph::template EdgeMap<Num>, |
69 typename Tolerance=Tolerance<Num> > |
69 typename Tol=Tolerance<Num> > |
70 class Preflow { |
70 class Preflow { |
71 protected: |
71 protected: |
72 typedef typename Graph::Node Node; |
72 typedef typename Graph::Node Node; |
73 typedef typename Graph::NodeIt NodeIt; |
73 typedef typename Graph::NodeIt NodeIt; |
74 typedef typename Graph::EdgeIt EdgeIt; |
74 typedef typename Graph::EdgeIt EdgeIt; |
153 ///\param _gr The directed graph the algorithm runs on. |
153 ///\param _gr The directed graph the algorithm runs on. |
154 ///\param _s The source node. |
154 ///\param _s The source node. |
155 ///\param _t The target node. |
155 ///\param _t The target node. |
156 ///\param _cap The capacity of the edges. |
156 ///\param _cap The capacity of the edges. |
157 ///\param _f The flow of the edges. |
157 ///\param _f The flow of the edges. |
158 ///\param _sr Tolerance class. |
158 ///\param _sr Tol class. |
159 ///Except the graph, all of these parameters can be reset by |
159 ///Except the graph, all of these parameters can be reset by |
160 ///calling \ref source, \ref target, \ref capacityMap and \ref |
160 ///calling \ref source, \ref target, \ref capacityMap and \ref |
161 ///flowMap, resp. |
161 ///flowMap, resp. |
162 Preflow(const Graph& _gr, Node _s, Node _t, |
162 Preflow(const Graph& _gr, Node _s, Node _t, |
163 const CapacityMap& _cap, FlowMap& _f, |
163 const CapacityMap& _cap, FlowMap& _f, |
164 const Tolerance &_sr=Tolerance()) : |
164 const Tol &_sr=Tol()) : |
165 _g(&_gr), _source(_s), _target(_t), _capacity(&_cap), |
165 _g(&_gr), _source(_s), _target(_t), _capacity(&_cap), |
166 _flow(&_f), _surely(_sr), |
166 _flow(&_f), _surely(_sr), |
167 _node_num(countNodes(_gr)), level(_gr), excess(_gr,0), |
167 _node_num(countNodes(_gr)), level(_gr), excess(_gr,0), |
168 flow_prop(NO_FLOW), status(AFTER_NOTHING) { |
168 flow_prop(NO_FLOW), status(AFTER_NOTHING) { |
169 if ( _source==_target ) |
169 if ( _source==_target ) |