Space reservation for SmartGraph
authordeba
Fri, 15 Jun 2007 14:32:48 +0000
changeset 2456717a5134ddeb
parent 2455 dc3f7991ad58
child 2457 8c791ee69a45
Space reservation for SmartGraph

Doc improvments
lemon/list_graph.h
lemon/smart_graph.h
     1.1 --- a/lemon/list_graph.h	Fri Jun 15 14:31:14 2007 +0000
     1.2 +++ b/lemon/list_graph.h	Fri Jun 15 14:32:48 2007 +0000
     1.3 @@ -389,22 +389,24 @@
     1.4        changeSource(e,t);
     1.5      }
     1.6  
     1.7 -    /// \brief Using this it is possible to avoid the superfluous memory
     1.8 -    /// allocation.
     1.9 -
    1.10 -    ///Using this it is possible to avoid the superfluous memory
    1.11 -    ///allocation: if you know that the graph you want to build will
    1.12 -    ///contain at least 10 million nodes then it is worth reserving
    1.13 -    ///space for this amount before starting to build the graph.
    1.14 +    /// Using this it is possible to avoid the superfluous memory
    1.15 +    /// allocation: if you know that the graph you want to build will
    1.16 +    /// be very large (e.g. it will contain millions of nodes and/or edges)
    1.17 +    /// then it is worth reserving space for this amount before starting
    1.18 +    /// to build the graph.
    1.19 +    /// \sa reserveEdge
    1.20      void reserveNode(int n) { nodes.reserve(n); };
    1.21  
    1.22      /// \brief Using this it is possible to avoid the superfluous memory
    1.23      /// allocation.
    1.24  
    1.25 -    ///Using this it is possible to avoid the superfluous memory
    1.26 -    ///allocation: see the \ref reserveNode function.
    1.27 -    void reserveEdge(int n) { edges.reserve(n); };
    1.28 -
    1.29 +    /// Using this it is possible to avoid the superfluous memory
    1.30 +    /// allocation: if you know that the graph you want to build will
    1.31 +    /// be very large (e.g. it will contain millions of nodes and/or edges)
    1.32 +    /// then it is worth reserving space for this amount before starting
    1.33 +    /// to build the graph.
    1.34 +    /// \sa reserveNode
    1.35 +    void reserveEdge(int m) { edges.reserve(m); };
    1.36  
    1.37      ///Contract two nodes.
    1.38  
     2.1 --- a/lemon/smart_graph.h	Fri Jun 15 14:31:14 2007 +0000
     2.2 +++ b/lemon/smart_graph.h	Fri Jun 15 14:32:48 2007 +0000
     2.3 @@ -243,6 +243,28 @@
     2.4        return Parent::addEdge(s, t); 
     2.5      }
     2.6  
     2.7 +    /// \brief Using this it is possible to avoid the superfluous memory
     2.8 +    /// allocation.
     2.9 +
    2.10 +    /// Using this it is possible to avoid the superfluous memory
    2.11 +    /// allocation: if you know that the graph you want to build will
    2.12 +    /// be very large (e.g. it will contain millions of nodes and/or edges)
    2.13 +    /// then it is worth reserving space for this amount before starting
    2.14 +    /// to build the graph.
    2.15 +    /// \sa reserveEdge
    2.16 +    void reserveNode(int n) { nodes.reserve(n); };
    2.17 +
    2.18 +    /// \brief Using this it is possible to avoid the superfluous memory
    2.19 +    /// allocation.
    2.20 +
    2.21 +    /// Using this it is possible to avoid the superfluous memory
    2.22 +    /// allocation: if you know that the graph you want to build will
    2.23 +    /// be very large (e.g. it will contain millions of nodes and/or edges)
    2.24 +    /// then it is worth reserving space for this amount before starting
    2.25 +    /// to build the graph.
    2.26 +    /// \sa reserveNode
    2.27 +    void reserveEdge(int m) { edges.reserve(m); };
    2.28 +
    2.29      ///Clear the graph.
    2.30      
    2.31      ///Erase all the nodes and edges from the graph.