lemon/core.h
changeset 1152 20ae244b4779
parent 1111 c8fce9beb46a
parent 1149 157427808b40
child 1162 404b98971e1f
equal deleted inserted replaced
29:b5bfab82f129 33:912b6285ea68
  1866     ///
  1866     ///
  1867     ///\warning If you change the digraph, refresh() must be called before using
  1867     ///\warning If you change the digraph, refresh() must be called before using
  1868     ///this operator. If you change the outgoing arcs of
  1868     ///this operator. If you change the outgoing arcs of
  1869     ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
  1869     ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
  1870     ///
  1870     ///
  1871 #ifdef DOXYGEN
  1871     Arc operator()(Node s, Node t, Arc prev=INVALID) const
  1872     Arc operator()(Node s, Node t, Arc prev=INVALID) const {}
       
  1873 #else
       
  1874     using ArcLookUp<GR>::operator() ;
       
  1875     Arc operator()(Node s, Node t, Arc prev) const
       
  1876     {
  1872     {
  1877       return prev==INVALID?(*this)(s,t):_next[prev];
  1873       if(prev==INVALID)
  1878     }
  1874         {
       
  1875           Arc f=INVALID;
       
  1876           Arc e;
       
  1877           for(e=_head[s];
       
  1878               e!=INVALID&&_g.target(e)!=t;
       
  1879               e = t < _g.target(e)?_left[e]:_right[e]) ;
       
  1880           while(e!=INVALID)
       
  1881             if(_g.target(e)==t)
       
  1882               {
       
  1883                 f = e;
       
  1884                 e = _left[e];
       
  1885               }
       
  1886             else e = _right[e];
       
  1887           return f;
       
  1888         }
       
  1889       else return _next[prev];
       
  1890     }
       
  1891 
       
  1892   };
       
  1893 
       
  1894   /// @}
       
  1895 
       
  1896 } //namespace lemon
       
  1897 
  1879 #endif
  1898 #endif
  1880 
       
  1881   };
       
  1882 
       
  1883   /// @}
       
  1884 
       
  1885 } //namespace lemon
       
  1886 
       
  1887 #endif