COIN-OR::LEMON - Graph Library

Changeset 1152:20ae244b4779 in lemon for lemon


Ignore:
Timestamp:
08/24/12 16:10:31 (12 years ago)
Author:
Alpar Juttner <alpar@…>
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
Message:

Merge bugfix #447

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/core.h

    r1111 r1152  
    18691869    ///a single node \c n, then \ref refresh(Node) "refresh(n)" is enough.
    18701870    ///
    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
    18761872    {
    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
    18791898#endif
    1880 
    1881   };
    1882 
    1883   /// @}
    1884 
    1885 } //namespace lemon
    1886 
    1887 #endif
  • lemon/core.h

    r1149 r1152  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2010
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    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.
     
    12421261  protected:
    12431262
    1244     class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type {
     1263    class AutoNodeMap : public ItemSetTraits<GR, Node>::template Map<Arc>::Type
     1264    {
    12451265      typedef typename ItemSetTraits<GR, Node>::template Map<Arc>::Type Parent;
    12461266
     
    12811301    };
    12821302
    1283   protected: 
     1303  protected:
    12841304
    12851305    const Digraph &_g;
Note: See TracChangeset for help on using the changeset viewer.