lemon/smart_graph.h
changeset 783 2e20aad15754
parent 782 853fcddcf282
child 827 580af8cf2f6a
equal deleted inserted replaced
22:d03e112b375a 23:54b217cf402a
   689     ///
   689     ///
   690     void clear() {
   690     void clear() {
   691       Parent::clear();
   691       Parent::clear();
   692     }
   692     }
   693 
   693 
       
   694     /// Reserve memory for nodes.
       
   695 
       
   696     /// Using this function, it is possible to avoid superfluous memory
       
   697     /// allocation: if you know that the graph you want to build will
       
   698     /// be large (e.g. it will contain millions of nodes and/or edges),
       
   699     /// then it is worth reserving space for this amount before starting
       
   700     /// to build the graph.
       
   701     /// \sa reserveEdge()
       
   702     void reserveNode(int n) { nodes.reserve(n); };
       
   703 
       
   704     /// Reserve memory for edges.
       
   705 
       
   706     /// Using this function, it is possible to avoid superfluous memory
       
   707     /// allocation: if you know that the graph you want to build will
       
   708     /// be large (e.g. it will contain millions of nodes and/or edges),
       
   709     /// then it is worth reserving space for this amount before starting
       
   710     /// to build the graph.
       
   711     /// \sa reserveNode()
       
   712     void reserveEdge(int m) { arcs.reserve(2 * m); };
       
   713 
   694   public:
   714   public:
   695 
   715 
   696     class Snapshot;
   716     class Snapshot;
   697 
   717 
   698   protected:
   718   protected: