gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Modify the implementation of ListDigraph::ArcIt (#311) The new implementation is based on out-arc iteration (like ListGraph::ArcIt) instead of in-arc iteration to make it consistent with the documentation.
0 1 0
default
1 file changed with 7 insertions and 7 deletions:
↑ Collapse diff ↑
Show white space 2 line context
... ...
@@ -118,5 +118,5 @@
118 118
      for(n = first_node;
119
          n!=-1 && nodes[n].first_in == -1;
119
          n != -1 && nodes[n].first_out == -1;
120 120
          n = nodes[n].next) {}
121
      arc.id = (n == -1) ? -1 : nodes[n].first_in;
121
      arc.id = (n == -1) ? -1 : nodes[n].first_out;
122 122
    }
... ...
@@ -124,10 +124,10 @@
124 124
    void next(Arc& arc) const {
125
      if (arcs[arc.id].next_in != -1) {
126
        arc.id = arcs[arc.id].next_in;
125
      if (arcs[arc.id].next_out != -1) {
126
        arc.id = arcs[arc.id].next_out;
127 127
      } else {
128 128
        int n;
129
        for(n = nodes[arcs[arc.id].target].next;
130
            n!=-1 && nodes[n].first_in == -1;
129
        for(n = nodes[arcs[arc.id].source].next;
130
            n != -1 && nodes[n].first_out == -1;
131 131
            n = nodes[n].next) {}
132
        arc.id = (n == -1) ? -1 : nodes[n].first_in;
132
        arc.id = (n == -1) ? -1 : nodes[n].first_out;
133 133
      }
0 comments (0 inline)