src/work/bfs_iterator.h
changeset 299 54e8905344ba
parent 260 fb27d1c7036e
equal deleted inserted replaced
2:0d8b7d98935d 3:ee84749df31b
   794       own_reached_map(true) { }
   794       own_reached_map(true) { }
   795     ~DfsIterator5() { if (own_reached_map) delete &reached; }
   795     ~DfsIterator5() { if (own_reached_map) delete &reached; }
   796     void pushAndSetReached(Node s) { 
   796     void pushAndSetReached(Node s) { 
   797       actual_node=s;
   797       actual_node=s;
   798       reached.set(s, true);
   798       reached.set(s, true);
   799       dfs_stack.push(G.template first<OutEdgeIt>(s)); 
   799       OutEdgeIt e;
       
   800       G.first(e, s);
       
   801       dfs_stack.push(e); 
   800     }
   802     }
   801     DfsIterator5<GraphWrapper, /*OutEdgeIt,*/ ReachedMap>& 
   803     DfsIterator5<GraphWrapper, /*OutEdgeIt,*/ ReachedMap>& 
   802     operator++() { 
   804     operator++() { 
   803       actual_edge=dfs_stack.top();
   805       actual_edge=dfs_stack.top();
   804       //actual_node=G.aNode(actual_edge);
   806       //actual_node=G.aNode(actual_edge);
   805       if (G.valid(actual_edge)/*.valid()*/) { 
   807       if (G.valid(actual_edge)/*.valid()*/) { 
   806 	Node w=G.bNode(actual_edge);
   808 	Node w=G.bNode(actual_edge);
   807 	actual_node=w;
   809 	actual_node=w;
   808 	if (!reached.get(w)) {
   810 	if (!reached.get(w)) {
   809 	  dfs_stack.push(G.template first<OutEdgeIt>(w));
   811 	  OutEdgeIt e;
       
   812 	  G.first(e, w);
       
   813 	  dfs_stack.push(e);
   810 	  reached.set(w, true);
   814 	  reached.set(w, true);
   811 	  b_node_newly_reached=true;
   815 	  b_node_newly_reached=true;
   812 	} else {
   816 	} else {
   813 	  actual_node=G.aNode(actual_edge);
   817 	  actual_node=G.aNode(actual_edge);
   814 	  /*++*/G.next(dfs_stack.top());
   818 	  /*++*/G.next(dfs_stack.top());