Changeset 1152:20ae244b4779 in lemon for lemon/core.h
 Timestamp:
 08/24/12 16:10:31 (10 years ago)
 Branch:
 default
 Parents:
 1148:78434a448b5e (diff), 1149:157427808b40 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.  Phase:
 public
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

lemon/core.h
r1111 r1152 1869 1869 ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough. 1870 1870 /// 1871 #ifdef DOXYGEN 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 1871 Arc operator()(Node s, Node t, Arc prev=INVALID) const 1876 1872 { 1877 return prev==INVALID?(*this)(s,t):_next[prev]; 1878 } 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 1879 1898 #endif 1880 1881 };1882 1883 /// @}1884 1885 } //namespace lemon1886 1887 #endif 
lemon/core.h
r1149 r1152 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 200320 095 * Copyright (C) 20032010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 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. … … 1242 1261 protected: 1243 1262 1244 class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type { 1263 class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type 1264 { 1245 1265 typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent; 1246 1266 … … 1281 1301 }; 1282 1302 1283 protected: 1303 protected: 1284 1304 1285 1305 const Digraph &_g;
Note: See TracChangeset
for help on using the changeset viewer.