diff -r 8cab0547eeae -r 3a2cb784750a src/work/jacint/preflow.h --- a/src/work/jacint/preflow.h Thu Apr 29 10:29:51 2004 +0000 +++ b/src/work/jacint/preflow.h Thu Apr 29 10:41:56 2004 +0000 @@ -20,7 +20,7 @@ void run() -T flowValue() : returns the value of a maximum flow +Num flowValue() : returns the value of a maximum flow void minMinCut(CutMap& M) : sets M to the characteristic vector of the minimum min cut. M should be a map of bools initialized to false. ??Is it OK? @@ -45,9 +45,9 @@ namespace hugo { - template , - typename FlowMap=typename Graph::template EdgeMap > + template , + typename FlowMap=typename Graph::template EdgeMap > class Preflow { typedef typename Graph::Node Node; @@ -66,7 +66,7 @@ FlowMap* flow; int n; //the number of nodes of G typename Graph::template NodeMap level; - typename Graph::template NodeMap excess; + typename Graph::template NodeMap excess; public: @@ -124,7 +124,7 @@ //counting the excess NodeIt v; for(g->first(v); g->valid(v); g->next(v)) { - T exc=0; + Num exc=0; InEdgeIt e; for(g->first(e,v); g->valid(e); g->next(e)) exc+=(*flow)[e]; @@ -142,7 +142,7 @@ case GEN_FLOW: { //Counting the excess of t - T exc=0; + Num exc=0; InEdgeIt e; for(g->first(e,t); g->valid(e); g->next(e)) exc+=(*flow)[e]; @@ -261,7 +261,7 @@ //Returns the maximum value of a flow. - T flowValue() { + Num flowValue() { return excess[t]; } @@ -365,16 +365,14 @@ minMinCut(M); } - - void resetTarget (const Node _t) {t=_t;} - - void resetSource (const Node _s) {s=_s;} + void resetTarget(Node _t) {t=_t;} + void resetSource(Node _s) {s=_s;} - void resetCap (const CapMap& _cap) { + void resetCap(const CapMap& _cap) { capacity=&_cap; } - void resetFlow (FlowMap& _flow) { + void resetFlow(FlowMap& _flow) { flow=&_flow; } @@ -384,7 +382,7 @@ int push(const Node w, VecStack& active) { int lev=level[w]; - T exc=excess[w]; + Num exc=excess[w]; int newlevel=n; //bound on the next level of w OutEdgeIt e; @@ -400,9 +398,9 @@ active[lev_v].push(v); } - T cap=(*capacity)[e]; - T flo=(*flow)[e]; - T remcap=cap-flo; + Num cap=(*capacity)[e]; + Num flo=(*flow)[e]; + Num remcap=cap-flo; if ( remcap >= exc ) { //A nonsaturating push. @@ -433,7 +431,7 @@ active[lev_v].push(v); } - T flo=(*flow)[e]; + Num flo=(*flow)[e]; if ( flo >= exc ) { //A nonsaturating push. @@ -494,7 +492,7 @@ OutEdgeIt e; for(g->first(e,s); g->valid(e); g->next(e)) { - T c=(*capacity)[e]; + Num c=(*capacity)[e]; if ( c == 0 ) continue; Node w=g->head(e); if ( level[w] < n ) { @@ -554,7 +552,7 @@ OutEdgeIt e; for(g->first(e,s); g->valid(e); g->next(e)) { - T rem=(*capacity)[e]-(*flow)[e]; + Num rem=(*capacity)[e]-(*flow)[e]; if ( rem == 0 ) continue; Node w=g->head(e); if ( level[w] < n ) { @@ -586,7 +584,7 @@ VecNode& level_list, NNMap& left, NNMap& right, int& b, int& k, const bool what_heur ) { - T lev=level[w]; + Num lev=level[w]; Node right_n=right[w]; Node left_n=left[w];