Little bugfixes, spellchecks and improvements
authordeba
Thu, 23 Feb 2006 09:03:18 +0000
changeset 198181c8efe92706
parent 1980 a954b780e3ab
child 1982 f0eb6b79dcdf
Little bugfixes, spellchecks and improvements
lemon/bits/graph_extender.h
lemon/dfs.h
lemon/dijkstra.h
lemon/graph_utils.h
     1.1 --- a/lemon/bits/graph_extender.h	Thu Feb 23 08:55:54 2006 +0000
     1.2 +++ b/lemon/bits/graph_extender.h	Thu Feb 23 09:03:18 2006 +0000
     1.3 @@ -379,7 +379,7 @@
     1.4      /// Returns a directed edge corresponding to the specified UEdge.
     1.5      /// If the given bool is true the given undirected edge and the
     1.6      /// returned edge have the same source node.
     1.7 -    Edge direct(const UEdge &ue, bool d) const {
     1.8 +    static Edge direct(const UEdge &ue, bool d) {
     1.9        return Edge(ue, d);
    1.10      }
    1.11  
    1.12 @@ -388,7 +388,7 @@
    1.13      ///
    1.14      /// \todo reference to the corresponding point of the undirected graph
    1.15      /// concept. "What does the direction of an undirected edge mean?"
    1.16 -    bool direction(const Edge &e) const { return e.forward; }
    1.17 +    static bool direction(const Edge &e) { return e.forward; }
    1.18  
    1.19  
    1.20      using Parent::first;
     2.1 --- a/lemon/dfs.h	Thu Feb 23 08:55:54 2006 +0000
     2.2 +++ b/lemon/dfs.h	Thu Feb 23 09:03:18 2006 +0000
     2.3 @@ -573,6 +573,34 @@
     2.4        while ( !emptyQueue() && !em[_stack[_stack_head]] ) processNextEdge();
     2.5      }
     2.6  
     2.7 +    ///Runs %DFS algorithm to visit all nodes in the graph.
     2.8 +    
     2.9 +    ///This method runs the %DFS algorithm in order to
    2.10 +    ///compute the
    2.11 +    ///%DFS path to each node. The algorithm computes
    2.12 +    ///- The %DFS tree.
    2.13 +    ///- The distance of each node from the root in the %DFS tree.
    2.14 +    ///
    2.15 +    ///\note d.run() is just a shortcut of the following code.
    2.16 +    ///\code
    2.17 +    ///  d.init();
    2.18 +    ///  for (NodeIt it(graph); it != INVALID; ++it) {
    2.19 +    ///    if (!d.reached(it)) {
    2.20 +    ///      d.addSource(it);
    2.21 +    ///      d.start();
    2.22 +    ///    }
    2.23 +    ///  }
    2.24 +    ///\endcode
    2.25 +    void run() {
    2.26 +      init();
    2.27 +      for (NodeIt it(*G); it != INVALID; ++it) {
    2.28 +        if (!reached(it)) {
    2.29 +          addSource(it);
    2.30 +          start();
    2.31 +        }
    2.32 +      }
    2.33 +    }
    2.34 +
    2.35      ///Runs %DFS algorithm from node \c s.
    2.36      
    2.37      ///This method runs the %DFS algorithm from a root node \c s
    2.38 @@ -651,8 +679,8 @@
    2.39  
    2.40      ///Returns the distance of a node from the root(s).
    2.41      ///\pre \ref run() must be called before using this function.
    2.42 -    ///\warning If node \c v is unreachable from the root(s) then the return value
    2.43 -    ///of this funcion is undefined.
    2.44 +    ///\warning If node \c v is unreachable from the root(s) then the return 
    2.45 +    ///value of this funcion is undefined.
    2.46      int dist(Node v) const { return (*_dist)[v]; }
    2.47  
    2.48      ///Returns the 'previous edge' of the %DFS tree.
    2.49 @@ -1440,7 +1468,7 @@
    2.50        while (!emptyQueue() && !em[_stack[_stack_head]]) processNextEdge();
    2.51      }
    2.52  
    2.53 -    /// \brief Runs %DFS algorithm from node \c s.
    2.54 +    /// \brief Runs %DFSVisit algorithm from node \c s.
    2.55      ///
    2.56      /// This method runs the %DFS algorithm from a root node \c s.
    2.57      /// \note d.run(s) is just a shortcut of the following code.
    2.58 @@ -1454,6 +1482,33 @@
    2.59        addSource(s);
    2.60        start();
    2.61      }
    2.62 +
    2.63 +    /// \brief Runs %DFSVisit algorithm to visit all nodes in the graph.
    2.64 +    
    2.65 +    /// This method runs the %DFS algorithm in order to
    2.66 +    /// compute the %DFS path to each node. The algorithm computes
    2.67 +    /// - The %DFS tree.
    2.68 +    /// - The distance of each node from the root in the %DFS tree.
    2.69 +    ///
    2.70 +    ///\note d.run() is just a shortcut of the following code.
    2.71 +    ///\code
    2.72 +    ///  d.init();
    2.73 +    ///  for (NodeIt it(graph); it != INVALID; ++it) {
    2.74 +    ///    if (!d.reached(it)) {
    2.75 +    ///      d.addSource(it);
    2.76 +    ///      d.start();
    2.77 +    ///    }
    2.78 +    ///  }
    2.79 +    ///\endcode
    2.80 +    void run() {
    2.81 +      init();
    2.82 +      for (NodeIt it(*_graph); it != INVALID; ++it) {
    2.83 +        if (!reached(it)) {
    2.84 +          addSource(it);
    2.85 +          start();
    2.86 +        }
    2.87 +      }
    2.88 +    }
    2.89      ///@}
    2.90  
    2.91      /// \name Query Functions
     3.1 --- a/lemon/dijkstra.h	Thu Feb 23 08:55:54 2006 +0000
     3.2 +++ b/lemon/dijkstra.h	Thu Feb 23 09:03:18 2006 +0000
     3.3 @@ -484,7 +484,7 @@
     3.4      ///Sets the heap and the cross reference used by algorithm.
     3.5      ///If you don't use this function before calling \ref run(),
     3.6      ///it will allocate one. The destuctor deallocates this
     3.7 -    ///automatically allocated map, of course.
     3.8 +    ///automatically allocated heap and cross reference, of course.
     3.9      ///\return <tt> (*this) </tt>
    3.10      Dijkstra &heap(Heap& heap, HeapCrossRef &crossRef)
    3.11      {
     4.1 --- a/lemon/graph_utils.h	Thu Feb 23 08:55:54 2006 +0000
     4.2 +++ b/lemon/graph_utils.h	Thu Feb 23 09:03:18 2006 +0000
     4.3 @@ -566,7 +566,7 @@
     4.4        return edgeRefMap;
     4.5      }
     4.6  
     4.7 -    void run() {}
     4.8 +    void run() const {}
     4.9  
    4.10    private:
    4.11      
    4.12 @@ -777,7 +777,7 @@
    4.13        return uEdgeRefMap;
    4.14      }
    4.15  
    4.16 -    void run() {}
    4.17 +    void run() const {}
    4.18  
    4.19    private:
    4.20