diff -r 48638058e188 -r bc0c74eeb151 src/hugo/dfs.h --- a/src/hugo/dfs.h Sun Sep 05 20:06:08 2004 +0000 +++ b/src/hugo/dfs.h Sun Sep 05 20:11:47 2004 +0000 @@ -33,9 +33,13 @@ public: ///The type of the underlying graph. typedef GR Graph; + /// . typedef typename Graph::Node Node; + /// . typedef typename Graph::NodeIt NodeIt; + /// . typedef typename Graph::Edge Edge; + /// . typedef typename Graph::OutEdgeIt OutEdgeIt; ///\brief The type of the map that stores the last @@ -48,15 +52,22 @@ typedef typename Graph::template NodeMap DistMap; private: + /// Pointer to the underlying graph. const Graph *G; + ///Pointer to the map of predecessors edges. PredMap *predecessor; + ///Indicates if \ref predecessor is locally allocated (\c true) or not. bool local_predecessor; + ///Pointer to the map of predecessors nodes. PredNodeMap *pred_node; + ///Indicates if \ref pred_node is locally allocated (\c true) or not. bool local_pred_node; + ///Pointer to the map of distances. DistMap *distance; + ///Indicates if \ref distance is locally allocated (\c true) or not. bool local_distance; - //The source node of the last execution. + ///The source node of the last execution. Node source; @@ -78,6 +89,9 @@ } public : + ///Constructor. + + ///\param _G the graph the algorithm will run on. Dfs(const Graph& _G) : G(&_G), predecessor(NULL), local_predecessor(false), @@ -85,6 +99,7 @@ distance(NULL), local_distance(false) { } + ///Destructor. ~Dfs() { if(local_predecessor) delete predecessor; @@ -92,17 +107,6 @@ if(local_distance) delete distance; } - ///Sets the graph the algorithm will run on. - - ///Sets the graph the algorithm will run on. - ///\return (*this) - ///\bug What about maps? - ///\todo It may be unnecessary - Dfs &setGraph(const Graph &_G) - { - G = &_G; - return *this; - } ///Sets the map storing the predecessor edges. ///Sets the map storing the predecessor edges. @@ -253,7 +257,7 @@ ///Checks if a node is reachable from the root. ///Returns \c true if \c v is reachable from the root. - ///\warning The root node is reported to be reached! + ///\note The root node is reported to be reached! /// ///\pre \ref run() must be called before using this function. ///