Changeset 986:e997802b855c in lemon0.x for src/lemon/path.h
 Timestamp:
 11/13/04 13:53:28 (17 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@1376
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/lemon/path.h
r959 r986 112 112 /// Starting point of the path. 113 113 /// Returns INVALID if the path is empty. 114 GraphNode tail() const {115 return empty() ? INVALID : gr> tail(edges[0]);114 GraphNode source() const { 115 return empty() ? INVALID : gr>source(edges[0]); 116 116 } 117 117 /// \brief End point of the path. … … 119 119 /// End point of the path. 120 120 /// Returns INVALID if the path is empty. 121 GraphNode head() const {122 return empty() ? INVALID : gr> head(edges[length()1]);121 GraphNode target() const { 122 return empty() ? INVALID : gr>target(edges[length()1]); 123 123 } 124 124 … … 140 140 } 141 141 142 /// \brief Returns node iterator pointing to the headnode of the142 /// \brief Returns node iterator pointing to the target node of the 143 143 /// given edge iterator. 144 NodeIt head(const EdgeIt& e) const {144 NodeIt target(const EdgeIt& e) const { 145 145 return NodeIt(*this, e.idx+1); 146 146 } 147 147 148 /// \brief Returns node iterator pointing to the tailnode of the148 /// \brief Returns node iterator pointing to the source node of the 149 149 /// given edge iterator. 150 NodeIt tail(const EdgeIt& e) const {150 NodeIt source(const EdgeIt& e) const { 151 151 return NodeIt(*this, e.idx); 152 152 } … … 231 231 operator const GraphNode& () const { 232 232 if(idx >= p>length()) 233 return p> head();233 return p>target(); 234 234 else if(idx >= 0) 235 return p>gr> tail(p>edges[idx]);235 return p>gr>source(p>edges[idx]); 236 236 else 237 237 return INVALID; … … 336 336 } 337 337 338 GraphNode tail() const {338 GraphNode source() const { 339 339 if( ! front.empty() ) 340 return P.gr> tail(front[front.size()1]);340 return P.gr>source(front[front.size()1]); 341 341 else if( ! P.empty() ) 342 return P.gr> tail(P.edges[0]);342 return P.gr>source(P.edges[0]); 343 343 else if( ! back.empty() ) 344 return P.gr> tail(back[0]);344 return P.gr>source(back[0]); 345 345 else 346 346 return INVALID; 347 347 } 348 GraphNode head() const {348 GraphNode target() const { 349 349 if( ! back.empty() ) 350 return P.gr> head(back[back.size()1]);350 return P.gr>target(back[back.size()1]); 351 351 else if( ! P.empty() ) 352 return P.gr> head(P.edges[P.length()1]);352 return P.gr>target(P.edges[P.length()1]); 353 353 else if( ! front.empty() ) 354 return P.gr> head(front[0]);354 return P.gr>target(front[0]); 355 355 else 356 356 return INVALID; … … 438 438 /// Starting point of the path. 439 439 /// Returns INVALID if the path is empty. 440 GraphNode tail() const {441 return empty() ? INVALID : gr> tail(edges[0]);440 GraphNode source() const { 441 return empty() ? INVALID : gr>source(edges[0]); 442 442 } 443 443 /// \brief End point of the path. … … 445 445 /// End point of the path. 446 446 /// Returns INVALID if the path is empty. 447 GraphNode head() const {448 return empty() ? INVALID : gr> head(edges[length()1]);447 GraphNode target() const { 448 return empty() ? INVALID : gr>target(edges[length()1]); 449 449 } 450 450 … … 478 478 } 479 479 480 /// \brief Returns node iterator pointing to the headnode of the480 /// \brief Returns node iterator pointing to the target node of the 481 481 /// given edge iterator. 482 NodeIt head(const EdgeIt& e) const {482 NodeIt target(const EdgeIt& e) const { 483 483 return NodeIt(*this, e.idx+1); 484 484 } 485 485 486 /// \brief Returns node iterator pointing to the tailnode of the486 /// \brief Returns node iterator pointing to the source node of the 487 487 /// given edge iterator. 488 NodeIt tail(const EdgeIt& e) const {488 NodeIt source(const EdgeIt& e) const { 489 489 return NodeIt(*this, e.idx); 490 490 } … … 571 571 operator const GraphNode& () const { 572 572 if(idx >= p>length()) 573 return p> head();573 return p>target(); 574 574 else if(idx >= 0) 575 return p>gr> tail(p>edges[idx]);575 return p>gr>source(p>edges[idx]); 576 576 else 577 577 return INVALID; … … 677 677 } 678 678 679 GraphNode tail() const {679 GraphNode source() const { 680 680 if( ! front.empty() ) 681 return P.gr> tail(front[front.size()1]);681 return P.gr>source(front[front.size()1]); 682 682 else if( ! P.empty() ) 683 return P.gr> tail(P.edges[0]);683 return P.gr>source(P.edges[0]); 684 684 else if( ! back.empty() ) 685 return P.gr> tail(back[0]);685 return P.gr>source(back[0]); 686 686 else 687 687 return INVALID; 688 688 } 689 GraphNode head() const {689 GraphNode target() const { 690 690 if( ! back.empty() ) 691 return P.gr> head(back[back.size()1]);691 return P.gr>target(back[back.size()1]); 692 692 else if( ! P.empty() ) 693 return P.gr> head(P.edges[P.length()1]);693 return P.gr>target(P.edges[P.length()1]); 694 694 else if( ! front.empty() ) 695 return P.gr> head(front[0]);695 return P.gr>target(front[0]); 696 696 else 697 697 return INVALID;
Note: See TracChangeset
for help on using the changeset viewer.