# Changeset 2456:717a5134ddeb in lemon-0.x for lemon

Ignore:
Timestamp:
06/15/07 16:32:48 (13 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3293
Message:

Space reservation for SmartGraph?

Doc improvments

Location:
lemon
Files:
2 edited

Unmodified
Removed
• ## lemon/list_graph.h

 r2391 } /// 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 ///contain at least 10 million nodes then it is worth reserving ///space for this amount before starting to build the graph. 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.
• ## lemon/smart_graph.h

 r2391 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.
Note: See TracChangeset for help on using the changeset viewer.