Small changes in the documentation.
authorkpeter
Tue, 20 Nov 2007 21:40:55 +0000
changeset 2517d9cfac072869
parent 2516 6a30e13a1c79
child 2518 4c0a23bd70b5
Small changes in the documentation.
lemon/bellman_ford.h
lemon/min_mean_cycle.h
     1.1 --- a/lemon/bellman_ford.h	Tue Nov 20 15:06:03 2007 +0000
     1.2 +++ b/lemon/bellman_ford.h	Tue Nov 20 21:40:55 2007 +0000
     1.3 @@ -435,7 +435,7 @@
     1.4      /// after each iteration the \ref predMap() map and manually build
     1.5      /// the path.
     1.6      ///
     1.7 -    /// \return %True when the algorithm have not found more shorter
     1.8 +    /// \return \c true when the algorithm have not found more shorter
     1.9      /// paths.
    1.10      bool processNextRound() {
    1.11        for (int i = 0; i < int(_process.size()); ++i) {
    1.12 @@ -472,7 +472,7 @@
    1.13      /// This function does not make it possible to calculate strictly the
    1.14      /// at most k length minimal paths, this is why it is
    1.15      /// called just weak round.
    1.16 -    /// \return %True when the algorithm have not found more shorter paths.
    1.17 +    /// \return \c true when the algorithm have not found more shorter paths.
    1.18      bool processNextWeakRound() {
    1.19        for (int i = 0; i < int(_process.size()); ++i) {
    1.20  	_mask->set(_process[i], false);
    1.21 @@ -517,14 +517,15 @@
    1.22      /// \brief Executes the algorithm and checks the negative cycles.
    1.23      ///
    1.24      /// \pre init() must be called and at least one node should be added
    1.25 -    /// with addSource() before using this function. If there is
    1.26 -    /// a negative cycle in the graph it gives back false.
    1.27 +    /// with addSource() before using this function. 
    1.28      ///
    1.29      /// This method runs the %BellmanFord algorithm from the root node(s)
    1.30      /// in order to compute the shortest path to each node. The algorithm 
    1.31      /// computes 
    1.32      /// - The shortest path tree.
    1.33      /// - The distance of each node from the root(s).
    1.34 +    /// 
    1.35 +    /// \return \c false if there is a negative cycle in the graph.
    1.36      bool checkedStart() {
    1.37        int num = countNodes(*graph);
    1.38        for (int i = 0; i < num; ++i) {
     2.1 --- a/lemon/min_mean_cycle.h	Tue Nov 20 15:06:03 2007 +0000
     2.2 +++ b/lemon/min_mean_cycle.h	Tue Nov 20 21:40:55 2007 +0000
     2.3 @@ -250,8 +250,8 @@
     2.4      ///
     2.5      /// \return \c true if a cycle exists in the graph.
     2.6      ///
     2.7 -    /// \note Apart from the return value, m.run() is just a shortcut
     2.8 -    /// of the following code.
     2.9 +    /// \note Apart from the return value, <tt>m.run()</tt> is just a
    2.10 +    /// shortcut of the following code.
    2.11      /// \code
    2.12      ///   m.init();
    2.13      ///   m.findMinMean();
    2.14 @@ -264,6 +264,10 @@
    2.15      }
    2.16  
    2.17      /// \brief Initializes the internal data structures.
    2.18 +    ///
    2.19 +    /// Initializes the internal data structures.
    2.20 +    ///
    2.21 +    /// \sa reset()
    2.22      void init() {
    2.23        comp_num = stronglyConnectedComponents(graph, comp);
    2.24        if (!cycle_path) {
    2.25 @@ -341,6 +345,8 @@
    2.26      /// Resets the internal data structures so that \ref findMinMean()
    2.27      /// and \ref findCycle() can be called again (e.g. when the
    2.28      /// underlaying graph has been modified).
    2.29 +    ///
    2.30 +    /// \sa init()
    2.31      void reset() {
    2.32        for (NodeIt u(graph); u != INVALID; ++u)
    2.33  	dmap[u].clear();
    2.34 @@ -353,7 +359,9 @@
    2.35      ///
    2.36      /// Returns the total length of the found cycle.
    2.37      ///
    2.38 -    /// \pre \ref run() must be called before using this function.
    2.39 +    /// \pre \ref run() or \ref findCycle() must be called before
    2.40 +    /// using this function. If only \ref findMinMean() is called,
    2.41 +    /// the return value is not valid.
    2.42      Length cycleLength() const {
    2.43        return cycle_length;
    2.44      }
    2.45 @@ -362,7 +370,9 @@
    2.46      ///
    2.47      /// Returns the number of edges in the found cycle.
    2.48      ///
    2.49 -    /// \pre \ref run() must be called before using this function.
    2.50 +    /// \pre \ref run() or \ref findCycle() must be called before
    2.51 +    /// using this function. If only \ref findMinMean() is called,
    2.52 +    /// the return value is not valid.
    2.53      int cycleEdgeNum() const {
    2.54        return cycle_size;
    2.55      }
    2.56 @@ -371,14 +381,19 @@
    2.57      ///
    2.58      /// Returns the mean length of the found cycle.
    2.59      ///
    2.60 -    /// \pre \ref run() must be called before using this function.
    2.61 +    /// \pre \ref run() or \ref findMinMean() must be called before
    2.62 +    /// using this function.
    2.63      ///
    2.64      /// \warning LengthMap::Value must be convertible to double.
    2.65      ///
    2.66 -    /// \note m.minMean() is just a shortcut of the following code.
    2.67 +    /// \note <tt>m.minMean()</tt> is just a shortcut of the following
    2.68 +    /// code.
    2.69      /// \code
    2.70 -    ///   return m.cycleEdgeNum() / double(m.cycleLength());
    2.71 +    ///   return m.cycleLength() / double(m.cycleEdgeNum());
    2.72      /// \endcode
    2.73 +    /// However if only \ref findMinMean() is called before using this
    2.74 +    /// function, <tt>m.cycleLength()</tt> and <tt>m.cycleEdgeNum()</tt>
    2.75 +    /// are not valid alone, only their ratio is valid.
    2.76      double minMean() const {
    2.77        return cycle_length / (double)cycle_size;
    2.78      }