src/hugo/list_graph.h
changeset 696 48aa9ace1d7d
parent 681 06a3cba90f94
child 705 9d9557b56eb7
equal deleted inserted replaced
3:e8472c77cc8f 4:d2cc71166d2a
   112     }
   112     }
   113 
   113 
   114     int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
   114     int nodeNum() const { return nodes.size(); }  //FIXME: What is this?
   115     int edgeNum() const { return edges.size(); }  //FIXME: What is this?
   115     int edgeNum() const { return edges.size(); }  //FIXME: What is this?
   116 
   116 
       
   117     ///Set the expected number of edges
       
   118 
       
   119     ///With this function, it is possible to set the expected number of edges.
       
   120     ///The use of this fasten the building of the graph and makes
       
   121     ///it possible to avoid the superfluous memory allocation.
       
   122     void reserveEdge(int n) { edges.reserve(n); };
       
   123     
   117     ///\bug This function does something different than
   124     ///\bug This function does something different than
   118     ///its name would suggests...
   125     ///its name would suggests...
   119     int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
   126     int maxNodeId() const { return nodes.size(); }  //FIXME: What is this?
   120     ///\bug This function does something different than
   127     ///\bug This function does something different than
   121     ///its name would suggests...
   128     ///its name would suggests...
   258       if(edges[n].prev_out!=-1)
   265       if(edges[n].prev_out!=-1)
   259 	edges[edges[n].prev_out].next_out = edges[n].next_out;
   266 	edges[edges[n].prev_out].next_out = edges[n].next_out;
   260       else nodes[edges[n].tail].first_out = edges[n].next_out;
   267       else nodes[edges[n].tail].first_out = edges[n].next_out;
   261       
   268       
   262       edges[n].next_in = first_free_edge;
   269       edges[n].next_in = first_free_edge;
   263       first_free_edge = -1;      
   270       first_free_edge = n;      
   264 
   271 
   265       //Update dynamic maps
   272       //Update dynamic maps
   266       Edge e; e.n=n;
   273       Edge e; e.n=n;
   267       for(std::vector<DynMapBase<Edge> * >::iterator i=dyn_edge_maps.begin();
   274       for(std::vector<DynMapBase<Edge> * >::iterator i=dyn_edge_maps.begin();
   268 	  i!=dyn_edge_maps.end(); ++i) (**i).erase(e);
   275 	  i!=dyn_edge_maps.end(); ++i) (**i).erase(e);