lemon/list_graph.h
changeset 2538 7bdd328de87a
parent 2456 717a5134ddeb
child 2553 bfced05fa852
equal deleted inserted replaced
50:40c25565dae3 51:ef31bf38ab22
   975       
   975       
   976       edges[n].target = u.id;
   976       edges[n].target = u.id;
   977       edges[n | 1].target = v.id;
   977       edges[n | 1].target = v.id;
   978 
   978 
   979       edges[n].next_out = nodes[v.id].first_out;
   979       edges[n].next_out = nodes[v.id].first_out;
   980       edges[n | 1].next_out = nodes[u.id].first_out;
       
   981       if (nodes[v.id].first_out != -1) {
   980       if (nodes[v.id].first_out != -1) {
   982 	edges[nodes[v.id].first_out].prev_out = n;
   981 	edges[nodes[v.id].first_out].prev_out = n;
   983       }
   982       }      
       
   983       edges[n].prev_out = -1;
       
   984       nodes[v.id].first_out = n;
       
   985       
       
   986       edges[n | 1].next_out = nodes[u.id].first_out;
   984       if (nodes[u.id].first_out != -1) {
   987       if (nodes[u.id].first_out != -1) {
   985 	edges[nodes[u.id].first_out].prev_out = (n | 1);
   988 	edges[nodes[u.id].first_out].prev_out = (n | 1);
   986       }
   989       }
   987       
   990       edges[n | 1].prev_out = -1;      
   988       edges[n].prev_out = edges[n | 1].prev_out = -1;
       
   989 	
       
   990       nodes[v.id].first_out = n;
       
   991       nodes[u.id].first_out = (n | 1);
   991       nodes[u.id].first_out = (n | 1);
   992 
   992 
   993       return UEdge(n / 2);
   993       return UEdge(n / 2);
   994     }
   994     }
   995     
   995