# HG changeset patch # User alpar # Date 1125413711 0 # Node ID fdeb961110ac3f563b34bdd848c8634353ff6afd # Parent 72f1f24b73c9e7a2a59ce21ff2ace7afe8717f0e Functions to query the next node/edge to be processed. diff -r 72f1f24b73c9 -r fdeb961110ac lemon/bfs.h --- a/lemon/bfs.h Tue Aug 30 13:48:40 2005 +0000 +++ b/lemon/bfs.h Tue Aug 30 14:55:11 2005 +0000 @@ -543,6 +543,17 @@ return n; } + ///Next node to be processed. + + ///Next node to be processed. + /// + ///\return The next node to be processed or INVALID if the queue is + /// empty. + Node NextNode() + { + return _queue_tail<_queue_head?_queue[_queue_tail]:INVALID; + } + ///\brief Returns \c false if there are nodes ///to be processed in the queue /// diff -r 72f1f24b73c9 -r fdeb961110ac lemon/dfs.h --- a/lemon/dfs.h Tue Aug 30 13:48:40 2005 +0000 +++ b/lemon/dfs.h Tue Aug 30 14:55:11 2005 +0000 @@ -552,17 +552,30 @@ } return e; } + ///Next edge to be processed. + + ///Next edge to be processed. + /// + ///\return The next edge to be processed or INVALID if the stack is + /// empty. + OutEdgeIt NextEdge() + { + return _stack_head>=0?_stack[_stack_head]:INVALID; + } ///\brief Returns \c false if there are nodes ///to be processed in the queue /// ///Returns \c false if there are nodes ///to be processed in the queue + /// + ///\todo This should be called emptyStack() or some "neutral" name. bool emptyQueue() { return _stack_head<0; } ///Returns the number of the nodes to be processed. ///Returns the number of the nodes to be processed in the queue. /// + ///\todo This should be called stackSize() or some "neutral" name. int queueSize() { return _stack_head+1; } ///Executes the algorithm. diff -r 72f1f24b73c9 -r fdeb961110ac lemon/dijkstra.h --- a/lemon/dijkstra.h Tue Aug 30 13:48:40 2005 +0000 +++ b/lemon/dijkstra.h Tue Aug 30 14:55:11 2005 +0000 @@ -546,6 +546,17 @@ return v; } + ///Next node to be processed. + + ///Next node to be processed. + /// + ///\return The next node to be processed or INVALID if the priority heap + /// is empty. + Node NextNode() + { + return _heap.empty()?_heap.top():INVALID; + } + ///\brief Returns \c false if there are nodes ///to be processed in the priority heap ///