COIN-OR::LEMON - Graph Library

Ticket #250: 250-new-ba6afb21b6fd.patch

File 250-new-ba6afb21b6fd.patch, 7.2 KB (added by Peter Kovacs, 13 months ago)
  • lemon/path.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1518907455 -3600
    #      Sat Feb 17 23:44:15 2018 +0100
    # Node ID ba6afb21b6fd147e765de15c3b197f40cd608afb
    # Parent  15d7c5eadacadbf50145095312677c6837327282
    API doc improvements for Path structures (#250)
    
    diff --git a/lemon/path.h b/lemon/path.h
    a b  
    4242  /// A structure for representing directed path in a digraph.
    4343  /// \tparam GR The digraph type in which the path is.
    4444  ///
    45   /// In a sense, the path can be treated as a list of arcs. The
    46   /// LEMON path type stores just this list. As a consequence, it
    47   /// cannot enumerate the nodes of the path and the source node of
    48   /// a zero length path is undefined.
     45  /// In a sense, a path can be treated as a list of arcs. The
     46  /// LEMON path type simply stores this list. As a consequence, it
     47  /// cannot enumerate the nodes in the path, and the source node of
     48  /// a zero-length path is undefined.
    4949  ///
    5050  /// This implementation is a back and front insertable and erasable
    5151  /// path type. It can be indexed in O(1) time. The front and back
     
    150150
    151151    /// \brief The n-th arc.
    152152    ///
    153     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     153    /// Gives back the n-th arc. This function runs in O(1) time.
     154    /// \pre \c n is in the range <tt>[0..length() - 1]</tt>.
    154155    const Arc& nth(int n) const {
    155156      return n < int(head.size()) ? *(head.rbegin() + n) :
    156157        *(tail.begin() + (n - head.size()));
     
    243244  /// A structure for representing directed path in a digraph.
    244245  /// \tparam GR The digraph type in which the path is.
    245246  ///
    246   /// In a sense, the path can be treated as a list of arcs. The
    247   /// LEMON path type stores just this list. As a consequence it
    248   /// cannot enumerate the nodes in the path and the zero length paths
    249   /// cannot store the source.
     247  /// In a sense, a path can be treated as a list of arcs. The
     248  /// LEMON path type simply stores this list. As a consequence, it
     249  /// cannot enumerate the nodes in the path, and the source node of
     250  /// a zero-length path is undefined.
    250251  ///
    251252  /// This implementation is a just back insertable and erasable path
    252253  /// type. It can be indexed in O(1) time. The back insertion and
    253254  /// erasure is amortized O(1) time. This implementation is faster
    254   /// then the \c Path type because it use just one vector for the
     255  /// than the \c Path type because it use just one vector for the
    255256  /// arcs.
    256257  template <typename GR>
    257258  class SimplePath {
     
    355356
    356357    /// \brief The n-th arc.
    357358    ///
    358     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     359    /// Gives back the n-th arc. This function runs in O(1) time.
     360    /// \pre \c n is in the range <tt>[0..length() - 1]</tt>.
    359361    const Arc& nth(int n) const {
    360362      return data[n];
    361363    }
     
    420422  /// A structure for representing directed path in a digraph.
    421423  /// \tparam GR The digraph type in which the path is.
    422424  ///
    423   /// In a sense, the path can be treated as a list of arcs. The
    424   /// LEMON path type stores just this list. As a consequence it
    425   /// cannot enumerate the nodes in the path and the zero length paths
    426   /// cannot store the source.
     425  /// In a sense, a path can be treated as a list of arcs. The
     426  /// LEMON path type simply stores this list. As a consequence, it
     427  /// cannot enumerate the nodes in the path, and the source node of
     428  /// a zero-length path is undefined.
    427429  ///
    428430  /// This implementation is a back and front insertable and erasable
    429431  /// path type. It can be indexed in O(k) time, where k is the rank
     
    546548    /// \brief The n-th arc.
    547549    ///
    548550    /// This function looks for the n-th arc in O(n) time.
    549     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     551    /// \pre \c n is in the range <tt>[0..length() - 1]</tt>.
    550552    const Arc& nth(int n) const {
    551553      Node *node = first;
    552554      for (int i = 0; i < n; ++i) {
     
    732734    /// starting with
    733735    /// \c it will put into \c tpath. If \c tpath have arcs
    734736    /// before the operation they are removed first.  The time
    735     /// complexity of this function is O(1) plus the the time of emtying
     737    /// complexity of this function is O(1) plus the time of emtying
    736738    /// \c tpath. If \c it is \c INVALID then it just clears \c tpath
    737739    void split(ArcIt it, ListPath& tpath) {
    738740      tpath.clear();
     
    773775  /// A structure for representing directed path in a digraph.
    774776  /// \tparam GR The digraph type in which the path is.
    775777  ///
    776   /// In a sense, the path can be treated as a list of arcs. The
    777   /// LEMON path type stores just this list. As a consequence it
    778   /// cannot enumerate the nodes in the path and the source node of
    779   /// a zero length path is undefined.
     778  /// In a sense, a path can be treated as a list of arcs. The
     779  /// LEMON path type simply stores this list. As a consequence, it
     780  /// cannot enumerate the nodes in the path, and the source node of
     781  /// a zero-length path is undefined.
    780782  ///
    781783  /// This implementation is completly static, i.e. it can be copy constucted
    782784  /// or copy assigned from another path, but otherwise it cannot be
    783785  /// modified.
    784786  ///
    785   /// Being the the most memory efficient path type in LEMON,
    786   /// it is intented to be
    787   /// used when you want to store a large number of paths.
     787  /// Being the most memory-efficient path type in LEMON, it is
     788  /// intented to be used when you want to store a large number of paths.
    788789  template <typename GR>
    789790  class StaticPath {
    790791  public:
     
    885886
    886887    /// \brief The n-th arc.
    887888    ///
    888     /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     889    /// Gives back the n-th arc. This function runs in O(1) time.
     890    /// \pre \c n is in the range <tt>[0..length() - 1]</tt>.
    889891    const Arc& nth(int n) const {
    890892      return arcs[n];
    891893    }
     
    901903    /// \brief Return true when the path is empty.
    902904    int empty() const { return len == 0; }
    903905
    904     /// \brief Erase all arcs in the digraph.
     906    /// \brief Reset the path to an empty one.
    905907    void clear() {
    906908      len = 0;
    907909      if (arcs) delete[] arcs;
     
    10911093    return path.empty() ? INVALID : digraph.target(path.back());
    10921094  }
    10931095
    1094   /// \brief Class which helps to iterate through the nodes of a path
     1096  /// \brief Class for iterating through the nodes of a path
     1097  ///
     1098  /// Class for iterating through the nodes of a path.
    10951099  ///
    1096   /// In a sense, the path can be treated as a list of arcs. The
    1097   /// LEMON path type stores only this list. As a consequence, it
    1098   /// cannot enumerate the nodes in the path and the zero length paths
    1099   /// cannot have a source node.
     1100  /// In a sense, a path can be treated as a list of arcs. The
     1101  /// LEMON path type simply stores this list. As a consequence, it
     1102  /// cannot enumerate the nodes in the path, and the source node of
     1103  /// a zero-length path is undefined.
    11001104  ///
    1101   /// This class implements the node iterator of a path structure. To
    1102   /// provide this feature, the underlying digraph should be passed to
     1105  /// However, this class implements a node iterator for path structures.
     1106  /// To provide this feature, the underlying digraph should be passed to
    11031107  /// the constructor of the iterator.
    11041108  template <typename Path>
    11051109  class PathNodeIt {