COIN-OR::LEMON - Graph Library

Ticket #304: 304-new-doc-impr-f47b6c94577e.patch

File 304-new-doc-impr-f47b6c94577e.patch, 40.9 KB (added by Peter Kovacs, 15 years ago)

Doc improvements (without modifying the interface)

  • lemon/bfs.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1249209620 -7200
    # Node ID f47b6c94577e4eb539cd92afaf0b0316eb1e8ad7
    # Parent  257e91516e09d8d6be58236c587e3e0199770412
    Small doc improvements (#304)
    
    diff --git a/lemon/bfs.h b/lemon/bfs.h
    a b  
    4747    ///
    4848    ///The type of the map that stores the predecessor
    4949    ///arcs of the shortest paths.
    50     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     50    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    5151    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    5252    ///Instantiates a \c PredMap.
    5353
     
    6262    ///The type of the map that indicates which nodes are processed.
    6363
    6464    ///The type of the map that indicates which nodes are processed.
    65     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     65    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     66    ///By default it is a NullMap.
    6667    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    6768    ///Instantiates a \c ProcessedMap.
    6869
     
    8182    ///The type of the map that indicates which nodes are reached.
    8283
    8384    ///The type of the map that indicates which nodes are reached.
    84     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     85    ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    8586    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    8687    ///Instantiates a \c ReachedMap.
    8788
     
    9697    ///The type of the map that stores the distances of the nodes.
    9798
    9899    ///The type of the map that stores the distances of the nodes.
    99     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     100    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    100101    typedef typename Digraph::template NodeMap<int> DistMap;
    101102    ///Instantiates a \c DistMap.
    102103
     
    225226    ///
    226227    ///\ref named-templ-param "Named parameter" for setting
    227228    ///\c PredMap type.
    228     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     229    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    229230    template <class T>
    230231    struct SetPredMap : public Bfs< Digraph, SetPredMapTraits<T> > {
    231232      typedef Bfs< Digraph, SetPredMapTraits<T> > Create;
     
    245246    ///
    246247    ///\ref named-templ-param "Named parameter" for setting
    247248    ///\c DistMap type.
    248     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     249    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    249250    template <class T>
    250251    struct SetDistMap : public Bfs< Digraph, SetDistMapTraits<T> > {
    251252      typedef Bfs< Digraph, SetDistMapTraits<T> > Create;
     
    265266    ///
    266267    ///\ref named-templ-param "Named parameter" for setting
    267268    ///\c ReachedMap type.
    268     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     269    ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    269270    template <class T>
    270271    struct SetReachedMap : public Bfs< Digraph, SetReachedMapTraits<T> > {
    271272      typedef Bfs< Digraph, SetReachedMapTraits<T> > Create;
     
    285286    ///
    286287    ///\ref named-templ-param "Named parameter" for setting
    287288    ///\c ProcessedMap type.
    288     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     289    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    289290    template <class T>
    290291    struct SetProcessedMap : public Bfs< Digraph, SetProcessedMapTraits<T> > {
    291292      typedef Bfs< Digraph, SetProcessedMapTraits<T> > Create;
     
    737738
    738739    ///@{
    739740
    740     ///The shortest path to a node.
     741    ///The shortest path to the given node.
    741742
    742     ///Returns the shortest path to a node.
     743    ///Returns the shortest path to the given node from the root(s).
    743744    ///
    744745    ///\warning \c t should be reached from the root(s).
    745746    ///
     
    747748    ///must be called before using this function.
    748749    Path path(Node t) const { return Path(*G, *_pred, t); }
    749750
    750     ///The distance of a node from the root(s).
     751    ///The distance of the given node from the root(s).
    751752
    752     ///Returns the distance of a node from the root(s).
     753    ///Returns the distance of the given node from the root(s).
    753754    ///
    754755    ///\warning If node \c v is not reached from the root(s), then
    755756    ///the return value of this function is undefined.
     
    758759    ///must be called before using this function.
    759760    int dist(Node v) const { return (*_dist)[v]; }
    760761
    761     ///Returns the 'previous arc' of the shortest path tree for a node.
    762 
     762    ///\brief Returns the 'previous arc' of the shortest path tree for
     763    ///the given node.
     764    ///
    763765    ///This function returns the 'previous arc' of the shortest path
    764766    ///tree for the node \c v, i.e. it returns the last arc of a
    765767    ///shortest path from a root to \c v. It is \c INVALID if \c v
    766768    ///is not reached from the root(s) or if \c v is a root.
    767769    ///
    768770    ///The shortest path tree used here is equal to the shortest path
    769     ///tree used in \ref predNode().
     771    ///tree used in \ref predNode() and \ref predMap().
    770772    ///
    771773    ///\pre Either \ref run(Node) "run()" or \ref init()
    772774    ///must be called before using this function.
    773775    Arc predArc(Node v) const { return (*_pred)[v];}
    774776
    775     ///Returns the 'previous node' of the shortest path tree for a node.
    776 
     777    ///\brief Returns the 'previous node' of the shortest path tree for
     778    ///the given node.
     779    ///
    777780    ///This function returns the 'previous node' of the shortest path
    778781    ///tree for the node \c v, i.e. it returns the last but one node
    779     ///from a shortest path from a root to \c v. It is \c INVALID
     782    ///of a shortest path from a root to \c v. It is \c INVALID
    780783    ///if \c v is not reached from the root(s) or if \c v is a root.
    781784    ///
    782785    ///The shortest path tree used here is equal to the shortest path
    783     ///tree used in \ref predArc().
     786    ///tree used in \ref predArc() and \ref predMap().
    784787    ///
    785788    ///\pre Either \ref run(Node) "run()" or \ref init()
    786789    ///must be called before using this function.
     
    801804    ///predecessor arcs.
    802805    ///
    803806    ///Returns a const reference to the node map that stores the predecessor
    804     ///arcs, which form the shortest path tree.
     807    ///arcs, which form the shortest path tree (forest).
    805808    ///
    806809    ///\pre Either \ref run(Node) "run()" or \ref init()
    807810    ///must be called before using this function.
    808811    const PredMap &predMap() const { return *_pred;}
    809812
    810     ///Checks if a node is reached from the root(s).
     813    ///Checks if the given node is reached from the root(s).
    811814
    812815    ///Returns \c true if \c v is reached from the root(s).
    813816    ///
     
    833836    ///
    834837    ///The type of the map that stores the predecessor
    835838    ///arcs of the shortest paths.
    836     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     839    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    837840    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    838841    ///Instantiates a PredMap.
    839842
     
    848851    ///The type of the map that indicates which nodes are processed.
    849852
    850853    ///The type of the map that indicates which nodes are processed.
    851     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     854    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    852855    ///By default it is a NullMap.
    853856    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    854857    ///Instantiates a ProcessedMap.
     
    868871    ///The type of the map that indicates which nodes are reached.
    869872
    870873    ///The type of the map that indicates which nodes are reached.
    871     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     874    ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    872875    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    873876    ///Instantiates a ReachedMap.
    874877
     
    883886    ///The type of the map that stores the distances of the nodes.
    884887
    885888    ///The type of the map that stores the distances of the nodes.
    886     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     889    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    887890    typedef typename Digraph::template NodeMap<int> DistMap;
    888891    ///Instantiates a DistMap.
    889892
     
    898901    ///The type of the shortest paths.
    899902
    900903    ///The type of the shortest paths.
    901     ///It must meet the \ref concepts::Path "Path" concept.
     904    ///It must conform to the \ref concepts::Path "Path" concept.
    902905    typedef lemon::Path<Digraph> Path;
    903906  };
    904907
    905908  /// Default traits class used by BfsWizard
    906909
    907   /// To make it easier to use Bfs algorithm
    908   /// we have created a wizard class.
    909   /// This \ref BfsWizard class needs default traits,
    910   /// as well as the \ref Bfs class.
    911   /// The \ref BfsWizardBase is a class to be the default traits of the
    912   /// \ref BfsWizard class.
     910  /// Default traits class used by BfsWizard.
     911  /// \tparam GR The type of the digraph.
    913912  template<class GR>
    914913  class BfsWizardBase : public BfsWizardDefaultTraits<GR>
    915914  {
     
    937936    public:
    938937    /// Constructor.
    939938
    940     /// This constructor does not require parameters, therefore it initiates
     939    /// This constructor does not require parameters, it initiates
    941940    /// all of the attributes to \c 0.
    942941    BfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
    943942                      _dist(0), _path(0), _di(0) {}
     
    967966  {
    968967    typedef TR Base;
    969968
    970     ///The type of the digraph the algorithm runs on.
    971969    typedef typename TR::Digraph Digraph;
    972970
    973971    typedef typename Digraph::Node Node;
     
    975973    typedef typename Digraph::Arc Arc;
    976974    typedef typename Digraph::OutArcIt OutArcIt;
    977975
    978     ///\brief The type of the map that stores the predecessor
    979     ///arcs of the shortest paths.
    980976    typedef typename TR::PredMap PredMap;
    981     ///\brief The type of the map that stores the distances of the nodes.
    982977    typedef typename TR::DistMap DistMap;
    983     ///\brief The type of the map that indicates which nodes are reached.
    984978    typedef typename TR::ReachedMap ReachedMap;
    985     ///\brief The type of the map that indicates which nodes are processed.
    986979    typedef typename TR::ProcessedMap ProcessedMap;
    987     ///The type of the shortest paths
    988980    typedef typename TR::Path Path;
    989981
    990982  public:
     
    10671059      static PredMap *createPredMap(const Digraph &) { return 0; };
    10681060      SetPredMapBase(const TR &b) : TR(b) {}
    10691061    };
    1070     ///\brief \ref named-func-param "Named parameter"
    1071     ///for setting PredMap object.
     1062
     1063    ///\brief \ref named-templ-param "Named parameter" for setting
     1064    ///the predecessor map.
    10721065    ///
    1073     ///\ref named-func-param "Named parameter"
    1074     ///for setting PredMap object.
     1066    ///\ref named-templ-param "Named parameter" function for setting
     1067    ///the map that stores the predecessor arcs of the nodes.
    10751068    template<class T>
    10761069    BfsWizard<SetPredMapBase<T> > predMap(const T &t)
    10771070    {
     
    10851078      static ReachedMap *createReachedMap(const Digraph &) { return 0; };
    10861079      SetReachedMapBase(const TR &b) : TR(b) {}
    10871080    };
    1088     ///\brief \ref named-func-param "Named parameter"
    1089     ///for setting ReachedMap object.
     1081
     1082    ///\brief \ref named-templ-param "Named parameter" for setting
     1083    ///the reached map.
    10901084    ///
    1091     /// \ref named-func-param "Named parameter"
    1092     ///for setting ReachedMap object.
     1085    ///\ref named-templ-param "Named parameter" function for setting
     1086    ///the map that indicates which nodes are reached.
    10931087    template<class T>
    10941088    BfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
    10951089    {
     
    11031097      static DistMap *createDistMap(const Digraph &) { return 0; };
    11041098      SetDistMapBase(const TR &b) : TR(b) {}
    11051099    };
    1106     ///\brief \ref named-func-param "Named parameter"
    1107     ///for setting DistMap object.
     1100
     1101    ///\brief \ref named-templ-param "Named parameter" for setting
     1102    ///the distance map.
    11081103    ///
    1109     /// \ref named-func-param "Named parameter"
    1110     ///for setting DistMap object.
     1104    ///\ref named-templ-param "Named parameter" function for setting
     1105    ///the map that stores the distances of the nodes calculated
     1106    ///by the algorithm.
    11111107    template<class T>
    11121108    BfsWizard<SetDistMapBase<T> > distMap(const T &t)
    11131109    {
     
    11211117      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
    11221118      SetProcessedMapBase(const TR &b) : TR(b) {}
    11231119    };
    1124     ///\brief \ref named-func-param "Named parameter"
    1125     ///for setting ProcessedMap object.
     1120
     1121    ///\brief \ref named-func-param "Named parameter" for setting
     1122    ///the processed map.
    11261123    ///
    1127     /// \ref named-func-param "Named parameter"
    1128     ///for setting ProcessedMap object.
     1124    ///\ref named-templ-param "Named parameter" function for setting
     1125    ///the map that indicates which nodes are processed.
    11291126    template<class T>
    11301127    BfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
    11311128    {
     
    12641261    /// \brief The type of the map that indicates which nodes are reached.
    12651262    ///
    12661263    /// The type of the map that indicates which nodes are reached.
    1267     /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     1264    /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    12681265    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    12691266
    12701267    /// \brief Instantiates a ReachedMap.
     
    17351732
    17361733    ///@{
    17371734
    1738     /// \brief Checks if a node is reached from the root(s).
     1735    /// \brief Checks if the given node is reached from the root(s).
    17391736    ///
    17401737    /// Returns \c true if \c v is reached from the root(s).
    17411738    ///
  • lemon/dfs.h

    diff --git a/lemon/dfs.h b/lemon/dfs.h
    a b  
    4747    ///
    4848    ///The type of the map that stores the predecessor
    4949    ///arcs of the %DFS paths.
    50     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     50    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    5151    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    5252    ///Instantiates a \c PredMap.
    5353
     
    6262    ///The type of the map that indicates which nodes are processed.
    6363
    6464    ///The type of the map that indicates which nodes are processed.
    65     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     65    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
     66    ///By default it is a NullMap.
    6667    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    6768    ///Instantiates a \c ProcessedMap.
    6869
     
    8182    ///The type of the map that indicates which nodes are reached.
    8283
    8384    ///The type of the map that indicates which nodes are reached.
    84     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     85    ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    8586    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    8687    ///Instantiates a \c ReachedMap.
    8788
     
    9697    ///The type of the map that stores the distances of the nodes.
    9798
    9899    ///The type of the map that stores the distances of the nodes.
    99     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     100    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    100101    typedef typename Digraph::template NodeMap<int> DistMap;
    101102    ///Instantiates a \c DistMap.
    102103
     
    224225    ///
    225226    ///\ref named-templ-param "Named parameter" for setting
    226227    ///\c PredMap type.
    227     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     228    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    228229    template <class T>
    229230    struct SetPredMap : public Dfs<Digraph, SetPredMapTraits<T> > {
    230231      typedef Dfs<Digraph, SetPredMapTraits<T> > Create;
     
    244245    ///
    245246    ///\ref named-templ-param "Named parameter" for setting
    246247    ///\c DistMap type.
    247     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     248    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    248249    template <class T>
    249250    struct SetDistMap : public Dfs< Digraph, SetDistMapTraits<T> > {
    250251      typedef Dfs<Digraph, SetDistMapTraits<T> > Create;
     
    264265    ///
    265266    ///\ref named-templ-param "Named parameter" for setting
    266267    ///\c ReachedMap type.
    267     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     268    ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    268269    template <class T>
    269270    struct SetReachedMap : public Dfs< Digraph, SetReachedMapTraits<T> > {
    270271      typedef Dfs< Digraph, SetReachedMapTraits<T> > Create;
     
    284285    ///
    285286    ///\ref named-templ-param "Named parameter" for setting
    286287    ///\c ProcessedMap type.
    287     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     288    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    288289    template <class T>
    289290    struct SetProcessedMap : public Dfs< Digraph, SetProcessedMapTraits<T> > {
    290291      typedef Dfs< Digraph, SetProcessedMapTraits<T> > Create;
     
    669670
    670671    ///@{
    671672
    672     ///The DFS path to a node.
     673    ///The DFS path to the given node.
    673674
    674     ///Returns the DFS path to a node.
     675    ///Returns the DFS path to the given node from the root(s).
    675676    ///
    676677    ///\warning \c t should be reached from the root(s).
    677678    ///
     
    679680    ///must be called before using this function.
    680681    Path path(Node t) const { return Path(*G, *_pred, t); }
    681682
    682     ///The distance of a node from the root(s).
     683    ///The distance of the given node from the root(s).
    683684
    684     ///Returns the distance of a node from the root(s).
     685    ///Returns the distance of the given node from the root(s).
    685686    ///
    686687    ///\warning If node \c v is not reached from the root(s), then
    687688    ///the return value of this function is undefined.
     
    690691    ///must be called before using this function.
    691692    int dist(Node v) const { return (*_dist)[v]; }
    692693
    693     ///Returns the 'previous arc' of the %DFS tree for a node.
     694    ///Returns the 'previous arc' of the %DFS tree for the given node.
    694695
    695696    ///This function returns the 'previous arc' of the %DFS tree for the
    696697    ///node \c v, i.e. it returns the last arc of a %DFS path from a
     
    698699    ///root(s) or if \c v is a root.
    699700    ///
    700701    ///The %DFS tree used here is equal to the %DFS tree used in
    701     ///\ref predNode().
     702    ///\ref predNode() and \ref predMap().
    702703    ///
    703704    ///\pre Either \ref run(Node) "run()" or \ref init()
    704705    ///must be called before using this function.
    705706    Arc predArc(Node v) const { return (*_pred)[v];}
    706707
    707     ///Returns the 'previous node' of the %DFS tree.
     708    ///Returns the 'previous node' of the %DFS tree for the given node.
    708709
    709710    ///This function returns the 'previous node' of the %DFS
    710711    ///tree for the node \c v, i.e. it returns the last but one node
    711     ///from a %DFS path from a root to \c v. It is \c INVALID
     712    ///of a %DFS path from a root to \c v. It is \c INVALID
    712713    ///if \c v is not reached from the root(s) or if \c v is a root.
    713714    ///
    714715    ///The %DFS tree used here is equal to the %DFS tree used in
    715     ///\ref predArc().
     716    ///\ref predArc() and \ref predMap().
    716717    ///
    717718    ///\pre Either \ref run(Node) "run()" or \ref init()
    718719    ///must be called before using this function.
     
    733734    ///predecessor arcs.
    734735    ///
    735736    ///Returns a const reference to the node map that stores the predecessor
    736     ///arcs, which form the DFS tree.
     737    ///arcs, which form the DFS tree (forest).
    737738    ///
    738739    ///\pre Either \ref run(Node) "run()" or \ref init()
    739740    ///must be called before using this function.
    740741    const PredMap &predMap() const { return *_pred;}
    741742
    742     ///Checks if a node is reached from the root(s).
     743    ///Checks if the given node. node is reached from the root(s).
    743744
    744745    ///Returns \c true if \c v is reached from the root(s).
    745746    ///
     
    765766    ///
    766767    ///The type of the map that stores the predecessor
    767768    ///arcs of the %DFS paths.
    768     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     769    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    769770    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    770771    ///Instantiates a PredMap.
    771772
     
    780781    ///The type of the map that indicates which nodes are processed.
    781782
    782783    ///The type of the map that indicates which nodes are processed.
    783     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     784    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    784785    ///By default it is a NullMap.
    785786    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    786787    ///Instantiates a ProcessedMap.
     
    800801    ///The type of the map that indicates which nodes are reached.
    801802
    802803    ///The type of the map that indicates which nodes are reached.
    803     ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     804    ///It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    804805    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    805806    ///Instantiates a ReachedMap.
    806807
     
    815816    ///The type of the map that stores the distances of the nodes.
    816817
    817818    ///The type of the map that stores the distances of the nodes.
    818     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     819    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    819820    typedef typename Digraph::template NodeMap<int> DistMap;
    820821    ///Instantiates a DistMap.
    821822
     
    830831    ///The type of the DFS paths.
    831832
    832833    ///The type of the DFS paths.
    833     ///It must meet the \ref concepts::Path "Path" concept.
     834    ///It must conform to the \ref concepts::Path "Path" concept.
    834835    typedef lemon::Path<Digraph> Path;
    835836  };
    836837
    837838  /// Default traits class used by DfsWizard
    838839
    839   /// To make it easier to use Dfs algorithm
    840   /// we have created a wizard class.
    841   /// This \ref DfsWizard class needs default traits,
    842   /// as well as the \ref Dfs class.
    843   /// The \ref DfsWizardBase is a class to be the default traits of the
    844   /// \ref DfsWizard class.
     840  /// Default traits class used by DfsWizard.
     841  /// \tparam GR The type of the digraph.
    845842  template<class GR>
    846843  class DfsWizardBase : public DfsWizardDefaultTraits<GR>
    847844  {
     
    869866    public:
    870867    /// Constructor.
    871868
    872     /// This constructor does not require parameters, therefore it initiates
     869    /// This constructor does not require parameters, it initiates
    873870    /// all of the attributes to \c 0.
    874871    DfsWizardBase() : _g(0), _reached(0), _processed(0), _pred(0),
    875872                      _dist(0), _path(0), _di(0) {}
     
    899896  {
    900897    typedef TR Base;
    901898
    902     ///The type of the digraph the algorithm runs on.
    903899    typedef typename TR::Digraph Digraph;
    904900
    905901    typedef typename Digraph::Node Node;
     
    907903    typedef typename Digraph::Arc Arc;
    908904    typedef typename Digraph::OutArcIt OutArcIt;
    909905
    910     ///\brief The type of the map that stores the predecessor
    911     ///arcs of the DFS paths.
    912906    typedef typename TR::PredMap PredMap;
    913     ///\brief The type of the map that stores the distances of the nodes.
    914907    typedef typename TR::DistMap DistMap;
    915     ///\brief The type of the map that indicates which nodes are reached.
    916908    typedef typename TR::ReachedMap ReachedMap;
    917     ///\brief The type of the map that indicates which nodes are processed.
    918909    typedef typename TR::ProcessedMap ProcessedMap;
    919     ///The type of the DFS paths
    920910    typedef typename TR::Path Path;
    921911
    922912  public:
     
    999989      static PredMap *createPredMap(const Digraph &) { return 0; };
    1000990      SetPredMapBase(const TR &b) : TR(b) {}
    1001991    };
    1002     ///\brief \ref named-func-param "Named parameter"
    1003     ///for setting PredMap object.
     992
     993    ///\brief \ref named-templ-param "Named parameter" for setting
     994    ///the predecessor map.
    1004995    ///
    1005     ///\ref named-func-param "Named parameter"
    1006     ///for setting PredMap object.
     996    ///\ref named-templ-param "Named parameter" function for setting
     997    ///the map that stores the predecessor arcs of the nodes.
    1007998    template<class T>
    1008999    DfsWizard<SetPredMapBase<T> > predMap(const T &t)
    10091000    {
     
    10171008      static ReachedMap *createReachedMap(const Digraph &) { return 0; };
    10181009      SetReachedMapBase(const TR &b) : TR(b) {}
    10191010    };
    1020     ///\brief \ref named-func-param "Named parameter"
    1021     ///for setting ReachedMap object.
     1011
     1012    ///\brief \ref named-templ-param "Named parameter" for setting
     1013    ///the reached map.
    10221014    ///
    1023     /// \ref named-func-param "Named parameter"
    1024     ///for setting ReachedMap object.
     1015    ///\ref named-templ-param "Named parameter" function for setting
     1016    ///the map that indicates which nodes are reached.
    10251017    template<class T>
    10261018    DfsWizard<SetReachedMapBase<T> > reachedMap(const T &t)
    10271019    {
     
    10351027      static DistMap *createDistMap(const Digraph &) { return 0; };
    10361028      SetDistMapBase(const TR &b) : TR(b) {}
    10371029    };
    1038     ///\brief \ref named-func-param "Named parameter"
    1039     ///for setting DistMap object.
     1030
     1031    ///\brief \ref named-templ-param "Named parameter" for setting
     1032    ///the distance map.
    10401033    ///
    1041     /// \ref named-func-param "Named parameter"
    1042     ///for setting DistMap object.
     1034    ///\ref named-templ-param "Named parameter" function for setting
     1035    ///the map that stores the distances of the nodes calculated
     1036    ///by the algorithm.
    10431037    template<class T>
    10441038    DfsWizard<SetDistMapBase<T> > distMap(const T &t)
    10451039    {
     
    10531047      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
    10541048      SetProcessedMapBase(const TR &b) : TR(b) {}
    10551049    };
    1056     ///\brief \ref named-func-param "Named parameter"
    1057     ///for setting ProcessedMap object.
     1050
     1051    ///\brief \ref named-func-param "Named parameter" for setting
     1052    ///the processed map.
    10581053    ///
    1059     /// \ref named-func-param "Named parameter"
    1060     ///for setting ProcessedMap object.
     1054    ///\ref named-templ-param "Named parameter" function for setting
     1055    ///the map that indicates which nodes are processed.
    10611056    template<class T>
    10621057    DfsWizard<SetProcessedMapBase<T> > processedMap(const T &t)
    10631058    {
     
    12081203    /// \brief The type of the map that indicates which nodes are reached.
    12091204    ///
    12101205    /// The type of the map that indicates which nodes are reached.
    1211     /// It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     1206    /// It must conform to the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    12121207    typedef typename Digraph::template NodeMap<bool> ReachedMap;
    12131208
    12141209    /// \brief Instantiates a ReachedMap.
     
    16201615
    16211616    ///@{
    16221617
    1623     /// \brief Checks if a node is reached from the root(s).
     1618    /// \brief Checks if the given node is reached from the root(s).
    16241619    ///
    16251620    /// Returns \c true if \c v is reached from the root(s).
    16261621    ///
  • lemon/dijkstra.h

    diff --git a/lemon/dijkstra.h b/lemon/dijkstra.h
    a b  
    7070    ///The type of the map that stores the arc lengths.
    7171
    7272    ///The type of the map that stores the arc lengths.
    73     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
     73    ///It must conform to the \ref concepts::ReadMap "ReadMap" concept.
    7474    typedef LEN LengthMap;
    75     ///The type of the length of the arcs.
     75    ///The type of the arc lengths.
    7676    typedef typename LEN::Value Value;
    7777
    7878    /// Operation traits for %Dijkstra algorithm.
     
    116116    ///
    117117    ///The type of the map that stores the predecessor
    118118    ///arcs of the shortest paths.
    119     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     119    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    120120    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    121121    ///Instantiates a \c PredMap.
    122122
     
    131131    ///The type of the map that indicates which nodes are processed.
    132132
    133133    ///The type of the map that indicates which nodes are processed.
    134     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     134    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    135135    ///By default it is a NullMap.
    136136    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    137137    ///Instantiates a \c ProcessedMap.
     
    151151    ///The type of the map that stores the distances of the nodes.
    152152
    153153    ///The type of the map that stores the distances of the nodes.
    154     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     154    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    155155    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
    156156    ///Instantiates a \c DistMap.
    157157
     
    169169  /// \ingroup shortest_path
    170170  ///This class provides an efficient implementation of the %Dijkstra algorithm.
    171171  ///
     172  ///The %Dijkstra algorithm solves the single-source shortest path problem
     173  ///when all arc lengths are non-negative. If there are negative lengths,
     174  ///the BellmanFord algorithm should be used instead.
     175  ///
    172176  ///The arc lengths are passed to the algorithm using a
    173177  ///\ref concepts::ReadMap "ReadMap",
    174178  ///so it is easy to change it to any kind of length.
     
    201205    ///The type of the digraph the algorithm runs on.
    202206    typedef typename TR::Digraph Digraph;
    203207
    204     ///The type of the length of the arcs.
     208    ///The type of the arc lengths.
    205209    typedef typename TR::LengthMap::Value Value;
    206210    ///The type of the map that stores the arc lengths.
    207211    typedef typename TR::LengthMap LengthMap;
     
    304308    ///
    305309    ///\ref named-templ-param "Named parameter" for setting
    306310    ///\c PredMap type.
    307     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     311    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    308312    template <class T>
    309313    struct SetPredMap
    310314      : public Dijkstra< Digraph, LengthMap, SetPredMapTraits<T> > {
     
    325329    ///
    326330    ///\ref named-templ-param "Named parameter" for setting
    327331    ///\c DistMap type.
    328     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     332    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    329333    template <class T>
    330334    struct SetDistMap
    331335      : public Dijkstra< Digraph, LengthMap, SetDistMapTraits<T> > {
     
    346350    ///
    347351    ///\ref named-templ-param "Named parameter" for setting
    348352    ///\c ProcessedMap type.
    349     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     353    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    350354    template <class T>
    351355    struct SetProcessedMap
    352356      : public Dijkstra< Digraph, LengthMap, SetProcessedMapTraits<T> > {
     
    443447    ///
    444448    ///\ref named-templ-param "Named parameter" for setting
    445449    ///\c OperationTraits type.
     450    /// For more information see \ref DijkstraDefaultOperationTraits.
    446451    template <class T>
    447452    struct SetOperationTraits
    448453      : public Dijkstra<Digraph, LengthMap, SetOperationTraitsTraits<T> > {
     
    801806    ///\name Query Functions
    802807    ///The results of the %Dijkstra algorithm can be obtained using these
    803808    ///functions.\n
    804     ///Either \ref run(Node) "run()" or \ref start() should be called
     809    ///Either \ref run(Node) "run()" or \ref init() should be called
    805810    ///before using them.
    806811
    807812    ///@{
    808813
    809     ///The shortest path to a node.
     814    ///The shortest path to the given node.
    810815
    811     ///Returns the shortest path to a node.
     816    ///Returns the shortest path to the given node from the root(s).
    812817    ///
    813818    ///\warning \c t should be reached from the root(s).
    814819    ///
     
    816821    ///must be called before using this function.
    817822    Path path(Node t) const { return Path(*G, *_pred, t); }
    818823
    819     ///The distance of a node from the root(s).
     824    ///The distance of the given node from the root(s).
    820825
    821     ///Returns the distance of a node from the root(s).
     826    ///Returns the distance of the given node from the root(s).
    822827    ///
    823828    ///\warning If node \c v is not reached from the root(s), then
    824829    ///the return value of this function is undefined.
     
    827832    ///must be called before using this function.
    828833    Value dist(Node v) const { return (*_dist)[v]; }
    829834
    830     ///Returns the 'previous arc' of the shortest path tree for a node.
    831 
     835    ///\brief Returns the 'previous arc' of the shortest path tree for
     836    ///the given node.
     837    ///
    832838    ///This function returns the 'previous arc' of the shortest path
    833839    ///tree for the node \c v, i.e. it returns the last arc of a
    834840    ///shortest path from a root to \c v. It is \c INVALID if \c v
    835841    ///is not reached from the root(s) or if \c v is a root.
    836842    ///
    837843    ///The shortest path tree used here is equal to the shortest path
    838     ///tree used in \ref predNode().
     844    ///tree used in \ref predNode() and \ref predMap().
    839845    ///
    840846    ///\pre Either \ref run(Node) "run()" or \ref init()
    841847    ///must be called before using this function.
    842848    Arc predArc(Node v) const { return (*_pred)[v]; }
    843849
    844     ///Returns the 'previous node' of the shortest path tree for a node.
    845 
     850    ///\brief Returns the 'previous node' of the shortest path tree for
     851    ///the given node.
     852    ///
    846853    ///This function returns the 'previous node' of the shortest path
    847854    ///tree for the node \c v, i.e. it returns the last but one node
    848     ///from a shortest path from a root to \c v. It is \c INVALID
     855    ///of a shortest path from a root to \c v. It is \c INVALID
    849856    ///if \c v is not reached from the root(s) or if \c v is a root.
    850857    ///
    851858    ///The shortest path tree used here is equal to the shortest path
    852     ///tree used in \ref predArc().
     859    ///tree used in \ref predArc() and \ref predMap().
    853860    ///
    854861    ///\pre Either \ref run(Node) "run()" or \ref init()
    855862    ///must be called before using this function.
     
    870877    ///predecessor arcs.
    871878    ///
    872879    ///Returns a const reference to the node map that stores the predecessor
    873     ///arcs, which form the shortest path tree.
     880    ///arcs, which form the shortest path tree (forest).
    874881    ///
    875882    ///\pre Either \ref run(Node) "run()" or \ref init()
    876883    ///must be called before using this function.
    877884    const PredMap &predMap() const { return *_pred;}
    878885
    879     ///Checks if a node is reached from the root(s).
     886    ///Checks if the given node is reached from the root(s).
    880887
    881888    ///Returns \c true if \c v is reached from the root(s).
    882889    ///
     
    895902    bool processed(Node v) const { return (*_heap_cross_ref)[v] ==
    896903                                          Heap::POST_HEAP; }
    897904
    898     ///The current distance of a node from the root(s).
     905    ///The current distance of the given node from the root(s).
    899906
    900     ///Returns the current distance of a node from the root(s).
     907    ///Returns the current distance of the given node from the root(s).
    901908    ///It may be decreased in the following processes.
    902909    ///
    903910    ///\pre Either \ref run(Node) "run()" or \ref init()
     
    924931    ///The type of the map that stores the arc lengths.
    925932
    926933    ///The type of the map that stores the arc lengths.
    927     ///It must meet the \ref concepts::ReadMap "ReadMap" concept.
     934    ///It must conform to the \ref concepts::ReadMap "ReadMap" concept.
    928935    typedef LEN LengthMap;
    929     ///The type of the length of the arcs.
     936    ///The type of the arc lengths.
    930937    typedef typename LEN::Value Value;
    931938
    932939    /// Operation traits for Dijkstra algorithm.
     
    973980    ///
    974981    ///The type of the map that stores the predecessor
    975982    ///arcs of the shortest paths.
    976     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     983    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    977984    typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
    978985    ///Instantiates a PredMap.
    979986
     
    988995    ///The type of the map that indicates which nodes are processed.
    989996
    990997    ///The type of the map that indicates which nodes are processed.
    991     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     998    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    992999    ///By default it is a NullMap.
    9931000    typedef NullMap<typename Digraph::Node,bool> ProcessedMap;
    9941001    ///Instantiates a ProcessedMap.
     
    10081015    ///The type of the map that stores the distances of the nodes.
    10091016
    10101017    ///The type of the map that stores the distances of the nodes.
    1011     ///It must meet the \ref concepts::WriteMap "WriteMap" concept.
     1018    ///It must conform to the \ref concepts::WriteMap "WriteMap" concept.
    10121019    typedef typename Digraph::template NodeMap<typename LEN::Value> DistMap;
    10131020    ///Instantiates a DistMap.
    10141021
     
    10231030    ///The type of the shortest paths.
    10241031
    10251032    ///The type of the shortest paths.
    1026     ///It must meet the \ref concepts::Path "Path" concept.
     1033    ///It must conform to the \ref concepts::Path "Path" concept.
    10271034    typedef lemon::Path<Digraph> Path;
    10281035  };
    10291036
    10301037  /// Default traits class used by DijkstraWizard
    10311038
    1032   /// To make it easier to use Dijkstra algorithm
    1033   /// we have created a wizard class.
    1034   /// This \ref DijkstraWizard class needs default traits,
    1035   /// as well as the \ref Dijkstra class.
    1036   /// The \ref DijkstraWizardBase is a class to be the default traits of the
    1037   /// \ref DijkstraWizard class.
     1039  /// Default traits class used by DijkstraWizard.
     1040  /// \tparam GR The type of the digraph.
     1041  /// \tparam LEN The type of the length map.
    10381042  template<typename GR, typename LEN>
    10391043  class DijkstraWizardBase : public DijkstraWizardDefaultTraits<GR,LEN>
    10401044  {
     
    10931097  {
    10941098    typedef TR Base;
    10951099
    1096     ///The type of the digraph the algorithm runs on.
    10971100    typedef typename TR::Digraph Digraph;
    10981101
    10991102    typedef typename Digraph::Node Node;
     
    11011104    typedef typename Digraph::Arc Arc;
    11021105    typedef typename Digraph::OutArcIt OutArcIt;
    11031106
    1104     ///The type of the map that stores the arc lengths.
    11051107    typedef typename TR::LengthMap LengthMap;
    1106     ///The type of the length of the arcs.
    11071108    typedef typename LengthMap::Value Value;
    1108     ///\brief The type of the map that stores the predecessor
    1109     ///arcs of the shortest paths.
    11101109    typedef typename TR::PredMap PredMap;
    1111     ///The type of the map that stores the distances of the nodes.
    11121110    typedef typename TR::DistMap DistMap;
    1113     ///The type of the map that indicates which nodes are processed.
    11141111    typedef typename TR::ProcessedMap ProcessedMap;
    1115     ///The type of the shortest paths
    11161112    typedef typename TR::Path Path;
    1117     ///The heap type used by the dijkstra algorithm.
    11181113    typedef typename TR::Heap Heap;
    11191114
    11201115  public:
     
    11861181      static PredMap *createPredMap(const Digraph &) { return 0; };
    11871182      SetPredMapBase(const TR &b) : TR(b) {}
    11881183    };
    1189     ///\brief \ref named-func-param "Named parameter"
    1190     ///for setting PredMap object.
     1184
     1185    ///\brief \ref named-templ-param "Named parameter" for setting
     1186    ///the predecessor map.
    11911187    ///
    1192     ///\ref named-func-param "Named parameter"
    1193     ///for setting PredMap object.
     1188    ///\ref named-templ-param "Named parameter" function for setting
     1189    ///the map that stores the predecessor arcs of the nodes.
    11941190    template<class T>
    11951191    DijkstraWizard<SetPredMapBase<T> > predMap(const T &t)
    11961192    {
     
    12041200      static DistMap *createDistMap(const Digraph &) { return 0; };
    12051201      SetDistMapBase(const TR &b) : TR(b) {}
    12061202    };
    1207     ///\brief \ref named-func-param "Named parameter"
    1208     ///for setting DistMap object.
     1203
     1204    ///\brief \ref named-templ-param "Named parameter" for setting
     1205    ///the distance map.
    12091206    ///
    1210     ///\ref named-func-param "Named parameter"
    1211     ///for setting DistMap object.
     1207    ///\ref named-templ-param "Named parameter" function for setting
     1208    ///the map that stores the distances of the nodes calculated
     1209    ///by the algorithm.
    12121210    template<class T>
    12131211    DijkstraWizard<SetDistMapBase<T> > distMap(const T &t)
    12141212    {
     
    12221220      static ProcessedMap *createProcessedMap(const Digraph &) { return 0; };
    12231221      SetProcessedMapBase(const TR &b) : TR(b) {}
    12241222    };
    1225     ///\brief \ref named-func-param "Named parameter"
    1226     ///for setting ProcessedMap object.
     1223
     1224    ///\brief \ref named-func-param "Named parameter" for setting
     1225    ///the processed map.
    12271226    ///
    1228     /// \ref named-func-param "Named parameter"
    1229     ///for setting ProcessedMap object.
     1227    ///\ref named-templ-param "Named parameter" function for setting
     1228    ///the map that indicates which nodes are processed.
    12301229    template<class T>
    12311230    DijkstraWizard<SetProcessedMapBase<T> > processedMap(const T &t)
    12321231    {
     
    12391238      typedef T Path;
    12401239      SetPathBase(const TR &b) : TR(b) {}
    12411240    };
     1241
    12421242    ///\brief \ref named-func-param "Named parameter"
    12431243    ///for getting the shortest path to the target node.
    12441244    ///
  • lemon/maps.h

    diff --git a/lemon/maps.h b/lemon/maps.h
    a b  
    17901790  /// order of Dfs algorithm, as the following examples show.
    17911791  /// \code
    17921792  ///   std::vector<Node> v;
    1793   ///   dfs(g,s).processedMap(loggerBoolMap(std::back_inserter(v))).run();
     1793  ///   dfs(g).processedMap(loggerBoolMap(std::back_inserter(v))).run(s);
    17941794  /// \endcode
    17951795  /// \code
    17961796  ///   std::vector<Node> v(countNodes(g));
    1797   ///   dfs(g,s).processedMap(loggerBoolMap(v.begin())).run();
     1797  ///   dfs(g).processedMap(loggerBoolMap(v.begin())).run(s);
    17981798  /// \endcode
    17991799  ///
    18001800  /// \note The container of the iterator must contain enough space