diff -r 853fcddcf282 -r 2e20aad15754 lemon/list_graph.h --- a/lemon/list_graph.h Sun Aug 23 11:09:22 2009 +0200 +++ b/lemon/list_graph.h Sun Aug 23 11:10:40 2009 +0200 @@ -1311,6 +1311,26 @@ Parent::clear(); } + /// Reserve memory for nodes. + + /// Using this function, it is possible to avoid superfluous memory + /// allocation: if you know that the graph you want to build will + /// be 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); }; + + /// Reserve memory for edges. + + /// Using this function, it is possible to avoid superfluous memory + /// allocation: if you know that the graph you want to build will + /// be 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) { arcs.reserve(2 * m); }; + /// \brief Class to make a snapshot of the graph and restore /// it later. ///