[Lemon-commits] deba: r3294 - lemon/trunk/lemon

Lemon SVN svn at lemon.cs.elte.hu
Fri Jun 15 16:32:49 CEST 2007


Author: deba
Date: Fri Jun 15 16:32:48 2007
New Revision: 3294

Modified:
   lemon/trunk/lemon/list_graph.h
   lemon/trunk/lemon/smart_graph.h

Log:
Space reservation for SmartGraph

Doc improvments



Modified: lemon/trunk/lemon/list_graph.h
==============================================================================
--- lemon/trunk/lemon/list_graph.h	(original)
+++ lemon/trunk/lemon/list_graph.h	Fri Jun 15 16:32:48 2007
@@ -389,22 +389,24 @@
       changeSource(e,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
-    ///contain at least 10 million nodes then it is worth reserving
-    ///space for this amount before starting to build the graph.
+    /// 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: see the \ref reserveNode function.
-    void reserveEdge(int n) { edges.reserve(n); };
-
+    /// 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); };
 
     ///Contract two nodes.
 

Modified: lemon/trunk/lemon/smart_graph.h
==============================================================================
--- lemon/trunk/lemon/smart_graph.h	(original)
+++ lemon/trunk/lemon/smart_graph.h	Fri Jun 15 16:32:48 2007
@@ -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.



More information about the Lemon-commits mailing list