COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/path.h

    r956 r1147  
    4444  ///
    4545  /// 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
     46  /// LEMON path type stores just this list. As a consequence, it
    4747  /// cannot enumerate the nodes of the path and the source node of
    4848  /// a zero length path is undefined.
     
    6565    Path() {}
    6666
     67    /// \brief Copy constructor
     68    ///
     69    Path(const Path& cpath) {
     70      pathCopy(cpath, *this);
     71    }
     72
    6773    /// \brief Template copy constructor
    6874    ///
     
    7278    Path(const CPath& cpath) {
    7379      pathCopy(cpath, *this);
     80    }
     81
     82    /// \brief Copy assignment
     83    ///
     84    Path& operator=(const Path& cpath) {
     85      pathCopy(cpath, *this);
     86      return *this;
    7487    }
    7588
     
    136149    void clear() { head.clear(); tail.clear(); }
    137150
    138     /// \brief The nth arc.
     151    /// \brief The n-th arc.
    139152    ///
    140153    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    144157    }
    145158
    146     /// \brief Initialize arc iterator to point to the nth arc
     159    /// \brief Initialize arc iterator to point to the n-th arc
    147160    ///
    148161    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    232245  ///
    233246  /// In a sense, the path can be treated as a list of arcs. The
    234   /// lemon path type stores just this list. As a consequence it
     247  /// LEMON path type stores just this list. As a consequence it
    235248  /// cannot enumerate the nodes in the path and the zero length paths
    236249  /// cannot store the source.
     
    253266    SimplePath() {}
    254267
     268    /// \brief Copy constructor
     269    ///
     270    SimplePath(const SimplePath& cpath) {
     271      pathCopy(cpath, *this);
     272    }
     273
    255274    /// \brief Template copy constructor
    256275    ///
     
    260279    SimplePath(const CPath& cpath) {
    261280      pathCopy(cpath, *this);
     281    }
     282
     283    /// \brief Copy assignment
     284    ///
     285    SimplePath& operator=(const SimplePath& cpath) {
     286      pathCopy(cpath, *this);
     287      return *this;
    262288    }
    263289
     
    328354    void clear() { data.clear(); }
    329355
    330     /// \brief The nth arc.
     356    /// \brief The n-th arc.
    331357    ///
    332358    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    335361    }
    336362
    337     /// \brief  Initializes arc iterator to point to the nth arc.
     363    /// \brief  Initializes arc iterator to point to the n-th arc.
    338364    ArcIt nthIt(int n) const {
    339365      return ArcIt(*this, n);
     
    396422  ///
    397423  /// In a sense, the path can be treated as a list of arcs. The
    398   /// lemon path type stores just this list. As a consequence it
     424  /// LEMON path type stores just this list. As a consequence it
    399425  /// cannot enumerate the nodes in the path and the zero length paths
    400426  /// cannot store the source.
     
    432458    ListPath() : first(0), last(0) {}
    433459
     460    /// \brief Copy constructor
     461    ///
     462    ListPath(const ListPath& cpath) : first(0), last(0) {
     463      pathCopy(cpath, *this);
     464    }
     465
    434466    /// \brief Template copy constructor
    435467    ///
     
    446478    ~ListPath() {
    447479      clear();
     480    }
     481
     482    /// \brief Copy assignment
     483    ///
     484    ListPath& operator=(const ListPath& cpath) {
     485      pathCopy(cpath, *this);
     486      return *this;
    448487    }
    449488
     
    505544    };
    506545
    507     /// \brief The nth arc.
    508     ///
    509     /// This function looks for the nth arc in O(n) time.
     546    /// \brief The n-th arc.
     547    ///
     548    /// This function looks for the n-th arc in O(n) time.
    510549    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
    511550    const Arc& nth(int n) const {
     
    517556    }
    518557
    519     /// \brief Initializes arc iterator to point to the nth arc.
     558    /// \brief Initializes arc iterator to point to the n-th arc.
    520559    ArcIt nthIt(int n) const {
    521560      Node *node = first;
     
    736775  ///
    737776  /// In a sense, the path can be treated as a list of arcs. The
    738   /// lemon path type stores just this list. As a consequence it
     777  /// LEMON path type stores just this list. As a consequence it
    739778  /// cannot enumerate the nodes in the path and the source node of
    740779  /// a zero length path is undefined.
     
    759798    StaticPath() : len(0), arcs(0) {}
    760799
     800    /// \brief Copy constructor
     801    ///
     802    StaticPath(const StaticPath& cpath) : arcs(0) {
     803      pathCopy(cpath, *this);
     804    }
     805
    761806    /// \brief Template copy constructor
    762807    ///
     
    772817    ~StaticPath() {
    773818      if (arcs) delete[] arcs;
     819    }
     820
     821    /// \brief Copy assignment
     822    ///
     823    StaticPath& operator=(const StaticPath& cpath) {
     824      pathCopy(cpath, *this);
     825      return *this;
    774826    }
    775827
     
    832884    };
    833885
    834     /// \brief The nth arc.
     886    /// \brief The n-th arc.
    835887    ///
    836888    /// \pre \c n is in the <tt>[0..length() - 1]</tt> range.
     
    839891    }
    840892
    841     /// \brief The arc iterator pointing to the nth arc.
     893    /// \brief The arc iterator pointing to the n-th arc.
    842894    ArcIt nthIt(int n) const {
    843895      return ArcIt(*this, n);
     
    10431095  ///
    10441096  /// In a sense, the path can be treated as a list of arcs. The
    1045   /// lemon path type stores only this list. As a consequence, it
     1097  /// LEMON path type stores only this list. As a consequence, it
    10461098  /// cannot enumerate the nodes in the path and the zero length paths
    10471099  /// cannot have a source node.
Note: See TracChangeset for help on using the changeset viewer.