# HG changeset patch
# User Balazs Dezso <deba@inf.elte.hu>
# Date 1218978123 -7200
# Node ID d5bf497757ff9de573dfada21ff06dddcf2c6421
# Parent 32155c88f59b76e6fe775a4a211e28d243a7bc2b
Using arc instead of ArcIt in Dfs
diff -r 32155c88f59b -r d5bf497757ff lemon/dfs.h
a
|
b
|
|
188 | 188 | ///Indicates if \ref _processed is locally allocated (\c true) or not. |
189 | 189 | bool local_processed; |
190 | 190 | |
191 | | std::vector<typename Digraph::OutArcIt> _stack; |
| 191 | std::vector<typename Digraph::Arc> _stack; |
192 | 192 | int _stack_head; |
193 | 193 | |
194 | 194 | ///Creates the maps if necessary. |
… |
… |
|
453 | 453 | { |
454 | 454 | _reached->set(s,true); |
455 | 455 | _pred->set(s,INVALID); |
456 | | OutArcIt e(*G,s); |
| 456 | Arc e; |
| 457 | G->firstOut(e,s); |
457 | 458 | if(e!=INVALID) { |
458 | 459 | _stack[++_stack_head]=e; |
459 | 460 | _dist->set(s,_stack_head); |
… |
… |
|
480 | 481 | _pred->set(m,e); |
481 | 482 | _reached->set(m,true); |
482 | 483 | ++_stack_head; |
483 | | _stack[_stack_head] = OutArcIt(*G, m); |
| 484 | G->firstOut(_stack[_stack_head],m); |
484 | 485 | _dist->set(m,_stack_head); |
485 | 486 | } |
486 | 487 | else { |
487 | 488 | m=G->source(e); |
488 | | ++_stack[_stack_head]; |
| 489 | G->nextOut(_stack[_stack_head]); |
489 | 490 | } |
490 | 491 | while(_stack_head>=0 && _stack[_stack_head]==INVALID) { |
491 | 492 | _processed->set(m,true); |
492 | 493 | --_stack_head; |
493 | 494 | if(_stack_head>=0) { |
494 | 495 | m=G->source(_stack[_stack_head]); |
495 | | ++_stack[_stack_head]; |
| 496 | G->nextOut(_stack[_stack_head]); |
496 | 497 | } |
497 | 498 | } |
498 | 499 | return e; |