diff -r dc3f7991ad58 -r 717a5134ddeb lemon/smart_graph.h --- a/lemon/smart_graph.h Fri Jun 15 14:31:14 2007 +0000 +++ b/lemon/smart_graph.h Fri Jun 15 14:32:48 2007 +0000 @@ -243,6 +243,28 @@ return Parent::addEdge(s, t); } + /// \brief Using this it is possible to avoid the superfluous memory + /// allocation. + + /// Using this it is possible to avoid the superfluous memory + /// allocation: if you know that the graph you want to build will + /// be very large (e.g. it will contain millions of nodes and/or edges) + /// then it is worth reserving space for this amount before starting + /// to build the graph. + /// \sa reserveEdge + void reserveNode(int n) { nodes.reserve(n); }; + + /// \brief Using this it is possible to avoid the superfluous memory + /// allocation. + + /// Using this it is possible to avoid the superfluous memory + /// allocation: if you know that the graph you want to build will + /// be very large (e.g. it will contain millions of nodes and/or edges) + /// then it is worth reserving space for this amount before starting + /// to build the graph. + /// \sa reserveNode + void reserveEdge(int m) { edges.reserve(m); }; + ///Clear the graph. ///Erase all the nodes and edges from the graph.