lemon/core.h
changeset 964 7fdaa05a69a1
parent 942 2b6bffe0e7e8
parent 959 157427808b40
child 966 08712a8c3afe
child 983 8b2d4e5d96e4
     1.1 --- a/lemon/core.h	Wed Sep 12 17:25:48 2012 +0200
     1.2 +++ b/lemon/core.h	Thu Sep 13 11:56:19 2012 +0200
     1.3 @@ -1849,15 +1849,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