COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/core.h

    r1107 r1152  
    447447
    448448  }
     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
    449468
    450469  /// \brief Class to copy a digraph.
     
    18501869    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
    18511870    ///
    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
    18571872    {
    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
    18601898#endif
    1861 
    1862   };
    1863 
    1864   /// @}
    1865 
    1866 } //namespace lemon
    1867 
    1868 #endif
Note: See TracChangeset for help on using the changeset viewer.