[Lemon-commits] [lemon_svn] hegyi: r1051 - in hugo/branches/hugo++/src: hugo test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:42:58 CET 2006


Author: hegyi
Date: Fri Aug 27 15:20:43 2004
New Revision: 1051

Modified:
   hugo/branches/hugo++/src/hugo/dijkstra.h
   hugo/branches/hugo++/src/test/dijkstra_test.cc

Log:
Dijkstra kijavitva ++-ra


Modified: hugo/branches/hugo++/src/hugo/dijkstra.h
==============================================================================
--- hugo/branches/hugo++/src/hugo/dijkstra.h	(original)
+++ hugo/branches/hugo++/src/hugo/dijkstra.h	Fri Aug 27 15:20:43 2004
@@ -212,7 +212,7 @@
       
       init_maps();
       
-      for ( NodeIt u(*G) ; G->valid(u) ; G->next(u) ) {
+      for ( NodeIt u(*G) ; u==INVALID ; ++u ) {
 	predecessor->set(u,INVALID);
 	pred_node->set(u,INVALID);
       }
@@ -235,8 +235,8 @@
 	distance->set(v, oldvalue);
 	
 	
-	for(OutEdgeIt e(*G,v); G->valid(e); G->next(e)) {
-	  Node w=G->bNode(e); 
+	for(OutEdgeIt e(*G,v); e==INVALID; ++e) {
+	  Node w=G->head(e); 
 	  
 	  switch(heap.state(w)) {
 	  case HeapType::PRE_HEAP:
@@ -314,7 +314,7 @@
     ///\todo Is this what we want?
     ///\pre \ref run() must be called before using this function.
     ///
-    bool reached(Node v) { return G->valid((*predecessor)[v]); }
+    bool reached(Node v) { return (*predecessor)[v]==INVALID; }
     
   };
   

Modified: hugo/branches/hugo++/src/test/dijkstra_test.cc
==============================================================================
--- hugo/branches/hugo++/src/test/dijkstra_test.cc	(original)
+++ hugo/branches/hugo++/src/test/dijkstra_test.cc	Fri Aug 27 15:20:43 2004
@@ -75,7 +75,7 @@
   check(dijkstra_test.dist(t)==13,"Dijkstra found a wrong path.");
 
 
-  for(EdgeIt e(G); G.valid(e); G.next(e)) {
+  for(EdgeIt e(G); e==INVALID; ++e) {
     Node u=G.tail(e);
     Node v=G.head(e);
     check( !dijkstra_test.reached(u) ||
@@ -86,7 +86,7 @@
   }
 
   ///\bug This works only for integer lengths
-  for(NodeIt v(G); G.valid(v); G.next(v))
+  for(NodeIt v(G); v==INVALID; ++v)
     if ( dijkstra_test.reached(v) ) {
       Edge e=dijkstra_test.pred(v);
       Node u=G.tail(e);



More information about the Lemon-commits mailing list