equal
deleted
inserted
replaced
302 |
302 |
303 /// Maximum edge ID. |
303 /// Maximum edge ID. |
304 ///\sa id(Edge) |
304 ///\sa id(Edge) |
305 int maxEdgeId() const { return _edgeNum-1; } |
305 int maxEdgeId() const { return _edgeNum-1; } |
306 |
306 |
|
307 /// \brief Returns the node from its \c id. |
|
308 /// |
|
309 /// Returns the node from its \c id. If there is not node |
|
310 /// with the given id the effect of the function is undefinied. |
|
311 static Node nodeFromId(int id) { return Node(id);} |
|
312 |
|
313 /// \brief Returns the edge from its \c id. |
|
314 /// |
|
315 /// Returns the edge from its \c id. If there is not edge |
|
316 /// with the given id the effect of the function is undefinied. |
|
317 static Edge edgeFromId(int id) { return Edge(id);} |
|
318 |
307 Node source(Edge e) const { |
319 Node source(Edge e) const { |
308 /// \todo we may do it faster |
320 /// \todo we may do it faster |
309 return Node(((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2); |
321 return Node(((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2); |
310 } |
322 } |
311 |
323 |