COIN-OR::LEMON - Graph Library

Ticket #169: fix_75cf49ce5390.patch

File fix_75cf49ce5390.patch, 2.6 KB (added by Peter Kovacs, 15 years ago)
  • lemon/bits/traits.h

    # HG changeset patch
    # User Peter Kovacs <kpeter@inf.elte.hu>
    # Date 1225831006 -3600
    # Node ID 75cf49ce539059c67130b03592325fcbd5e4f96c
    # Parent  3fb8ed1322de7eb738605582ff668a1ba0120d62
    Add missing tags and indicators
    
    diff --git a/lemon/bits/traits.h b/lemon/bits/traits.h
    a b  
    218218  };
    219219
    220220  template <typename Graph, typename Enable = void>
     221  struct ArcNumTagIndicator {
     222    static const bool value = false;
     223  };
     224
     225  template <typename Graph>
     226  struct ArcNumTagIndicator<
     227    Graph,
     228    typename enable_if<typename Graph::ArcNumTag, void>::type
     229  > {
     230    static const bool value = true;
     231  };
     232
     233  template <typename Graph, typename Enable = void>
    221234  struct EdgeNumTagIndicator {
    222235    static const bool value = false;
    223236  };
     
    226239  struct EdgeNumTagIndicator<
    227240    Graph,
    228241    typename enable_if<typename Graph::EdgeNumTag, void>::type
     242  > {
     243    static const bool value = true;
     244  };
     245
     246  template <typename Graph, typename Enable = void>
     247  struct FindArcTagIndicator {
     248    static const bool value = false;
     249  };
     250
     251  template <typename Graph>
     252  struct FindArcTagIndicator<
     253    Graph,
     254    typename enable_if<typename Graph::FindArcTag, void>::type
    229255  > {
    230256    static const bool value = true;
    231257  };
  • lemon/full_graph.h

    diff --git a/lemon/full_graph.h b/lemon/full_graph.h
    a b  
    306306    }
    307307
    308308    typedef True NodeNumTag;
     309    typedef True ArcNumTag;
    309310    typedef True EdgeNumTag;
    310311
    311312    int nodeNum() const { return _node_num; }
     
    343344    }
    344345
    345346    typedef True FindEdgeTag;
     347    typedef True FindArcTag;
    346348
    347349    Edge findEdge(Node u, Node v, Edge prev = INVALID) const {
    348350      return prev != INVALID ? INVALID : edge(u, v);
  • lemon/grid_graph.h

    diff --git a/lemon/grid_graph.h b/lemon/grid_graph.h
    a b  
    8282    }
    8383
    8484    typedef True NodeNumTag;
     85    typedef True EdgeNumTag;
    8586    typedef True ArcNumTag;
    8687
    8788    int nodeNum() const { return _node_num; }
     
    127128    static Arc arcFromId(int id) { return Arc(id);}
    128129
    129130    typedef True FindEdgeTag;
     131    typedef True FindArcTag;
    130132
    131133    Edge findEdge(Node u, Node v, Edge prev = INVALID) const {
    132134      if (prev != INVALID) return INVALID;
  • lemon/smart_graph.h

    diff --git a/lemon/smart_graph.h b/lemon/smart_graph.h
    a b  
    6767      : nodes(_g.nodes), arcs(_g.arcs) { }
    6868
    6969    typedef True NodeNumTag;
    70     typedef True EdgeNumTag;
     70    typedef True ArcNumTag;
    7171
    7272    int nodeNum() const { return nodes.size(); }
    7373    int arcNum() const { return arcs.size(); }