src/hugo/smart_graph.h
changeset 813 65144c52969c
parent 798 6d1abeb62dd3
child 822 88226d9fe821
     1.1 --- a/src/hugo/smart_graph.h	Tue Sep 07 07:09:53 2004 +0000
     1.2 +++ b/src/hugo/smart_graph.h	Tue Sep 07 10:35:31 2004 +0000
     1.3 @@ -80,15 +80,21 @@
     1.4      SmartGraph() : nodes(), edges() { }
     1.5      SmartGraph(const SmartGraph &_g) : nodes(_g.nodes), edges(_g.edges) { }
     1.6      
     1.7 -    int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
     1.8 -    int edgeNum() const { return edges.size(); }  //FIXME: What is this?
     1.9 +    ///Number of nodes.
    1.10 +    int nodeNum() const { return nodes.size(); }
    1.11 +    ///Number of edges.
    1.12 +    int edgeNum() const { return edges.size(); }
    1.13  
    1.14 -    ///\bug This function does something different than
    1.15 -    ///its name would suggests...
    1.16 -    int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
    1.17 -    ///\bug This function does something different than
    1.18 -    ///its name would suggests...
    1.19 -    int maxEdgeId() const { return edges.size(); }  //FIXME: What is this?
    1.20 +    /// Maximum node ID.
    1.21 +    
    1.22 +    /// Maximum node ID.
    1.23 +    ///\sa id(Node)
    1.24 +    int maxNodeId() const { return nodes.size()-1; }
    1.25 +    /// Maximum edge ID.
    1.26 +    
    1.27 +    /// Maximum edge ID.
    1.28 +    ///\sa id(Edge)
    1.29 +    int maxEdgeId() const { return edges.size()-1; }
    1.30  
    1.31      Node tail(Edge e) const { return edges[e.n].tail; }
    1.32      Node head(Edge e) const { return edges[e.n].head; }
    1.33 @@ -102,7 +108,23 @@
    1.34      InEdgeIt& first(InEdgeIt& e, const Node v) const { 
    1.35        e=InEdgeIt(*this,v); return e; }
    1.36  
    1.37 +    /// Node ID.
    1.38 +    
    1.39 +    /// The ID of a valid Node is a nonnegative integer not greater than
    1.40 +    /// \ref maxNodeId(). The range of the ID's is not surely continuous
    1.41 +    /// and the greatest node ID can be actually less then \ref maxNodeId().
    1.42 +    ///
    1.43 +    /// The ID of the \ref INVALID node is -1.
    1.44 +    ///\return The ID of the node \c v. 
    1.45      static int id(Node v) { return v.n; }
    1.46 +    /// Edge ID.
    1.47 +    
    1.48 +    /// The ID of a valid Edge is a nonnegative integer not greater than
    1.49 +    /// \ref maxEdgeId(). The range of the ID's is not surely continuous
    1.50 +    /// and the greatest edge ID can be actually less then \ref maxEdgeId().
    1.51 +    ///
    1.52 +    /// The ID of the \ref INVALID edge is -1.
    1.53 +    ///\return The ID of the edge \c e. 
    1.54      static int id(Edge e) { return e.n; }
    1.55  
    1.56      Node addNode() {