COIN-OR::LEMON - Graph Library

Changeset 2456:717a5134ddeb in lemon-0.x


Ignore:
Timestamp:
06/15/07 16:32:48 (13 years ago)
Author:
Balazs Dezso
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

Legend:

Unmodified
Added
Removed
  • lemon/list_graph.h

    r2391 r2456  
    390390    }
    391391
     392    /// Using this it is possible to avoid the superfluous memory
     393    /// allocation: if you know that the graph you want to build will
     394    /// be very large (e.g. it will contain millions of nodes and/or edges)
     395    /// then it is worth reserving space for this amount before starting
     396    /// to build the graph.
     397    /// \sa reserveEdge
     398    void reserveNode(int n) { nodes.reserve(n); };
     399
    392400    /// \brief Using this it is possible to avoid the superfluous memory
    393401    /// allocation.
    394402
    395     ///Using this it is possible to avoid the superfluous memory
    396     ///allocation: if you know that the graph you want to build will
    397     ///contain at least 10 million nodes then it is worth reserving
    398     ///space for this amount before starting to build the graph.
    399     void reserveNode(int n) { nodes.reserve(n); };
    400 
    401     /// \brief Using this it is possible to avoid the superfluous memory
    402     /// allocation.
    403 
    404     ///Using this it is possible to avoid the superfluous memory
    405     ///allocation: see the \ref reserveNode function.
    406     void reserveEdge(int n) { edges.reserve(n); };
    407 
     403    /// Using this it is possible to avoid the superfluous memory
     404    /// allocation: if you know that the graph you want to build will
     405    /// be very large (e.g. it will contain millions of nodes and/or edges)
     406    /// then it is worth reserving space for this amount before starting
     407    /// to build the graph.
     408    /// \sa reserveNode
     409    void reserveEdge(int m) { edges.reserve(m); };
    408410
    409411    ///Contract two nodes.
  • lemon/smart_graph.h

    r2391 r2456  
    243243      return Parent::addEdge(s, t);
    244244    }
     245
     246    /// \brief Using this it is possible to avoid the superfluous memory
     247    /// allocation.
     248
     249    /// Using this it is possible to avoid the superfluous memory
     250    /// allocation: if you know that the graph you want to build will
     251    /// be very large (e.g. it will contain millions of nodes and/or edges)
     252    /// then it is worth reserving space for this amount before starting
     253    /// to build the graph.
     254    /// \sa reserveEdge
     255    void reserveNode(int n) { nodes.reserve(n); };
     256
     257    /// \brief Using this it is possible to avoid the superfluous memory
     258    /// allocation.
     259
     260    /// Using this it is possible to avoid the superfluous memory
     261    /// allocation: if you know that the graph you want to build will
     262    /// be very large (e.g. it will contain millions of nodes and/or edges)
     263    /// then it is worth reserving space for this amount before starting
     264    /// to build the graph.
     265    /// \sa reserveNode
     266    void reserveEdge(int m) { edges.reserve(m); };
    245267
    246268    ///Clear the graph.
Note: See TracChangeset for help on using the changeset viewer.