Added reserveNode function.
1.1 --- a/lemon/list_graph.h Wed Jun 21 11:15:01 2006 +0000
1.2 +++ b/lemon/list_graph.h Thu Jun 22 15:16:11 2006 +0000
1.3 @@ -358,12 +358,23 @@
1.4 _changeSource(e,t);
1.5 }
1.6
1.7 - ///Using this it is possible to avoid the superfluous memory allocation.
1.8 + ///Using this it is possible to avoid the superfluous memory
1.9 + ///allocation.
1.10
1.11 - ///Using this it is possible to avoid the superfluous memory allocation.
1.12 - ///\todo more docs...
1.13 + ///Using this it is possible to avoid the superfluous memory
1.14 + ///allocation: if you know that the graph you want to build will
1.15 + ///contain at least 10 million nodes then it is worth to reserve
1.16 + ///space for this amount before starting to build the graph.
1.17 + void reserveNode(int n) { nodes.reserve(n); };
1.18 +
1.19 + ///Using this it is possible to avoid the superfluous memory
1.20 + ///allocation.
1.21 +
1.22 + ///Using this it is possible to avoid the superfluous memory
1.23 + ///allocation: see the \ref reserveNode function.
1.24 void reserveEdge(int n) { edges.reserve(n); };
1.25
1.26 +
1.27 ///Contract two nodes.
1.28
1.29 ///This function contracts two nodes.