lemon/list_graph.h
changeset 737 9d6c3e8b2421
parent 735 853fcddcf282
child 738 456fa5bc3256
equal deleted inserted replaced
20:242c20895a03 21:7e55a1936d2c
  1309     ///
  1309     ///
  1310     void clear() {
  1310     void clear() {
  1311       Parent::clear();
  1311       Parent::clear();
  1312     }
  1312     }
  1313 
  1313 
       
  1314     /// Reserve memory for nodes.
       
  1315 
       
  1316     /// Using this function, it is possible to avoid superfluous memory
       
  1317     /// allocation: if you know that the graph you want to build will
       
  1318     /// be large (e.g. it will contain millions of nodes and/or edges),
       
  1319     /// then it is worth reserving space for this amount before starting
       
  1320     /// to build the graph.
       
  1321     /// \sa reserveEdge()
       
  1322     void reserveNode(int n) { nodes.reserve(n); };
       
  1323 
       
  1324     /// Reserve memory for edges.
       
  1325 
       
  1326     /// Using this function, it is possible to avoid superfluous memory
       
  1327     /// allocation: if you know that the graph you want to build will
       
  1328     /// be large (e.g. it will contain millions of nodes and/or edges),
       
  1329     /// then it is worth reserving space for this amount before starting
       
  1330     /// to build the graph.
       
  1331     /// \sa reserveNode()
       
  1332     void reserveEdge(int m) { arcs.reserve(2 * m); };
       
  1333 
  1314     /// \brief Class to make a snapshot of the graph and restore
  1334     /// \brief Class to make a snapshot of the graph and restore
  1315     /// it later.
  1335     /// it later.
  1316     ///
  1336     ///
  1317     /// Class to make a snapshot of the graph and restore it later.
  1337     /// Class to make a snapshot of the graph and restore it later.
  1318     ///
  1338     ///