COIN-OR::LEMON - Graph Library

Changeset 1457:be025fc1b13d in lemon-0.x


Ignore:
Timestamp:
06/09/05 11:47:51 (15 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1937
Message:

Serious bugfix in ListGraph::SnapShot? and SmartGraph::SnapShot?

Location:
lemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/list_graph.h

    r1435 r1457  
    458458      }
    459459
     460      ///\bug What is this used for?
     461      ///
     462      virtual void build() {}
     463      ///\bug What is this used for?
     464      ///
     465      virtual void clear() {}
     466
    460467      void regist(ListGraph &_g) {
    461468        g=&_g;
     
    518525    ///\todo This function might be called undo().
    519526      void restore() {
     527        ListGraph &old_g=*g;
    520528        deregist();
    521529        while(!added_edges.empty()) {
    522           g->erase(added_edges.front());
     530          old_g.erase(added_edges.front());
    523531          added_edges.pop_front();
    524532        }
    525533        while(!added_nodes.empty()) {
    526           g->erase(added_nodes.front());
     534          old_g.erase(added_nodes.front());
    527535          added_nodes.pop_front();
    528536        }
  • lemon/smart_graph.h

    r1435 r1457  
    281281    void restoreSnapShot(const SnapShot &s)
    282282    {
    283       while(s.edge_num>edges.size()) {
     283      while(s.edge_num<edges.size()) {
    284284        Parent::getNotifier(Edge()).erase(Edge(edges.size()-1));
    285285        nodes[edges.back().target].first_in=edges.back().next_in;
     
    288288      }
    289289      //nodes.resize(s.nodes_num);
    290       while(s.node_num>nodes.size()) {
     290      while(s.node_num<nodes.size()) {
    291291        Parent::getNotifier(Node()).erase(Node(nodes.size()-1));
    292292        nodes.pop_back();
Note: See TracChangeset for help on using the changeset viewer.