[Lemon-commits] [lemon_svn] alpar: r1150 - hugo/trunk/src/hugo
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:43:32 CET 2006
Author: alpar
Date: Tue Sep 14 12:29:47 2004
New Revision: 1150
Modified:
hugo/trunk/src/hugo/minlengthpaths.h
hugo/trunk/src/hugo/preflow.h
Log:
Changes in doc.
Modified: hugo/trunk/src/hugo/minlengthpaths.h
==============================================================================
--- hugo/trunk/src/hugo/minlengthpaths.h (original)
+++ hugo/trunk/src/hugo/minlengthpaths.h Tue Sep 14 12:29:47 2004
@@ -66,7 +66,7 @@
///Runs the algorithm.
///Returns k if there are at least k edge-disjoint paths from s to t.
- ///Otherwise it returns the number of found edge-disjoint paths from s to t.
+ ///Otherwise it returns the number of found edge-disjoint paths from s to t.
int run(Node s, Node t, int k) {
int i = mincost_flow.run(s,t,k);
@@ -111,34 +111,51 @@
}
+ ///Total length of the paths
+
///This function gives back the total length of the found paths.
- ///Assumes that \c run() has been run and nothing changed since then.
+ ///\pre \ref run() must
+ ///be called before using this function.
Length totalLength(){
return mincost_flow.totalLength();
}
- ///Returns a const reference to the EdgeMap \c flow. \pre \ref run() must
+ ///Return the found flow.
+
+ ///This function returns a const reference to the EdgeMap \c flow.
+ ///\pre \ref run() must
///be called before using this function.
const EdgeIntMap &getFlow() const { return mincost_flow.flow;}
- ///Returns a const reference to the NodeMap \c potential (the dual solution).
+ /// Return the optimal dual solution
+
+ ///This function returns a const reference to the NodeMap
+ ///\c potential (the dual solution).
/// \pre \ref run() must be called before using this function.
const EdgeIntMap &getPotential() const { return mincost_flow.potential;}
+ ///Checks whether the complementary slackness holds.
+
///This function checks, whether the given solution is optimal
///Running after a \c run() should return with true
- ///In this "state of the art" this only checks optimality, doesn't bother with feasibility
+ ///Currently this function only checks optimality,
+ ///doesn't bother with feasibility
///
///\todo Is this OK here?
bool checkComplementarySlackness(){
return mincost_flow.checkComplementarySlackness();
}
+ ///Read the found paths.
+
///This function gives back the \c j-th path in argument p.
///Assumes that \c run() has been run and nothing changed since then.
- /// \warning It is assumed that \c p is constructed to be a path of graph \c G. If \c j is not less than the result of previous \c run, then the result here will be an empty path (\c j can be 0 as well).
- template<typename DirPath>
- void getPath(DirPath& p, size_t j){
+ /// \warning It is assumed that \c p is constructed to
+ ///be a path of graph \c G.
+ ///If \c j is not less than the result of previous \c run,
+ ///then the result here will be an empty path (\c j can be 0 as well).
+ template<typename Path>
+ void getPath(Path& p, size_t j){
p.clear();
if (j>paths.size()-1){
Modified: hugo/trunk/src/hugo/preflow.h
==============================================================================
--- hugo/trunk/src/hugo/preflow.h (original)
+++ hugo/trunk/src/hugo/preflow.h Tue Sep 14 12:29:47 2004
@@ -16,22 +16,22 @@
/// \addtogroup flowalgs
/// @{
- ///Preflow algorithms class.
+ ///%Preflow algorithms class.
///This class provides an implementation of the \e preflow \e
///algorithm producing a flow of maximum value in a directed
///graph. The preflow algorithms are the fastest max flow algorithms
- ///up-to-date. The \e source node, the \e target node, the \e
+ ///up to now. The \e source node, the \e target node, the \e
///capacity of the edges and the \e starting \e flow value of the
///edges should be passed to the algorithm through the
///constructor. It is possible to change these quantities using the
///functions \ref setSource, \ref setTarget, \ref setCap and \ref
///setFlow.
///
- ///After running \c phase1 or \c preflow, the actual flow
+ ///After running \ref phase1() or \ref preflow(), the actual flow
///value can be obtained by calling \ref flowValue(). The minimum
- ///value cut can be written into a \c node map of \c bools by
- ///calling \ref minCut. (\ref minMinCut and \ref maxMinCut writes
+ ///value cut can be written into a <tt>bool</tt> node map by
+ ///calling \ref minCut(). (\ref minMinCut() and \ref maxMinCut() writes
///the inclusionwise minimum and maximum of the minimum value cuts,
///resp.)
///
@@ -129,7 +129,8 @@
///Runs the preflow algorithm.
- ///Runs the preflow algorithm.
+ ///Runs the preflow algorithm.
+ ///
void run() {
phase1(flow_prop);
phase2();
@@ -157,7 +158,7 @@
///minimum value cut can already be computed, though a maximum flow
///is not yet obtained. So after calling this method \ref flowValue
///and \ref minCut gives proper results.
- ///\warning: \ref minMinCut and \ref maxMinCut do not
+ ///\warning \ref minMinCut and \ref maxMinCut do not
///give minimum value cuts unless calling \ref phase2.
///\pre The starting flow must be
/// - a constant zero flow if \c fp is \c ZERO_FLOW,
@@ -178,7 +179,7 @@
///minimum value cut can already be computed, though a maximum flow
///is not yet obtained. So after calling this method \ref flowValue
///and \ref actMinCut gives proper results.
- ///\warning: \ref minCut, \ref minMinCut and \ref maxMinCut do not
+ ///\warning \ref minCut, \ref minMinCut and \ref maxMinCut do not
///give minimum value cuts unless calling \ref phase2.
void phase1()
{
More information about the Lemon-commits
mailing list