59 /// |
60 /// |
60 ///\author Jacint Szabo |
61 ///\author Jacint Szabo |
61 ///\todo Second template parameter is superfluous |
62 ///\todo Second template parameter is superfluous |
62 template <typename Graph, typename Num, |
63 template <typename Graph, typename Num, |
63 typename CapacityMap=typename Graph::template EdgeMap<Num>, |
64 typename CapacityMap=typename Graph::template EdgeMap<Num>, |
64 typename FlowMap=typename Graph::template EdgeMap<Num> > |
65 typename FlowMap=typename Graph::template EdgeMap<Num>, |
|
66 typename TOL=Tolerance<Num> > |
65 class Preflow { |
67 class Preflow { |
66 protected: |
68 protected: |
67 typedef typename Graph::Node Node; |
69 typedef typename Graph::Node Node; |
68 typedef typename Graph::NodeIt NodeIt; |
70 typedef typename Graph::NodeIt NodeIt; |
69 typedef typename Graph::EdgeIt EdgeIt; |
71 typedef typename Graph::EdgeIt EdgeIt; |
151 ///\param _f The flow of the edges. |
156 ///\param _f The flow of the edges. |
152 ///Except the graph, all of these parameters can be reset by |
157 ///Except the graph, all of these parameters can be reset by |
153 ///calling \ref source, \ref target, \ref capacityMap and \ref |
158 ///calling \ref source, \ref target, \ref capacityMap and \ref |
154 ///flowMap, resp. |
159 ///flowMap, resp. |
155 Preflow(const Graph& _gr, Node _s, Node _t, |
160 Preflow(const Graph& _gr, Node _s, Node _t, |
156 const CapacityMap& _cap, FlowMap& _f) : |
161 const CapacityMap& _cap, FlowMap& _f, |
|
162 const TOL &tol=TOL()) : |
157 _g(&_gr), _source(_s), _target(_t), _capacity(&_cap), |
163 _g(&_gr), _source(_s), _target(_t), _capacity(&_cap), |
158 _flow(&_f), _node_num(countNodes(_gr)), level(_gr), excess(_gr,0), |
164 _flow(&_f), surely(tol), |
|
165 _node_num(countNodes(_gr)), level(_gr), excess(_gr,0), |
159 flow_prop(NO_FLOW), status(AFTER_NOTHING) { |
166 flow_prop(NO_FLOW), status(AFTER_NOTHING) { |
160 if ( _source==_target ) |
167 if ( _source==_target ) |
161 throw InvalidArgument(); |
168 throw InvalidArgument(); |
162 } |
169 } |
163 |
170 |