# HG changeset patch # User deba # Date 1181917968 0 # Node ID 717a5134ddeb6b07e882180a37e913dd1af0b2ca # Parent dc3f7991ad5844447653224cbee6835609e44bd6 Space reservation for SmartGraph Doc improvments diff -r dc3f7991ad58 -r 717a5134ddeb lemon/list_graph.h --- a/lemon/list_graph.h Fri Jun 15 14:31:14 2007 +0000 +++ b/lemon/list_graph.h Fri Jun 15 14:32:48 2007 +0000 @@ -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. 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.