[Lemon-commits] [lemon_svn] alpar: r2181 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:50:44 CET 2006
Author: alpar
Date: Tue Aug 30 16:55:11 2005
New Revision: 2181
Modified:
hugo/trunk/lemon/bfs.h
hugo/trunk/lemon/dfs.h
hugo/trunk/lemon/dijkstra.h
Log:
Functions to query the next node/edge to be processed.
Modified: hugo/trunk/lemon/bfs.h
==============================================================================
--- hugo/trunk/lemon/bfs.h (original)
+++ hugo/trunk/lemon/bfs.h Tue Aug 30 16:55:11 2005
@@ -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
///
Modified: hugo/trunk/lemon/dfs.h
==============================================================================
--- hugo/trunk/lemon/dfs.h (original)
+++ hugo/trunk/lemon/dfs.h Tue Aug 30 16:55:11 2005
@@ -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.
Modified: hugo/trunk/lemon/dijkstra.h
==============================================================================
--- hugo/trunk/lemon/dijkstra.h (original)
+++ hugo/trunk/lemon/dijkstra.h Tue Aug 30 16:55:11 2005
@@ -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
///
More information about the Lemon-commits
mailing list