[Lemon-commits] Peter Kovacs: Small doc improvements (#304)
Lemon HG
hg at lemon.cs.elte.hu
Fri Sep 25 09:15:40 CEST 2009
details: http://lemon.cs.elte.hu/hg/lemon/rev/f47b6c94577e
changeset: 769:f47b6c94577e
user: Peter Kovacs <kpeter [at] inf.elte.hu>
date: Sun Aug 02 12:40:20 2009 +0200
description:
Small doc improvements (#304)
diffstat:
lemon/bfs.h | 113 +++++++++++++++++++++++++++-----------------------------
lemon/dfs.h | 107 +++++++++++++++++++++++++----------------------------
lemon/dijkstra.h | 116 +++++++++++++++++++++++++++++-----------------------------
lemon/maps.h | 4 +-
4 files changed, 166 insertions(+), 174 deletions(-)
diffs (truncated from 1026 to 300 lines):
diff --git a/lemon/bfs.h b/lemon/bfs.h
--- a/lemon/bfs.h
+++ b/lemon/bfs.h
@@ -47,7 +47,7 @@
///
///The type of the map that stores the predecessor
///arcs of the shortest paths.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
///Instantiates a \c PredMap.
@@ -62,7 +62,8 @@
///The type of the map that indicates which nodes are processed.
///The type of the map that indicates which nodes are processed.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
+ ///By default it is a NullMap.
typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
///Instantiates a \c ProcessedMap.
@@ -81,7 +82,7 @@
///The type of the map that indicates which nodes are reached.
///The type of the map that indicates which nodes are reached.
- ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap<bool> ReachedMap;
///Instantiates a \c ReachedMap.
@@ -96,7 +97,7 @@
///The type of the map that stores the distances of the nodes.
///The type of the map that stores the distances of the nodes.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
typedef typename Digraph::template NodeMap<int> DistMap;
///Instantiates a \c DistMap.
@@ -225,7 +226,7 @@
///
///\ref named-templ-param "Named parameter" for setting
///\c PredMap type.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
template <class T>
struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {
typedef Bfs< Digraph, SetPredMapTraits<T> > Create;
@@ -245,7 +246,7 @@
///
///\ref named-templ-param "Named parameter" for setting
///\c DistMap type.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
template <class T>
struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {
typedef Bfs< Digraph, SetDistMapTraits<T> > Create;
@@ -265,7 +266,7 @@
///
///\ref named-templ-param "Named parameter" for setting
///\c ReachedMap type.
- ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
template <class T>
struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {
typedef Bfs< Digraph, SetReachedMapTraits<T> > Create;
@@ -285,7 +286,7 @@
///
///\ref named-templ-param "Named parameter" for setting
///\c ProcessedMap type.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
template <class T>
struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {
typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create;
@@ -737,9 +738,9 @@
///@{
- ///The shortest path to a node.
+ ///The shortest path to the given node.
- ///Returns the shortest path to a node.
+ ///Returns the shortest path to the given node from the root(s).
///
///\warning \c t should be reached from the root(s).
///
@@ -747,9 +748,9 @@
///must be called before using this function.
Path path(Node t) const { return Path(*G, *_pred, t); }
- ///The distance of a node from the root(s).
+ ///The distance of the given node from the root(s).
- ///Returns the distance of a node from the root(s).
+ ///Returns the distance of the given node from the root(s).
///
///\warning If node \c v is not reached from the root(s), then
///the return value of this function is undefined.
@@ -758,29 +759,31 @@
///must be called before using this function.
int dist(Node v) const { return (*_dist)[v]; }
- ///Returns the 'previous arc' of the shortest path tree for a node.
-
+ ///\brief Returns the 'previous arc' of the shortest path tree for
+ ///the given node.
+ ///
///This function returns the 'previous arc' of the shortest path
///tree for the node \c v, i.e. it returns the last arc of a
///shortest path from a root to \c v. It is \c INVALID if \c v
///is not reached from the root(s) or if \c v is a root.
///
///The shortest path tree used here is equal to the shortest path
- ///tree used in \ref predNode().
+ ///tree used in \ref predNode() and \ref predMap().
///
///\pre Either \ref run(Node) "run()" or \ref init()
///must be called before using this function.
Arc predArc(Node v) const { return (*_pred)[v];}
- ///Returns the 'previous node' of the shortest path tree for a node.
-
+ ///\brief Returns the 'previous node' of the shortest path tree for
+ ///the given node.
+ ///
///This function returns the 'previous node' of the shortest path
///tree for the node \c v, i.e. it returns the last but one node
- ///from a shortest path from a root to \c v. It is \c INVALID
+ ///of a shortest path from a root to \c v. It is \c INVALID
///if \c v is not reached from the root(s) or if \c v is a root.
///
///The shortest path tree used here is equal to the shortest path
- ///tree used in \ref predArc().
+ ///tree used in \ref predArc() and \ref predMap().
///
///\pre Either \ref run(Node) "run()" or \ref init()
///must be called before using this function.
@@ -801,13 +804,13 @@
///predecessor arcs.
///
///Returns a const reference to the node map that stores the predecessor
- ///arcs, which form the shortest path tree.
+ ///arcs, which form the shortest path tree (forest).
///
///\pre Either \ref run(Node) "run()" or \ref init()
///must be called before using this function.
const PredMap &predMap() const { return *_pred;}
- ///Checks if a node is reached from the root(s).
+ ///Checks if the given node is reached from the root(s).
///Returns \c true if \c v is reached from the root(s).
///
@@ -833,7 +836,7 @@
///
///The type of the map that stores the predecessor
///arcs of the shortest paths.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
///Instantiates a PredMap.
@@ -848,7 +851,7 @@
///The type of the map that indicates which nodes are processed.
///The type of the map that indicates which nodes are processed.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
///By default it is a NullMap.
typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
///Instantiates a ProcessedMap.
@@ -868,7 +871,7 @@
///The type of the map that indicates which nodes are reached.
///The type of the map that indicates which nodes are reached.
- ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+ ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
typedef typename Digraph::template NodeMap<bool> ReachedMap;
///Instantiates a ReachedMap.
@@ -883,7 +886,7 @@
///The type of the map that stores the distances of the nodes.
///The type of the map that stores the distances of the nodes.
- ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
+ ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
typedef typename Digraph::template NodeMap<int> DistMap;
///Instantiates a DistMap.
@@ -898,18 +901,14 @@
///The type of the shortest paths.
///The type of the shortest paths.
- ///It must meet the \ref concepts::Path "Path" concept.
+ ///It must conform to the \ref concepts::Path "Path" concept.
typedef lemon::Path<Digraph> Path;
};
/// Default traits class used by BfsWizard
- /// To make it easier to use Bfs algorithm
- /// we have created a wizard class.
- /// This \ref BfsWizard class needs default traits,
- /// as well as the \ref Bfs class.
- /// The \ref BfsWizardBase is a class to be the default traits of the
- /// \ref BfsWizard class.
+ /// Default traits class used by BfsWizard.
+ /// \tparam GR The type of the digraph.
template<class GR>
class BfsWizardBase : public BfsWizardDefaultTraits<GR>
{
@@ -937,7 +936,7 @@
public:
/// Constructor.
- /// This constructor does not require parameters, therefore it initiates
+ /// This constructor does not require parameters, it initiates
/// all of the attributes to \c 0.
BfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
_dist(0), _path(0), _di(0) {}
@@ -967,7 +966,6 @@
{
typedef TR Base;
- ///The type of the digraph the algorithm runs on.
typedef typename TR::Digraph Digraph;
typedef typename Digraph::Node Node;
@@ -975,16 +973,10 @@
typedef typename Digraph::Arc Arc;
typedef typename Digraph::OutArcIt OutArcIt;
- ///\brief The type of the map that stores the predecessor
- ///arcs of the shortest paths.
typedef typename TR::PredMap PredMap;
- ///\brief The type of the map that stores the distances of the nodes.
typedef typename TR::DistMap DistMap;
- ///\brief The type of the map that indicates which nodes are reached.
typedef typename TR::ReachedMap ReachedMap;
- ///\brief The type of the map that indicates which nodes are processed.
typedef typename TR::ProcessedMap ProcessedMap;
- ///The type of the shortest paths
typedef typename TR::Path Path;
public:
@@ -1067,11 +1059,12 @@
static PredMap *createPredMap(const Digraph &) { return 0; };
SetPredMapBase(const TR &b) : TR(b) {}
};
- ///\brief \ref named-func-param "Named parameter"
- ///for setting PredMap object.
+
+ ///\brief \ref named-templ-param "Named parameter" for setting
+ ///the predecessor map.
///
- ///\ref named-func-param "Named parameter"
- ///for setting PredMap object.
+ ///\ref named-templ-param "Named parameter" function for setting
+ ///the map that stores the predecessor arcs of the nodes.
template<class T>
BfsWizard<SetPredMapBase<T> > predMap(const T &t)
{
@@ -1085,11 +1078,12 @@
static ReachedMap *createReachedMap(const Digraph &) { return 0; };
SetReachedMapBase(const TR &b) : TR(b) {}
};
- ///\brief \ref named-func-param "Named parameter"
- ///for setting ReachedMap object.
+
+ ///\brief \ref named-templ-param "Named parameter" for setting
+ ///the reached map.
///
- /// \ref named-func-param "Named parameter"
- ///for setting ReachedMap object.
+ ///\ref named-templ-param "Named parameter" function for setting
+ ///the map that indicates which nodes are reached.
template<class T>
BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
{
@@ -1103,11 +1097,13 @@
static DistMap *createDistMap(const Digraph &) { return 0; };
SetDistMapBase(const TR &b) : TR(b) {}
};
- ///\brief \ref named-func-param "Named parameter"
- ///for setting DistMap object.
+
+ ///\brief \ref named-templ-param "Named parameter" for setting
+ ///the distance map.
///
- /// \ref named-func-param "Named parameter"
- ///for setting DistMap object.
+ ///\ref named-templ-param "Named parameter" function for setting
+ ///the map that stores the distances of the nodes calculated
+ ///by the algorithm.
template<class T>
BfsWizard<SetDistMapBase<T> > distMap(const T &t)
{
@@ -1121,11 +1117,12 @@
More information about the Lemon-commits
mailing list