gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Bug fix in the Euler iterators (#264) Handle the case when the first node is isolated.
0 1 0
default
1 file changed with 14 insertions and 2 deletions:
↑ Collapse diff ↑
Show white space 4 line context
... ...
@@ -79,5 +79,10 @@
79 79
      : g(gr), nedge(g)
80 80
    {
81
      if(start==INVALID) start=NodeIt(g);
81
      if (start==INVALID) {
82
        NodeIt n(g);
83
        while (n!=INVALID && OutArcIt(g,n)==INVALID) ++n;
84
        start=n;
85
      }
86
      if (start!=INVALID) {
82 87
      for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n);
83 88
      while(nedge[start]!=INVALID) {
... ...
@@ -88,4 +93,5 @@
88 93
      }
89 94
    }
95
    }
90 96

	
91 97
    ///Arc Conversion
... ...
@@ -172,5 +178,10 @@
172 178
      : g(gr), nedge(g), visited(g, false)
173 179
    {
174
      if(start==INVALID) start=NodeIt(g);
180
      if (start==INVALID) {
181
        NodeIt n(g);
182
        while (n!=INVALID && OutArcIt(g,n)==INVALID) ++n;
183
        start=n;
184
      }
185
      if (start!=INVALID) {
175 186
      for(NodeIt n(g);n!=INVALID;++n) nedge[n]=OutArcIt(g,n);
176 187
      while(nedge[start]!=INVALID) {
... ...
@@ -183,4 +194,5 @@
183 194
      }
184 195
    }
196
    }
185 197

	
186 198
    ///Arc Conversion
0 comments (0 inline)