lemon/list_graph.h
changeset 741 10c9c3a35b83
parent 740 819ca5b50de0
parent 739 32baeb8e5c8f
child 786 e20173729589
child 787 c2230649a493
     1.1 --- a/lemon/list_graph.h	Tue Sep 29 10:21:51 2009 +0200
     1.2 +++ b/lemon/list_graph.h	Wed Sep 30 08:36:43 2009 +0200
     1.3 @@ -120,20 +120,20 @@
     1.4      void first(Arc& arc) const {
     1.5        int n;
     1.6        for(n = first_node;
     1.7 -          n!=-1 && nodes[n].first_in == -1;
     1.8 +          n != -1 && nodes[n].first_out == -1;
     1.9            n = nodes[n].next) {}
    1.10 -      arc.id = (n == -1) ? -1 : nodes[n].first_in;
    1.11 +      arc.id = (n == -1) ? -1 : nodes[n].first_out;
    1.12      }
    1.13  
    1.14      void next(Arc& arc) const {
    1.15 -      if (arcs[arc.id].next_in != -1) {
    1.16 -        arc.id = arcs[arc.id].next_in;
    1.17 +      if (arcs[arc.id].next_out != -1) {
    1.18 +        arc.id = arcs[arc.id].next_out;
    1.19        } else {
    1.20          int n;
    1.21 -        for(n = nodes[arcs[arc.id].target].next;
    1.22 -            n!=-1 && nodes[n].first_in == -1;
    1.23 +        for(n = nodes[arcs[arc.id].source].next;
    1.24 +            n != -1 && nodes[n].first_out == -1;
    1.25              n = nodes[n].next) {}
    1.26 -        arc.id = (n == -1) ? -1 : nodes[n].first_in;
    1.27 +        arc.id = (n == -1) ? -1 : nodes[n].first_out;
    1.28        }
    1.29      }
    1.30