lemon/smart_graph.h
branch1.0
changeset 336 cada82273723
parent 317 64f8f7cc6168
child 337 5a3d689ea770
equal deleted inserted replaced
10:1aff93efd528 11:e865757db6fb
   303     Node split(Node n, bool connect = true)
   303     Node split(Node n, bool connect = true)
   304     {
   304     {
   305       Node b = addNode();
   305       Node b = addNode();
   306       nodes[b._id].first_out=nodes[n._id].first_out;
   306       nodes[b._id].first_out=nodes[n._id].first_out;
   307       nodes[n._id].first_out=-1;
   307       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       }
   309       if(connect) addArc(n,b);
   311       if(connect) addArc(n,b);
   310       return b;
   312       return b;
   311     }
   313     }
   312 
   314 
   313   public:
   315   public: