diff -r 6777f0b0e7b5 -r 0a7d604a9763 src/lemon/concept/graph_component.h --- a/src/lemon/concept/graph_component.h Fri Jan 28 15:19:34 2005 +0000 +++ b/src/lemon/concept/graph_component.h Fri Jan 28 15:37:08 2005 +0000 @@ -297,12 +297,26 @@ /// int id(const Node&) const { return -1;} - /// Gives back an unique integer id for the Edge. + /// \brief Gives back the node by the unique id. + /// + /// Gives back the node by the unique id. + /// If the graph does not contain node with the given id + /// then the result of the function is undetermined. + Node fromId(int id, Node) const { return INVALID;} + /// \brief Gives back an unique integer id for the Edge. + /// /// Gives back an unique integer id for the Edge. /// int id(const Edge&) const { return -1;} + /// \brief Gives back the edge by the unique id. + /// + /// Gives back the edge by the unique id. + /// If the graph does not contain edge with the given id + /// then the result of the function is undetermined. + Edge fromId(int id, Edge) const { return INVALID;} + template struct Constraints { @@ -311,9 +325,11 @@ typename _Graph::Node node; int nid = graph.id(node); nid = graph.id(node); + node = graph.fromId(nid, Node()); typename _Graph::Edge edge; int eid = graph.id(edge); eid = graph.id(edge); + edge = graph.fromId(eid, Edge()); } const _Graph& graph;