Changes in lemon/core.h [1107:2b6bffe0e7e8:1152:20ae244b4779] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/core.h
r1107 r1152 447 447 448 448 } 449 450 /// \brief Check whether a graph is undirected. 451 /// 452 /// This function returns \c true if the given graph is undirected. 453 #ifdef DOXYGEN 454 template <typename GR> 455 bool undirected(const GR& g) { return false; } 456 #else 457 template <typename GR> 458 typename enable_if<UndirectedTagIndicator<GR>, bool>::type 459 undirected(const GR&) { 460 return true; 461 } 462 template <typename GR> 463 typename disable_if<UndirectedTagIndicator<GR>, bool>::type 464 undirected(const GR&) { 465 return false; 466 } 467 #endif 449 468 450 469 /// \brief Class to copy a digraph. … … 1850 1869 ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough. 1851 1870 /// 1852 #ifdef DOXYGEN 1853 Arc operator()(Node s, Node t, Arc prev=INVALID) const {} 1854 #else 1855 using ArcLookUp<GR>::operator() ; 1856 Arc operator()(Node s, Node t, Arc prev) const 1871 Arc operator()(Node s, Node t, Arc prev=INVALID) const 1857 1872 { 1858 return prev==INVALID?(*this)(s,t):_next[prev]; 1859 } 1873 if(prev==INVALID) 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 1860 1898 #endif 1861 1862 };1863 1864 /// @}1865 1866 } //namespace lemon1867 1868 #endif
Note: See TracChangeset
for help on using the changeset viewer.