Changes in lemon/path.h [956:141f9c0db4a3:1147:a10624ed1997] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/path.h
r956 r1147 44 44 /// 45 45 /// In a sense, the path can be treated as a list of arcs. The 46 /// lemonpath type stores just this list. As a consequence, it46 /// LEMON path type stores just this list. As a consequence, it 47 47 /// cannot enumerate the nodes of the path and the source node of 48 48 /// a zero length path is undefined. … … 65 65 Path() {} 66 66 67 /// \brief Copy constructor 68 /// 69 Path(const Path& cpath) { 70 pathCopy(cpath, *this); 71 } 72 67 73 /// \brief Template copy constructor 68 74 /// … … 72 78 Path(const CPath& cpath) { 73 79 pathCopy(cpath, *this); 80 } 81 82 /// \brief Copy assignment 83 /// 84 Path& operator=(const Path& cpath) { 85 pathCopy(cpath, *this); 86 return *this; 74 87 } 75 88 … … 136 149 void clear() { head.clear(); tail.clear(); } 137 150 138 /// \brief The n th arc.151 /// \brief The n-th arc. 139 152 /// 140 153 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range. … … 144 157 } 145 158 146 /// \brief Initialize arc iterator to point to the n th arc159 /// \brief Initialize arc iterator to point to the n-th arc 147 160 /// 148 161 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range. … … 232 245 /// 233 246 /// In a sense, the path can be treated as a list of arcs. The 234 /// lemonpath type stores just this list. As a consequence it247 /// LEMON path type stores just this list. As a consequence it 235 248 /// cannot enumerate the nodes in the path and the zero length paths 236 249 /// cannot store the source. … … 253 266 SimplePath() {} 254 267 268 /// \brief Copy constructor 269 /// 270 SimplePath(const SimplePath& cpath) { 271 pathCopy(cpath, *this); 272 } 273 255 274 /// \brief Template copy constructor 256 275 /// … … 260 279 SimplePath(const CPath& cpath) { 261 280 pathCopy(cpath, *this); 281 } 282 283 /// \brief Copy assignment 284 /// 285 SimplePath& operator=(const SimplePath& cpath) { 286 pathCopy(cpath, *this); 287 return *this; 262 288 } 263 289 … … 328 354 void clear() { data.clear(); } 329 355 330 /// \brief The n th arc.356 /// \brief The n-th arc. 331 357 /// 332 358 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range. … … 335 361 } 336 362 337 /// \brief Initializes arc iterator to point to the n th arc.363 /// \brief Initializes arc iterator to point to the n-th arc. 338 364 ArcIt nthIt(int n) const { 339 365 return ArcIt(*this, n); … … 396 422 /// 397 423 /// In a sense, the path can be treated as a list of arcs. The 398 /// lemonpath type stores just this list. As a consequence it424 /// LEMON path type stores just this list. As a consequence it 399 425 /// cannot enumerate the nodes in the path and the zero length paths 400 426 /// cannot store the source. … … 432 458 ListPath() : first(0), last(0) {} 433 459 460 /// \brief Copy constructor 461 /// 462 ListPath(const ListPath& cpath) : first(0), last(0) { 463 pathCopy(cpath, *this); 464 } 465 434 466 /// \brief Template copy constructor 435 467 /// … … 446 478 ~ListPath() { 447 479 clear(); 480 } 481 482 /// \brief Copy assignment 483 /// 484 ListPath& operator=(const ListPath& cpath) { 485 pathCopy(cpath, *this); 486 return *this; 448 487 } 449 488 … … 505 544 }; 506 545 507 /// \brief The n th arc.508 /// 509 /// This function looks for the n th 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. 510 549 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range. 511 550 const Arc& nth(int n) const { … … 517 556 } 518 557 519 /// \brief Initializes arc iterator to point to the n th arc.558 /// \brief Initializes arc iterator to point to the n-th arc. 520 559 ArcIt nthIt(int n) const { 521 560 Node *node = first; … … 736 775 /// 737 776 /// In a sense, the path can be treated as a list of arcs. The 738 /// lemonpath type stores just this list. As a consequence it777 /// LEMON path type stores just this list. As a consequence it 739 778 /// cannot enumerate the nodes in the path and the source node of 740 779 /// a zero length path is undefined. … … 759 798 StaticPath() : len(0), arcs(0) {} 760 799 800 /// \brief Copy constructor 801 /// 802 StaticPath(const StaticPath& cpath) : arcs(0) { 803 pathCopy(cpath, *this); 804 } 805 761 806 /// \brief Template copy constructor 762 807 /// … … 772 817 ~StaticPath() { 773 818 if (arcs) delete[] arcs; 819 } 820 821 /// \brief Copy assignment 822 /// 823 StaticPath& operator=(const StaticPath& cpath) { 824 pathCopy(cpath, *this); 825 return *this; 774 826 } 775 827 … … 832 884 }; 833 885 834 /// \brief The n th arc.886 /// \brief The n-th arc. 835 887 /// 836 888 /// \pre \c n is in the <tt>[0..length() - 1]</tt> range. … … 839 891 } 840 892 841 /// \brief The arc iterator pointing to the n th arc.893 /// \brief The arc iterator pointing to the n-th arc. 842 894 ArcIt nthIt(int n) const { 843 895 return ArcIt(*this, n); … … 1043 1095 /// 1044 1096 /// In a sense, the path can be treated as a list of arcs. The 1045 /// lemonpath type stores only this list. As a consequence, it1097 /// LEMON path type stores only this list. As a consequence, it 1046 1098 /// cannot enumerate the nodes in the path and the zero length paths 1047 1099 /// cannot have a source node.
Note: See TracChangeset
for help on using the changeset viewer.