Changeset 468:3a2cb784750a in lemon-0.x for src/work/jacint
- Timestamp:
- 04/29/04 12:41:56 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@619
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/jacint/preflow.h
r466 r468 21 21 void run() 22 22 23 TflowValue() : returns the value of a maximum flow23 Num flowValue() : returns the value of a maximum flow 24 24 25 25 void minMinCut(CutMap& M) : sets M to the characteristic vector of the … … 46 46 namespace hugo { 47 47 48 template <typename Graph, typename T,49 typename CapMap=typename Graph::template EdgeMap< T>,50 typename FlowMap=typename Graph::template EdgeMap< T> >48 template <typename Graph, typename Num, 49 typename CapMap=typename Graph::template EdgeMap<Num>, 50 typename FlowMap=typename Graph::template EdgeMap<Num> > 51 51 class Preflow { 52 52 … … 67 67 int n; //the number of nodes of G 68 68 typename Graph::template NodeMap<int> level; 69 typename Graph::template NodeMap< T> excess;69 typename Graph::template NodeMap<Num> excess; 70 70 71 71 … … 125 125 NodeIt v; 126 126 for(g->first(v); g->valid(v); g->next(v)) { 127 Texc=0;127 Num exc=0; 128 128 129 129 InEdgeIt e; … … 143 143 { 144 144 //Counting the excess of t 145 Texc=0;145 Num exc=0; 146 146 147 147 InEdgeIt e; … … 262 262 263 263 //Returns the maximum value of a flow. 264 TflowValue() {264 Num flowValue() { 265 265 return excess[t]; 266 266 } … … 366 366 } 367 367 368 void resetTarget(Node _t) {t=_t;} 369 void resetSource(Node _s) {s=_s;} 370 371 void resetCap(const CapMap& _cap) { 372 capacity=&_cap; 373 } 368 374 369 void resetTarget (const Node _t) {t=_t;} 370 371 void resetSource (const Node _s) {s=_s;} 372 373 void resetCap (const CapMap& _cap) { 374 capacity=&_cap; 375 } 376 377 void resetFlow (FlowMap& _flow) { 375 void resetFlow(FlowMap& _flow) { 378 376 flow=&_flow; 379 377 } … … 385 383 386 384 int lev=level[w]; 387 Texc=excess[w];385 Num exc=excess[w]; 388 386 int newlevel=n; //bound on the next level of w 389 387 … … 401 399 } 402 400 403 Tcap=(*capacity)[e];404 Tflo=(*flow)[e];405 Tremcap=cap-flo;401 Num cap=(*capacity)[e]; 402 Num flo=(*flow)[e]; 403 Num remcap=cap-flo; 406 404 407 405 if ( remcap >= exc ) { //A nonsaturating push. … … 434 432 } 435 433 436 Tflo=(*flow)[e];434 Num flo=(*flow)[e]; 437 435 438 436 if ( flo >= exc ) { //A nonsaturating push. … … 495 493 for(g->first(e,s); g->valid(e); g->next(e)) 496 494 { 497 Tc=(*capacity)[e];495 Num c=(*capacity)[e]; 498 496 if ( c == 0 ) continue; 499 497 Node w=g->head(e); … … 555 553 for(g->first(e,s); g->valid(e); g->next(e)) 556 554 { 557 Trem=(*capacity)[e]-(*flow)[e];555 Num rem=(*capacity)[e]-(*flow)[e]; 558 556 if ( rem == 0 ) continue; 559 557 Node w=g->head(e); … … 587 585 NNMap& right, int& b, int& k, const bool what_heur ) { 588 586 589 Tlev=level[w];587 Num lev=level[w]; 590 588 591 589 Node right_n=right[w];
Note: See TracChangeset
for help on using the changeset viewer.