diff -r bd97feae7d90 -r 7a24bb2e7480 src/lemon/undir_graph_extender.h --- a/src/lemon/undir_graph_extender.h Fri Jan 07 08:50:38 2005 +0000 +++ b/src/lemon/undir_graph_extender.h Fri Jan 07 18:53:02 2005 +0000 @@ -140,53 +140,55 @@ template void _dirFirstOut(E &e, const Node &n) const { - Parent::firstOut(e,n); + Parent::firstIn(e,n); if( UndirEdge(e) != INVALID ) { - e.forward = true; + e.forward = false; } else { - Parent::firstIn(e,n); - e.forward = false; + Parent::firstOut(e,n); + e.forward = true; } } template void _dirFirstIn(E &e, const Node &n) const { - Parent::firstIn(e,n); + Parent::firstOut(e,n); if( UndirEdge(e) != INVALID ) { - e.forward = true; + e.forward = false; } else { - Parent::firstOut(e,n); - e.forward = false; + Parent::firstIn(e,n); + e.forward = true; } } template void _dirNextOut(E &e) const { - if( e.forward ) { + if( ! e.forward ) { + Node n = Parent::target(e); + Parent::nextIn(e); + if( UndirEdge(e) == INVALID ) { + Parent::firstOut(e, n); + e.forward = true; + } + } + else { + Parent::nextOut(e); + } + } + template + void _dirNextIn(E &e) const { + if( ! e.forward ) { + Node n = Parent::source(e); Parent::nextOut(e); if( UndirEdge(e) == INVALID ) { - Parent::firstIn(e, Parent::source(e)); - e.forward = false; + Parent::firstIn(e, n); + e.forward = true; } } else { Parent::nextIn(e); } } - template - void _dirNextIn(E &e) const { - if( e.forward ) { - Parent::nextIn(e); - if( UndirEdge(e) == INVALID ) { - Parent::firstOut(e, Parent::target(e)); - e.forward = false; - } - } - else { - Parent::nextOut(e); - } - } public: @@ -226,7 +228,7 @@ } - int maxId(Node n) const { + int maxId(Node) const { return Parent::maxId(Node()); }