COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/dfs.h

    r584 r717  
    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.
     
    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.
     
    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.
     
    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.
     
    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> > {
     
    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> > {
     
    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> > {
     
    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> > {
     
    412413    ///The simplest way to execute the DFS algorithm is to use one of the
    413414    ///member functions called \ref run(Node) "run()".\n
    414     ///If you need more control on the execution, first you have to call
    415     ///\ref init(), then you can add a source node with \ref addSource()
     415    ///If you need better control on the execution, you have to call
     416    ///\ref init() first, then you can add a source node with \ref addSource()
    416417    ///and perform the actual computation with \ref start().
    417418    ///This procedure can be repeated if there are nodes that have not
     
    670671    ///@{
    671672
    672     ///The DFS path to a node.
    673 
    674     ///Returns the DFS path to a node.
     673    ///The DFS path to the given node.
     674
     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).
     
    680681    Path path(Node t) const { return Path(*G, *_pred, t); }
    681682
    682     ///The distance of a node from the root(s).
    683 
    684     ///Returns the distance of a node from the root(s).
     683    ///The distance of the given node from the root(s).
     684
     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
     
    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
     
    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()
     
    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()
     
    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()
     
    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).
     
    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.
     
    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;
     
    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.
     
    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.
     
    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  };
     
    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>
     
    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),
     
    900897    typedef TR Base;
    901898
    902     ///The type of the digraph the algorithm runs on.
    903899    typedef typename TR::Digraph Digraph;
    904900
     
    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
     
    1000990      SetPredMapBase(const TR &b) : TR(b) {}
    1001991    };
    1002     ///\brief \ref named-func-param "Named parameter"
    1003     ///for setting PredMap object.
    1004     ///
    1005     ///\ref named-func-param "Named parameter"
    1006     ///for setting PredMap object.
     992
     993    ///\brief \ref named-templ-param "Named parameter" for setting
     994    ///the predecessor map.
     995    ///
     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)
     
    10181009      SetReachedMapBase(const TR &b) : TR(b) {}
    10191010    };
    1020     ///\brief \ref named-func-param "Named parameter"
    1021     ///for setting ReachedMap object.
    1022     ///
    1023     /// \ref named-func-param "Named parameter"
    1024     ///for setting ReachedMap object.
     1011
     1012    ///\brief \ref named-templ-param "Named parameter" for setting
     1013    ///the reached map.
     1014    ///
     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)
     
    10361028      SetDistMapBase(const TR &b) : TR(b) {}
    10371029    };
    1038     ///\brief \ref named-func-param "Named parameter"
    1039     ///for setting DistMap object.
    1040     ///
    1041     /// \ref named-func-param "Named parameter"
    1042     ///for setting DistMap object.
     1030
     1031    ///\brief \ref named-templ-param "Named parameter" for setting
     1032    ///the distance map.
     1033    ///
     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)
     
    10541048      SetProcessedMapBase(const TR &b) : TR(b) {}
    10551049    };
    1056     ///\brief \ref named-func-param "Named parameter"
    1057     ///for setting ProcessedMap object.
    1058     ///
    1059     /// \ref named-func-param "Named parameter"
    1060     ///for setting ProcessedMap object.
     1050
     1051    ///\brief \ref named-func-param "Named parameter" for setting
     1052    ///the processed map.
     1053    ///
     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)
     
    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
     
    13701365    /// The simplest way to execute the DFS algorithm is to use one of the
    13711366    /// member functions called \ref run(Node) "run()".\n
    1372     /// If you need more control on the execution, first you have to call
    1373     /// \ref init(), then you can add a source node with \ref addSource()
     1367    /// If you need better control on the execution, you have to call
     1368    /// \ref init() first, then you can add a source node with \ref addSource()
    13741369    /// and perform the actual computation with \ref start().
    13751370    /// This procedure can be repeated if there are nodes that have not
     
    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).
Note: See TracChangeset for help on using the changeset viewer.