COIN-OR::LEMON - Graph Library

Changeset 1152:20ae244b4779 in lemon


Ignore:
Timestamp:
08/24/12 16:10:31 (7 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:
4 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;
  • test/CMakeLists.txt

    r1124 r1152  
    1414SET(TESTS
    1515  adaptors_test
     16  arc_look_up_test
    1617  bellman_ford_test
    1718  bfs_test
  • test/CMakeLists.txt

    r1149 r1152  
    1515  adaptors_test
    1616  arc_look_up_test
     17  bellman_ford_test
    1718  bfs_test
    1819  circulation_test
     
    2627  error_test
    2728  euler_test
     29  fractional_matching_test
    2830  gomory_hu_test
    2931  graph_copy_test
     
    3638  maps_test
    3739  matching_test
     40  max_cardinality_search_test
     41  max_clique_test
    3842  min_cost_arborescence_test
    3943  min_cost_flow_test
     44  min_mean_cycle_test
     45  nagamochi_ibaraki_test
    4046  path_test
     47  planarity_test
    4148  preflow_test
    4249  radix_sort_test
Note: See TracChangeset for help on using the changeset viewer.