# HG changeset patch # User deba # Date 1145351678 0 # Node ID 7ab148f53d663a51fd52c071426b61ad5cf58630 # Parent be70ea3b957a67530330e8e8f5a0b5773cc9aae9 Bug fix Add missing function diff -r be70ea3b957a -r 7ab148f53d66 lemon/full_graph.h --- a/lemon/full_graph.h Tue Apr 18 07:03:12 2006 +0000 +++ b/lemon/full_graph.h Tue Apr 18 09:14:38 2006 +0000 @@ -304,6 +304,18 @@ ///\sa id(Edge) int maxEdgeId() const { return _edgeNum-1; } + /// \brief Returns the node from its \c id. + /// + /// Returns the node from its \c id. If there is not node + /// with the given id the effect of the function is undefinied. + static Node nodeFromId(int id) { return Node(id);} + + /// \brief Returns the edge from its \c id. + /// + /// Returns the edge from its \c id. If there is not edge + /// with the given id the effect of the function is undefinied. + static Edge edgeFromId(int id) { return Edge(id);} + Node source(Edge e) const { /// \todo we may do it faster return Node(((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2);