1.1 --- a/src/lemon/concept/graph_component.h Fri Jan 28 15:19:34 2005 +0000
1.2 +++ b/src/lemon/concept/graph_component.h Fri Jan 28 15:37:08 2005 +0000
1.3 @@ -297,12 +297,26 @@
1.4 ///
1.5 int id(const Node&) const { return -1;}
1.6
1.7 - /// Gives back an unique integer id for the Edge.
1.8 + /// \brief Gives back the node by the unique id.
1.9 + ///
1.10 + /// Gives back the node by the unique id.
1.11 + /// If the graph does not contain node with the given id
1.12 + /// then the result of the function is undetermined.
1.13 + Node fromId(int id, Node) const { return INVALID;}
1.14
1.15 + /// \brief Gives back an unique integer id for the Edge.
1.16 + ///
1.17 /// Gives back an unique integer id for the Edge.
1.18 ///
1.19 int id(const Edge&) const { return -1;}
1.20
1.21 + /// \brief Gives back the edge by the unique id.
1.22 + ///
1.23 + /// Gives back the edge by the unique id.
1.24 + /// If the graph does not contain edge with the given id
1.25 + /// then the result of the function is undetermined.
1.26 + Edge fromId(int id, Edge) const { return INVALID;}
1.27 +
1.28 template <typename _Graph>
1.29 struct Constraints {
1.30
1.31 @@ -311,9 +325,11 @@
1.32 typename _Graph::Node node;
1.33 int nid = graph.id(node);
1.34 nid = graph.id(node);
1.35 + node = graph.fromId(nid, Node());
1.36 typename _Graph::Edge edge;
1.37 int eid = graph.id(edge);
1.38 eid = graph.id(edge);
1.39 + edge = graph.fromId(eid, Edge());
1.40 }
1.41
1.42 const _Graph& graph;