87 |
87 |
88 /// Maximum node ID. |
88 /// Maximum node ID. |
89 |
89 |
90 /// Maximum node ID. |
90 /// Maximum node ID. |
91 ///\sa id(Node) |
91 ///\sa id(Node) |
92 int maxId(Node = INVALID) const { return nodes.size()-1; } |
92 int maxId(Node) const { return nodes.size()-1; } |
93 /// Maximum edge ID. |
93 /// Maximum edge ID. |
94 |
94 |
95 /// Maximum edge ID. |
95 /// Maximum edge ID. |
96 ///\sa id(Edge) |
96 ///\sa id(Edge) |
97 int maxId(Edge = INVALID) const { return edges.size()-1; } |
97 int maxId(Edge) const { return edges.size()-1; } |
98 |
98 |
99 Node source(Edge e) const { return edges[e.n].source; } |
99 Node source(Edge e) const { return edges[e.n].source; } |
100 Node target(Edge e) const { return edges[e.n].target; } |
100 Node target(Edge e) const { return edges[e.n].target; } |
101 |
101 |
102 /// Node ID. |
102 /// Node ID. |
103 |
103 |
104 /// The ID of a valid Node is a nonnegative integer not greater than |
104 /// The ID of a valid Node is a nonnegative integer not greater than |
105 /// \ref maxNodeId(). The range of the ID's is not surely continuous |
105 /// \ref maxId(Node). The range of the ID's is not surely continuous |
106 /// and the greatest node ID can be actually less then \ref maxNodeId(). |
106 /// and the greatest node ID can be actually less then \ref maxId(Node). |
107 /// |
107 /// |
108 /// The ID of the \ref INVALID node is -1. |
108 /// The ID of the \ref INVALID node is -1. |
109 ///\return The ID of the node \c v. |
109 ///\return The ID of the node \c v. |
110 static int id(Node v) { return v.n; } |
110 static int id(Node v) { return v.n; } |
111 /// Edge ID. |
111 /// Edge ID. |
112 |
112 |
113 /// The ID of a valid Edge is a nonnegative integer not greater than |
113 /// The ID of a valid Edge is a nonnegative integer not greater than |
114 /// \ref maxEdgeId(). The range of the ID's is not surely continuous |
114 /// \ref maxId(Edge). The range of the ID's is not surely continuous |
115 /// and the greatest edge ID can be actually less then \ref maxEdgeId(). |
115 /// and the greatest edge ID can be actually less then \ref maxId(Edge). |
116 /// |
116 /// |
117 /// The ID of the \ref INVALID edge is -1. |
117 /// The ID of the \ref INVALID edge is -1. |
118 ///\return The ID of the edge \c e. |
118 ///\return The ID of the edge \c e. |
119 static int id(Edge e) { return e.n; } |
119 static int id(Edge e) { return e.n; } |
120 |
120 |