src/work/bfs_iterator.hh
changeset 251 f123e5116bc1
parent 158 4f54d89fa9d2
equal deleted inserted replaced
9:5287f6978a2e 10:cb13db69c1a6
   560     BfsIterator4(const Graph& _G) : 
   560     BfsIterator4(const Graph& _G) : 
   561       G(_G), reached(*(new ReachedMap(G /*, false*/))), 
   561       G(_G), reached(*(new ReachedMap(G /*, false*/))), 
   562       own_reached_map(true) { }
   562       own_reached_map(true) { }
   563     ~BfsIterator4() { if (own_reached_map) delete &reached; }
   563     ~BfsIterator4() { if (own_reached_map) delete &reached; }
   564     void pushAndSetReached(NodeIt s) { 
   564     void pushAndSetReached(NodeIt s) { 
       
   565       //std::cout << "mimi" << &reached << std::endl;
   565       reached.set(s, true);
   566       reached.set(s, true);
       
   567       //std::cout << "mumus" << std::endl;
   566       if (bfs_queue.empty()) {
   568       if (bfs_queue.empty()) {
       
   569 	//std::cout << "bibi1" << std::endl;
   567 	bfs_queue.push(s);
   570 	bfs_queue.push(s);
       
   571 	//std::cout << "zizi" << std::endl;
   568 	G.getFirst(actual_edge, s);
   572 	G.getFirst(actual_edge, s);
       
   573 	//std::cout << "kiki" << std::endl;
   569 	if (G.valid(actual_edge)/*.valid()*/) { 
   574 	if (G.valid(actual_edge)/*.valid()*/) { 
   570 	  NodeIt w=G.bNode(actual_edge);
   575 	  NodeIt w=G.bNode(actual_edge);
   571 	  if (!reached.get(w)) {
   576 	  if (!reached.get(w)) {
   572 	    bfs_queue.push(w);
   577 	    bfs_queue.push(w);
   573 	    reached.set(w, true);
   578 	    reached.set(w, true);
   575 	  } else {
   580 	  } else {
   576 	    b_node_newly_reached=false;
   581 	    b_node_newly_reached=false;
   577 	  }
   582 	  }
   578 	} 
   583 	} 
   579       } else {
   584       } else {
       
   585 	//std::cout << "bibi2" << std::endl;
   580 	bfs_queue.push(s);
   586 	bfs_queue.push(s);
   581       }
   587       }
   582     }
   588     }
   583     BfsIterator4<Graph, OutEdgeIt, ReachedMap>& 
   589     BfsIterator4<Graph, OutEdgeIt, ReachedMap>& 
   584     operator++() { 
   590     operator++() {