# HG changeset patch
# User kpeter
# Date 1195594855 0
# Node ID d9cfac0728699ff89c2874a691a24209fa510148
# Parent 6a30e13a1c7906f0c5b6cca78bac6add2303f628
Small changes in the documentation.
diff -r 6a30e13a1c79 -r d9cfac072869 lemon/bellman_ford.h
--- a/lemon/bellman_ford.h Tue Nov 20 15:06:03 2007 +0000
+++ b/lemon/bellman_ford.h Tue Nov 20 21:40:55 2007 +0000
@@ -435,7 +435,7 @@
/// after each iteration the \ref predMap() map and manually build
/// the path.
///
- /// \return %True when the algorithm have not found more shorter
+ /// \return \c true when the algorithm have not found more shorter
/// paths.
bool processNextRound() {
for (int i = 0; i < int(_process.size()); ++i) {
@@ -472,7 +472,7 @@
/// This function does not make it possible to calculate strictly the
/// at most k length minimal paths, this is why it is
/// called just weak round.
- /// \return %True when the algorithm have not found more shorter paths.
+ /// \return \c true when the algorithm have not found more shorter paths.
bool processNextWeakRound() {
for (int i = 0; i < int(_process.size()); ++i) {
_mask->set(_process[i], false);
@@ -517,14 +517,15 @@
/// \brief Executes the algorithm and checks the negative cycles.
///
/// \pre init() must be called and at least one node should be added
- /// with addSource() before using this function. If there is
- /// a negative cycle in the graph it gives back false.
+ /// with addSource() before using this function.
///
/// This method runs the %BellmanFord algorithm from the root node(s)
/// in order to compute the shortest path to each node. The algorithm
/// computes
/// - The shortest path tree.
/// - The distance of each node from the root(s).
+ ///
+ /// \return \c false if there is a negative cycle in the graph.
bool checkedStart() {
int num = countNodes(*graph);
for (int i = 0; i < num; ++i) {
diff -r 6a30e13a1c79 -r d9cfac072869 lemon/min_mean_cycle.h
--- a/lemon/min_mean_cycle.h Tue Nov 20 15:06:03 2007 +0000
+++ b/lemon/min_mean_cycle.h Tue Nov 20 21:40:55 2007 +0000
@@ -250,8 +250,8 @@
///
/// \return \c true if a cycle exists in the graph.
///
- /// \note Apart from the return value, m.run() is just a shortcut
- /// of the following code.
+ /// \note Apart from the return value, m.run() is just a
+ /// shortcut of the following code.
/// \code
/// m.init();
/// m.findMinMean();
@@ -264,6 +264,10 @@
}
/// \brief Initializes the internal data structures.
+ ///
+ /// Initializes the internal data structures.
+ ///
+ /// \sa reset()
void init() {
comp_num = stronglyConnectedComponents(graph, comp);
if (!cycle_path) {
@@ -341,6 +345,8 @@
/// Resets the internal data structures so that \ref findMinMean()
/// and \ref findCycle() can be called again (e.g. when the
/// underlaying graph has been modified).
+ ///
+ /// \sa init()
void reset() {
for (NodeIt u(graph); u != INVALID; ++u)
dmap[u].clear();
@@ -353,7 +359,9 @@
///
/// Returns the total length of the found cycle.
///
- /// \pre \ref run() must be called before using this function.
+ /// \pre \ref run() or \ref findCycle() must be called before
+ /// using this function. If only \ref findMinMean() is called,
+ /// the return value is not valid.
Length cycleLength() const {
return cycle_length;
}
@@ -362,7 +370,9 @@
///
/// Returns the number of edges in the found cycle.
///
- /// \pre \ref run() must be called before using this function.
+ /// \pre \ref run() or \ref findCycle() must be called before
+ /// using this function. If only \ref findMinMean() is called,
+ /// the return value is not valid.
int cycleEdgeNum() const {
return cycle_size;
}
@@ -371,14 +381,19 @@
///
/// Returns the mean length of the found cycle.
///
- /// \pre \ref run() must be called before using this function.
+ /// \pre \ref run() or \ref findMinMean() must be called before
+ /// using this function.
///
/// \warning LengthMap::Value must be convertible to double.
///
- /// \note m.minMean() is just a shortcut of the following code.
+ /// \note m.minMean() is just a shortcut of the following
+ /// code.
/// \code
- /// return m.cycleEdgeNum() / double(m.cycleLength());
+ /// return m.cycleLength() / double(m.cycleEdgeNum());
/// \endcode
+ /// However if only \ref findMinMean() is called before using this
+ /// function, m.cycleLength() and m.cycleEdgeNum()
+ /// are not valid alone, only their ratio is valid.
double minMean() const {
return cycle_length / (double)cycle_size;
}