src/work/marci/bfs_dfs.h
changeset 646 bd7a69231cf8
parent 615 b6b31b75b522
child 650 588ff2ca55bd
equal deleted inserted replaced
2:229043b90b02 3:f48b2dcbcbd8
   104 	  }
   104 	  }
   105 	}
   105 	}
   106       }
   106       }
   107       return *this;
   107       return *this;
   108     }
   108     }
   109     /// Guess what?
   109     /// Returns true iff the algorithm is finished.
   110     bool finished() const { return bfs_queue.empty(); }
   110     bool finished() const { return bfs_queue.empty(); }
   111     /// The conversion operator makes for converting the bfs-iterator 
   111     /// The conversion operator makes for converting the bfs-iterator 
   112     /// to an \c out-edge-iterator.
   112     /// to an \c out-edge-iterator.
   113     ///\bug Edge have to be in HUGO 0.2
   113     ///\bug Edge have to be in HUGO 0.2
   114     operator OutEdgeIt() const { return actual_edge; }
   114     operator OutEdgeIt() const { return actual_edge; }
   115     /// Guess what?
   115     /// Returns if b-node has been reached just now.
   116     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   116     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   117     /// Guess what?
   117     /// Returns if a-node is examined.
   118     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
   118     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
   119     /// Guess what?
   119     /// Returns a-node of the actual edge, so does if the edge is invalid.
   120     Node aNode() const { return bfs_queue.front(); }
   120     Node aNode() const { return bfs_queue.front(); }
   121     /// Guess what?
   121     /// \pre The actual edge have to be valid.
   122     Node bNode() const { return graph->bNode(actual_edge); }
   122     Node bNode() const { return graph->bNode(actual_edge); }
   123     /// Guess what?
   123     /// Guess what?
   124     const ReachedMap& getReachedMap() const { return reached; }
   124     const ReachedMap& getReachedMap() const { return reached; }
   125     /// Guess what?
   125     /// Guess what?
   126     const std::queue<Node>& getBfsQueue() const { return bfs_queue; }
   126     const std::queue<Node>& getBfsQueue() const { return bfs_queue; }
   247 	//actual_node=G.aNode(dfs_stack.top());
   247 	//actual_node=G.aNode(dfs_stack.top());
   248 	dfs_stack.pop();
   248 	dfs_stack.pop();
   249       }
   249       }
   250       return *this;
   250       return *this;
   251     }
   251     }
   252     /// Guess what?
   252     /// Returns true iff the algorithm is finished.
   253     bool finished() const { return dfs_stack.empty(); }
   253     bool finished() const { return dfs_stack.empty(); }
   254     /// Guess what?
   254     /// The conversion operator makes for converting the bfs-iterator 
       
   255     /// to an \c out-edge-iterator.
       
   256     ///\bug Edge have to be in HUGO 0.2
   255     operator OutEdgeIt() const { return actual_edge; }
   257     operator OutEdgeIt() const { return actual_edge; }
   256     /// Guess what?
   258     /// Returns if b-node has been reached just now.
   257     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   259     bool isBNodeNewlyReached() const { return b_node_newly_reached; }
   258     /// Guess what?
   260     /// Returns if a-node is examined.
   259     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
   261     bool isANodeExamined() const { return !(graph->valid(actual_edge)); }
   260     /// Guess what?
   262     /// Returns a-node of the actual edge, so does if the edge is invalid.
   261     Node aNode() const { return actual_node; /*FIXME*/}
   263     Node aNode() const { return actual_node; /*FIXME*/}
   262     /// Guess what?
   264     /// Returns b-node of the actual edge. 
       
   265     /// \pre The actual edge have to be valid.
   263     Node bNode() const { return graph->bNode(actual_edge); }
   266     Node bNode() const { return graph->bNode(actual_edge); }
   264     /// Guess what?
   267     /// Guess what?
   265     const ReachedMap& getReachedMap() const { return reached; }
   268     const ReachedMap& getReachedMap() const { return reached; }
   266     /// Guess what?
   269     /// Guess what?
   267     const std::stack<OutEdgeIt>& getDfsStack() const { return dfs_stack; }
   270     const std::stack<OutEdgeIt>& getDfsStack() const { return dfs_stack; }