[Lemon-commits] [lemon_svn] deba: r2801 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:55:21 CET 2006
Author: deba
Date: Thu Jun 22 17:16:11 2006
New Revision: 2801
Modified:
hugo/trunk/lemon/list_graph.h
Log:
Added reserveNode function.
Modified: hugo/trunk/lemon/list_graph.h
==============================================================================
--- hugo/trunk/lemon/list_graph.h (original)
+++ hugo/trunk/lemon/list_graph.h Thu Jun 22 17:16:11 2006
@@ -358,12 +358,23 @@
_changeSource(e,t);
}
- ///Using this it is possible to avoid the superfluous memory allocation.
+ ///Using this it is possible to avoid the superfluous memory
+ ///allocation.
- ///Using this it is possible to avoid the superfluous memory allocation.
- ///\todo more docs...
+ ///Using this it is possible to avoid the superfluous memory
+ ///allocation: if you know that the graph you want to build will
+ ///contain at least 10 million nodes then it is worth to reserve
+ ///space for this amount before starting to build the graph.
+ void reserveNode(int n) { nodes.reserve(n); };
+
+ ///Using this it is possible to avoid the superfluous memory
+ ///allocation.
+
+ ///Using this it is possible to avoid the superfluous memory
+ ///allocation: see the \ref reserveNode function.
void reserveEdge(int n) { edges.reserve(n); };
+
///Contract two nodes.
///This function contracts two nodes.
More information about the Lemon-commits
mailing list