Bugfix in list_graph
authordeba
Mon, 03 Oct 2005 14:22:10 +0000
changeset 170244d495c659b5
parent 1701 77bb84387815
child 1703 eb90e3d6bddc
Bugfix in list_graph
lemon/list_graph.h
     1.1 --- a/lemon/list_graph.h	Mon Oct 03 13:51:25 2005 +0000
     1.2 +++ b/lemon/list_graph.h	Mon Oct 03 14:22:10 2005 +0000
     1.3 @@ -282,6 +282,9 @@
     1.4        if(edges[e.id].prev_in != -1)
     1.5  	edges[edges[e.id].prev_in].next_in = edges[e.id].next_in;
     1.6        else nodes[edges[e.id].target].first_in = edges[e.id].next_in;
     1.7 +      if (nodes[n.id].first_in != -1) {
     1.8 +	edges[nodes[n.id].first_in].prev_in = e.id;
     1.9 +      }
    1.10        edges[e.id].target = n.id;
    1.11        edges[e.id].prev_in = -1;
    1.12        edges[e.id].next_in = nodes[n.id].first_in;
    1.13 @@ -294,6 +297,9 @@
    1.14        if(edges[e.id].prev_out != -1)
    1.15  	edges[edges[e.id].prev_out].next_out = edges[e.id].next_out;
    1.16        else nodes[edges[e.id].source].first_out = edges[e.id].next_out;
    1.17 +      if (nodes[n.id].first_out != -1) {
    1.18 +	edges[nodes[n.id].first_out].prev_out = e.id;
    1.19 +      }
    1.20        edges[e.id].source = n.id;
    1.21        edges[e.id].prev_out = -1;
    1.22        edges[e.id].next_out = nodes[n.id].first_out;