lemon/bits/traits.h
changeset 1184 3c00344f49c9
parent 1026 699c7eac2c6d
     1.1 --- a/lemon/bits/traits.h	Mon Jul 16 16:21:40 2018 +0200
     1.2 +++ b/lemon/bits/traits.h	Wed Oct 17 19:14:07 2018 +0200
     1.3 @@ -2,7 +2,7 @@
     1.4   *
     1.5   * This file is a part of LEMON, a generic C++ optimization library.
     1.6   *
     1.7 - * Copyright (C) 2003-2009
     1.8 + * Copyright (C) 2003-2013
     1.9   * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10   * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11   *
    1.12 @@ -151,6 +151,88 @@
    1.13  
    1.14    };
    1.15  
    1.16 +  template <typename GR, typename Enable = void>
    1.17 +  struct RedNodeNotifierIndicator {
    1.18 +    typedef InvalidType Type;
    1.19 +  };
    1.20 +  template <typename GR>
    1.21 +  struct RedNodeNotifierIndicator<
    1.22 +    GR,
    1.23 +    typename enable_if<typename GR::RedNodeNotifier::Notifier, void>::type
    1.24 +  > {
    1.25 +    typedef typename GR::RedNodeNotifier Type;
    1.26 +  };
    1.27 +
    1.28 +  template <typename GR>
    1.29 +  class ItemSetTraits<GR, typename GR::RedNode> {
    1.30 +  public:
    1.31 +
    1.32 +    typedef GR BpGraph;
    1.33 +    typedef GR Graph;
    1.34 +    typedef GR Digraph;
    1.35 +
    1.36 +    typedef typename GR::RedNode Item;
    1.37 +    typedef typename GR::RedNodeIt ItemIt;
    1.38 +
    1.39 +    typedef typename RedNodeNotifierIndicator<GR>::Type ItemNotifier;
    1.40 +
    1.41 +    template <typename V>
    1.42 +    class Map : public GR::template RedNodeMap<V> {
    1.43 +      typedef typename GR::template RedNodeMap<V> Parent;
    1.44 +
    1.45 +    public:
    1.46 +      typedef typename GR::template RedNodeMap<V> Type;
    1.47 +      typedef typename Parent::Value Value;
    1.48 +
    1.49 +      Map(const GR& _bpgraph) : Parent(_bpgraph) {}
    1.50 +      Map(const GR& _bpgraph, const Value& _value)
    1.51 +        : Parent(_bpgraph, _value) {}
    1.52 +
    1.53 +     };
    1.54 +
    1.55 +  };
    1.56 +
    1.57 +  template <typename GR, typename Enable = void>
    1.58 +  struct BlueNodeNotifierIndicator {
    1.59 +    typedef InvalidType Type;
    1.60 +  };
    1.61 +  template <typename GR>
    1.62 +  struct BlueNodeNotifierIndicator<
    1.63 +    GR,
    1.64 +    typename enable_if<typename GR::BlueNodeNotifier::Notifier, void>::type
    1.65 +  > {
    1.66 +    typedef typename GR::BlueNodeNotifier Type;
    1.67 +  };
    1.68 +
    1.69 +  template <typename GR>
    1.70 +  class ItemSetTraits<GR, typename GR::BlueNode> {
    1.71 +  public:
    1.72 +
    1.73 +    typedef GR BpGraph;
    1.74 +    typedef GR Graph;
    1.75 +    typedef GR Digraph;
    1.76 +
    1.77 +    typedef typename GR::BlueNode Item;
    1.78 +    typedef typename GR::BlueNodeIt ItemIt;
    1.79 +
    1.80 +    typedef typename BlueNodeNotifierIndicator<GR>::Type ItemNotifier;
    1.81 +
    1.82 +    template <typename V>
    1.83 +    class Map : public GR::template BlueNodeMap<V> {
    1.84 +      typedef typename GR::template BlueNodeMap<V> Parent;
    1.85 +
    1.86 +    public:
    1.87 +      typedef typename GR::template BlueNodeMap<V> Type;
    1.88 +      typedef typename Parent::Value Value;
    1.89 +
    1.90 +      Map(const GR& _bpgraph) : Parent(_bpgraph) {}
    1.91 +      Map(const GR& _bpgraph, const Value& _value)
    1.92 +        : Parent(_bpgraph, _value) {}
    1.93 +
    1.94 +     };
    1.95 +
    1.96 +  };
    1.97 +
    1.98    template <typename Map, typename Enable = void>
    1.99    struct MapTraits {
   1.100      typedef False ReferenceMapTag;