lemon/full_graph.h
changeset 2074 c7ee2a2a3cff
parent 2031 080d51024ac5
child 2076 10681ee9d8ae
equal deleted inserted replaced
21:5bac280019da 22:4406d939780f
   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