1.1 --- a/lemon/full_graph.h Tue Apr 18 07:03:12 2006 +0000
1.2 +++ b/lemon/full_graph.h Tue Apr 18 09:14:38 2006 +0000
1.3 @@ -304,6 +304,18 @@
1.4 ///\sa id(Edge)
1.5 int maxEdgeId() const { return _edgeNum-1; }
1.6
1.7 + /// \brief Returns the node from its \c id.
1.8 + ///
1.9 + /// Returns the node from its \c id. If there is not node
1.10 + /// with the given id the effect of the function is undefinied.
1.11 + static Node nodeFromId(int id) { return Node(id);}
1.12 +
1.13 + /// \brief Returns the edge from its \c id.
1.14 + ///
1.15 + /// Returns the edge from its \c id. If there is not edge
1.16 + /// with the given id the effect of the function is undefinied.
1.17 + static Edge edgeFromId(int id) { return Edge(id);}
1.18 +
1.19 Node source(Edge e) const {
1.20 /// \todo we may do it faster
1.21 return Node(((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2);