- A primitive function type interface for Preflow.
authoralpar
Sat, 19 Mar 2005 09:38:31 +0000
changeset 122701f668e3e168
parent 1226 71fcebd3a041
child 1228 0a7719037acb
- A primitive function type interface for Preflow.
- A compilation bug fixed
src/lemon/preflow.h
     1.1 --- a/src/lemon/preflow.h	Fri Mar 18 06:00:20 2005 +0000
     1.2 +++ b/src/lemon/preflow.h	Sat Mar 19 09:38:31 2005 +0000
     1.3 @@ -59,6 +59,7 @@
     1.4    ///\param FlowMap The flow map type.
     1.5    ///
     1.6    ///\author Jacint Szabo 
     1.7 +  ///\todo Second template parameter is superfluous
     1.8    template <typename Graph, typename Num,
     1.9  	    typename CapacityMap=typename Graph::template EdgeMap<Num>,
    1.10              typename FlowMap=typename Graph::template EdgeMap<Num> >
    1.11 @@ -407,7 +408,7 @@
    1.12  
    1.13        std::queue<Node> queue;
    1.14        M.set(_source,true);
    1.15 -      queue.push(s);
    1.16 +      queue.push(_source);
    1.17        
    1.18        while (!queue.empty()) {
    1.19  	Node w=queue.front();
    1.20 @@ -845,10 +846,23 @@
    1.21      } //relabel
    1.22  
    1.23    }; 
    1.24 +
    1.25 +  ///Function type interface for Preflow algorithm.
    1.26 +
    1.27 +  /// \ingroup flowalgs
    1.28 +  ///Function type interface for Preflow algorithm.
    1.29 +  ///\sa Preflow
    1.30 +  template<class GR, class CM, class FM>
    1.31 +  Preflow<GR,typename CM::Value,CM,FM> preflow(const GR &g,
    1.32 +			    typename GR::Node source,
    1.33 +			    typename GR::Node target,
    1.34 +			    const CM &cap,
    1.35 +			    FM &flow
    1.36 +			    )
    1.37 +  {
    1.38 +    return Preflow<GR,typename CM::Value,CM,FM>(g,source,target,cap,flow);
    1.39 +  }
    1.40 +
    1.41  } //namespace lemon
    1.42  
    1.43  #endif //LEMON_PREFLOW_H
    1.44 -
    1.45 -
    1.46 -
    1.47 -