COIN-OR::LEMON - Graph Library

Ticket #170: smart_bugfix_99dcd99637ba.patch

File smart_bugfix_99dcd99637ba.patch, 712 bytes (added by Peter Kovacs, 16 years ago)
  • lemon/smart_graph.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1226009577 -3600
    # Node ID 99dcd99637ba06d308970e8a8d0ae55a4656e7b2
    # Parent  9194a12c52e6ff9cc83a855fe77aacc7538248bd
    Critical bug fix in SmartDigraph::split()
    
    diff --git a/lemon/smart_graph.h b/lemon/smart_graph.h
    a b  
    305305      Node b = addNode();
    306306      nodes[b._id].first_out=nodes[n._id].first_out;
    307307      nodes[n._id].first_out=-1;
    308       for(int i=nodes[b._id].first_out;i!=-1;i++) arcs[i].source=b._id;
     308      for(int i=nodes[b._id].first_out; i!=-1; i=arcs[i].next_out) {
     309        arcs[i].source=b._id;
     310      }
    309311      if(connect) addArc(n,b);
    310312      return b;
    311313    }