lemon/core.h
changeset 959 157427808b40
parent 937 17e36e175725
child 960 0da74b2d0bea
child 964 7fdaa05a69a1
child 975 756022ac1674
     1.1 --- a/lemon/core.h	Fri Jun 22 16:25:56 2012 +0200
     1.2 +++ b/lemon/core.h	Fri Aug 24 15:37:23 2012 +0200
     1.3 @@ -1848,15 +1848,26 @@
     1.4      ///this operator. If you change the outgoing arcs of
     1.5      ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
     1.6      ///
     1.7 -#ifdef DOXYGEN
     1.8 -    Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
     1.9 -#else
    1.10 -    using ArcLookUp<GR>::operator() ;
    1.11 -    Arc operator()(Node s, Node t, Arc prev) const
    1.12 +    Arc operator()(Node s, Node t, Arc prev=INVALID) const
    1.13      {
    1.14 -      return prev==INVALID?(*this)(s,t):_next[prev];
    1.15 +      if(prev==INVALID)
    1.16 +        {
    1.17 +          Arc f=INVALID;
    1.18 +          Arc e;
    1.19 +          for(e=_head[s];
    1.20 +              e!=INVALID&&_g.target(e)!=t;
    1.21 +              e = t < _g.target(e)?_left[e]:_right[e]) ;
    1.22 +          while(e!=INVALID)
    1.23 +            if(_g.target(e)==t)
    1.24 +              {
    1.25 +                f = e;
    1.26 +                e = _left[e];
    1.27 +              }
    1.28 +            else e = _right[e];
    1.29 +          return f;
    1.30 +        }
    1.31 +      else return _next[prev];
    1.32      }
    1.33 -#endif
    1.34  
    1.35    };
    1.36