src/hugo/dfs.h
changeset 802 bc0c74eeb151
parent 781 d4d182ab75bd
child 906 17f31d280385
     1.1 --- a/src/hugo/dfs.h	Sun Sep 05 20:06:08 2004 +0000
     1.2 +++ b/src/hugo/dfs.h	Sun Sep 05 20:11:47 2004 +0000
     1.3 @@ -33,9 +33,13 @@
     1.4    public:
     1.5      ///The type of the underlying graph.
     1.6      typedef GR Graph;
     1.7 +    /// .
     1.8      typedef typename Graph::Node Node;
     1.9 +    /// .
    1.10      typedef typename Graph::NodeIt NodeIt;
    1.11 +    /// .
    1.12      typedef typename Graph::Edge Edge;
    1.13 +    /// .
    1.14      typedef typename Graph::OutEdgeIt OutEdgeIt;
    1.15      
    1.16      ///\brief The type of the map that stores the last
    1.17 @@ -48,15 +52,22 @@
    1.18      typedef typename Graph::template NodeMap<int> DistMap;
    1.19  
    1.20    private:
    1.21 +    /// Pointer to the underlying graph.
    1.22      const Graph *G;
    1.23 +    ///Pointer to the map of predecessors edges.
    1.24      PredMap *predecessor;
    1.25 +    ///Indicates if \ref predecessor is locally allocated (\c true) or not.
    1.26      bool local_predecessor;
    1.27 +    ///Pointer to the map of predecessors nodes.
    1.28      PredNodeMap *pred_node;
    1.29 +    ///Indicates if \ref pred_node is locally allocated (\c true) or not.
    1.30      bool local_pred_node;
    1.31 +    ///Pointer to the map of distances.
    1.32      DistMap *distance;
    1.33 +    ///Indicates if \ref distance is locally allocated (\c true) or not.
    1.34      bool local_distance;
    1.35  
    1.36 -    //The source node of the last execution.
    1.37 +    ///The source node of the last execution.
    1.38      Node source;
    1.39  
    1.40  
    1.41 @@ -78,6 +89,9 @@
    1.42      }
    1.43      
    1.44    public :    
    1.45 +    ///Constructor.
    1.46 +    
    1.47 +    ///\param _G the graph the algorithm will run on.
    1.48      Dfs(const Graph& _G) :
    1.49        G(&_G),
    1.50        predecessor(NULL), local_predecessor(false),
    1.51 @@ -85,6 +99,7 @@
    1.52        distance(NULL), local_distance(false)
    1.53      { }
    1.54      
    1.55 +    ///Destructor.
    1.56      ~Dfs() 
    1.57      {
    1.58        if(local_predecessor) delete predecessor;
    1.59 @@ -92,17 +107,6 @@
    1.60        if(local_distance) delete distance;
    1.61      }
    1.62  
    1.63 -    ///Sets the graph the algorithm will run on.
    1.64 -
    1.65 -    ///Sets the graph the algorithm will run on.
    1.66 -    ///\return <tt> (*this) </tt>
    1.67 -    ///\bug What about maps?
    1.68 -    ///\todo It may be unnecessary
    1.69 -    Dfs &setGraph(const Graph &_G) 
    1.70 -    {
    1.71 -      G = &_G;
    1.72 -      return *this;
    1.73 -    }
    1.74      ///Sets the map storing the predecessor edges.
    1.75  
    1.76      ///Sets the map storing the predecessor edges.
    1.77 @@ -253,7 +257,7 @@
    1.78      ///Checks if a node is reachable from the root.
    1.79  
    1.80      ///Returns \c true if \c v is reachable from the root.
    1.81 -    ///\warning The root node is reported to be reached!
    1.82 +    ///\note The root node is reported to be reached!
    1.83      ///
    1.84      ///\pre \ref run() must be called before using this function.
    1.85      ///