diff -r 741f3108a90f -r e997802b855c src/lemon/path.h --- a/src/lemon/path.h Sat Nov 13 12:24:01 2004 +0000 +++ b/src/lemon/path.h Sat Nov 13 12:53:28 2004 +0000 @@ -111,15 +111,15 @@ /// /// Starting point of the path. /// Returns INVALID if the path is empty. - GraphNode tail() const { - return empty() ? INVALID : gr->tail(edges[0]); + GraphNode source() const { + return empty() ? INVALID : gr->source(edges[0]); } /// \brief End point of the path. /// /// End point of the path. /// Returns INVALID if the path is empty. - GraphNode head() const { - return empty() ? INVALID : gr->head(edges[length()-1]); + GraphNode target() const { + return empty() ? INVALID : gr->target(edges[length()-1]); } /// \brief Initializes node or edge iterator to point to the first @@ -139,15 +139,15 @@ return i=EdgeIt(*this, n); } - /// \brief Returns node iterator pointing to the head node of the + /// \brief Returns node iterator pointing to the target node of the /// given edge iterator. - NodeIt head(const EdgeIt& e) const { + NodeIt target(const EdgeIt& e) const { return NodeIt(*this, e.idx+1); } - /// \brief Returns node iterator pointing to the tail node of the + /// \brief Returns node iterator pointing to the source node of the /// given edge iterator. - NodeIt tail(const EdgeIt& e) const { + NodeIt source(const EdgeIt& e) const { return NodeIt(*this, e.idx); } @@ -230,9 +230,9 @@ ///Conversion to Graph::Node operator const GraphNode& () const { if(idx >= p->length()) - return p->head(); + return p->target(); else if(idx >= 0) - return p->gr->tail(p->edges[idx]); + return p->gr->source(p->edges[idx]); else return INVALID; } @@ -335,23 +335,23 @@ return front.empty() && back.empty() && P.empty(); } - GraphNode tail() const { + GraphNode source() const { if( ! front.empty() ) - return P.gr->tail(front[front.size()-1]); + return P.gr->source(front[front.size()-1]); else if( ! P.empty() ) - return P.gr->tail(P.edges[0]); + return P.gr->source(P.edges[0]); else if( ! back.empty() ) - return P.gr->tail(back[0]); + return P.gr->source(back[0]); else return INVALID; } - GraphNode head() const { + GraphNode target() const { if( ! back.empty() ) - return P.gr->head(back[back.size()-1]); + return P.gr->target(back[back.size()-1]); else if( ! P.empty() ) - return P.gr->head(P.edges[P.length()-1]); + return P.gr->target(P.edges[P.length()-1]); else if( ! front.empty() ) - return P.gr->head(front[0]); + return P.gr->target(front[0]); else return INVALID; } @@ -437,15 +437,15 @@ /// /// Starting point of the path. /// Returns INVALID if the path is empty. - GraphNode tail() const { - return empty() ? INVALID : gr->tail(edges[0]); + GraphNode source() const { + return empty() ? INVALID : gr->source(edges[0]); } /// \brief End point of the path. /// /// End point of the path. /// Returns INVALID if the path is empty. - GraphNode head() const { - return empty() ? INVALID : gr->head(edges[length()-1]); + GraphNode target() const { + return empty() ? INVALID : gr->target(edges[length()-1]); } /// \brief Initializes node or edge iterator to point to the first @@ -477,15 +477,15 @@ return ++e; } - /// \brief Returns node iterator pointing to the head node of the + /// \brief Returns node iterator pointing to the target node of the /// given edge iterator. - NodeIt head(const EdgeIt& e) const { + NodeIt target(const EdgeIt& e) const { return NodeIt(*this, e.idx+1); } - /// \brief Returns node iterator pointing to the tail node of the + /// \brief Returns node iterator pointing to the source node of the /// given edge iterator. - NodeIt tail(const EdgeIt& e) const { + NodeIt source(const EdgeIt& e) const { return NodeIt(*this, e.idx); } @@ -570,9 +570,9 @@ ///Conversion to Graph::Node operator const GraphNode& () const { if(idx >= p->length()) - return p->head(); + return p->target(); else if(idx >= 0) - return p->gr->tail(p->edges[idx]); + return p->gr->source(p->edges[idx]); else return INVALID; } @@ -676,23 +676,23 @@ return front.empty() && back.empty() && P.empty(); } - GraphNode tail() const { + GraphNode source() const { if( ! front.empty() ) - return P.gr->tail(front[front.size()-1]); + return P.gr->source(front[front.size()-1]); else if( ! P.empty() ) - return P.gr->tail(P.edges[0]); + return P.gr->source(P.edges[0]); else if( ! back.empty() ) - return P.gr->tail(back[0]); + return P.gr->source(back[0]); else return INVALID; } - GraphNode head() const { + GraphNode target() const { if( ! back.empty() ) - return P.gr->head(back[back.size()-1]); + return P.gr->target(back[back.size()-1]); else if( ! P.empty() ) - return P.gr->head(P.edges[P.length()-1]); + return P.gr->target(P.edges[P.length()-1]); else if( ! front.empty() ) - return P.gr->head(front[0]); + return P.gr->target(front[0]); else return INVALID; }