Fix the usage of tags in adaptors.h (#67)
authorPeter Kovacs <kpeter@inf.elte.hu>
Fri, 12 Dec 2008 22:00:03 +0100
changeset 469d369e885d196
parent 434 ad483acf1654
child 470 3c0d39b6388c
Fix the usage of tags in adaptors.h (#67)
There are separate tags for arcs and edges now.
lemon/adaptors.h
     1.1 --- a/lemon/adaptors.h	Tue Dec 02 15:33:22 2008 +0000
     1.2 +++ b/lemon/adaptors.h	Fri Dec 12 22:00:03 2008 +0100
     1.3 @@ -70,10 +70,10 @@
     1.4      typedef NodeNumTagIndicator<Digraph> NodeNumTag;
     1.5      int nodeNum() const { return _digraph->nodeNum(); }
     1.6  
     1.7 -    typedef EdgeNumTagIndicator<Digraph> EdgeNumTag;
     1.8 +    typedef ArcNumTagIndicator<Digraph> ArcNumTag;
     1.9      int arcNum() const { return _digraph->arcNum(); }
    1.10  
    1.11 -    typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
    1.12 +    typedef FindArcTagIndicator<Digraph> FindArcTag;
    1.13      Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) {
    1.14        return _digraph->findArc(u, v, prev);
    1.15      }
    1.16 @@ -198,14 +198,18 @@
    1.17      typedef NodeNumTagIndicator<Graph> NodeNumTag;
    1.18      int nodeNum() const { return _graph->nodeNum(); }
    1.19  
    1.20 +    typedef ArcNumTagIndicator<Graph> ArcNumTag;
    1.21 +    int arcNum() const { return _graph->arcNum(); }
    1.22 +
    1.23      typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
    1.24 -    int arcNum() const { return _graph->arcNum(); }
    1.25      int edgeNum() const { return _graph->edgeNum(); }
    1.26  
    1.27 -    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    1.28 +    typedef FindArcTagIndicator<Graph> FindArcTag;
    1.29      Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) {
    1.30        return _graph->findArc(u, v, prev);
    1.31      }
    1.32 +
    1.33 +    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    1.34      Edge findEdge(const Node& u, const Node& v, const Edge& prev = INVALID) {
    1.35        return _graph->findEdge(u, v, prev);
    1.36      }
    1.37 @@ -330,7 +334,7 @@
    1.38  
    1.39      Arc addArc(const Node& u, const Node& v) { return Parent::addArc(v, u); }
    1.40  
    1.41 -    typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
    1.42 +    typedef FindArcTagIndicator<Digraph> FindArcTag;
    1.43      Arc findArc(const Node& u, const Node& v,
    1.44                  const Arc& prev = INVALID) {
    1.45        return Parent::findArc(v, u, prev);
    1.46 @@ -467,9 +471,9 @@
    1.47      bool hidden(const Arc& a) const { return !(*_arc_filter)[a]; }
    1.48  
    1.49      typedef False NodeNumTag;
    1.50 -    typedef False EdgeNumTag;
    1.51 -
    1.52 -    typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
    1.53 +    typedef False ArcNumTag;
    1.54 +
    1.55 +    typedef FindArcTagIndicator<Digraph> FindArcTag;
    1.56      Arc findArc(const Node& source, const Node& target,
    1.57                  const Arc& prev = INVALID) {
    1.58        if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
    1.59 @@ -610,9 +614,9 @@
    1.60      bool hidden(const Arc& e) const { return !(*_arc_filter)[e]; }
    1.61  
    1.62      typedef False NodeNumTag;
    1.63 -    typedef False EdgeNumTag;
    1.64 -
    1.65 -    typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
    1.66 +    typedef False ArcNumTag;
    1.67 +
    1.68 +    typedef FindArcTagIndicator<Digraph> FindArcTag;
    1.69      Arc findArc(const Node& source, const Node& target,
    1.70                  const Arc& prev = INVALID) {
    1.71        if (!(*_node_filter)[source] || !(*_node_filter)[target]) {
    1.72 @@ -935,9 +939,10 @@
    1.73      bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; }
    1.74  
    1.75      typedef False NodeNumTag;
    1.76 +    typedef False ArcNumTag;
    1.77      typedef False EdgeNumTag;
    1.78  
    1.79 -    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    1.80 +    typedef FindArcTagIndicator<Graph> FindArcTag;
    1.81      Arc findArc(const Node& u, const Node& v,
    1.82                  const Arc& prev = INVALID) {
    1.83        if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) {
    1.84 @@ -949,6 +954,8 @@
    1.85        }
    1.86        return arc;
    1.87      }
    1.88 +
    1.89 +    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
    1.90      Edge findEdge(const Node& u, const Node& v,
    1.91                    const Edge& prev = INVALID) {
    1.92        if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) {
    1.93 @@ -1131,9 +1138,10 @@
    1.94      bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; }
    1.95  
    1.96      typedef False NodeNumTag;
    1.97 +    typedef False ArcNumTag;
    1.98      typedef False EdgeNumTag;
    1.99  
   1.100 -    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
   1.101 +    typedef FindArcTagIndicator<Graph> FindArcTag;
   1.102      Arc findArc(const Node& u, const Node& v,
   1.103                  const Arc& prev = INVALID) {
   1.104        Arc arc = Parent::findArc(u, v, prev);
   1.105 @@ -1142,6 +1150,8 @@
   1.106        }
   1.107        return arc;
   1.108      }
   1.109 +
   1.110 +    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
   1.111      Edge findEdge(const Node& u, const Node& v,
   1.112                    const Edge& prev = INVALID) {
   1.113        Edge edge = Parent::findEdge(u, v, prev);
   1.114 @@ -1846,11 +1856,14 @@
   1.115  
   1.116      typedef NodeNumTagIndicator<Digraph> NodeNumTag;
   1.117      int nodeNum() const { return 2 * _digraph->arcNum(); }
   1.118 -    typedef EdgeNumTagIndicator<Digraph> EdgeNumTag;
   1.119 +
   1.120 +    typedef ArcNumTagIndicator<Digraph> ArcNumTag;
   1.121      int arcNum() const { return 2 * _digraph->arcNum(); }
   1.122 +
   1.123 +    typedef ArcNumTag EdgeNumTag;
   1.124      int edgeNum() const { return _digraph->arcNum(); }
   1.125  
   1.126 -    typedef FindEdgeTagIndicator<Digraph> FindEdgeTag;
   1.127 +    typedef FindArcTagIndicator<Digraph> FindArcTag;
   1.128      Arc findArc(Node s, Node t, Arc p = INVALID) const {
   1.129        if (p == INVALID) {
   1.130          Edge arc = _digraph->findArc(s, t);
   1.131 @@ -1869,6 +1882,7 @@
   1.132        return INVALID;
   1.133      }
   1.134  
   1.135 +    typedef FindArcTag FindEdgeTag;
   1.136      Edge findEdge(Node s, Node t, Edge p = INVALID) const {
   1.137        if (s != t) {
   1.138          if (p == INVALID) {
   1.139 @@ -2224,10 +2238,10 @@
   1.140      typedef NodeNumTagIndicator<Graph> NodeNumTag;
   1.141      int nodeNum() const { return _graph->nodeNum(); }
   1.142  
   1.143 -    typedef EdgeNumTagIndicator<Graph> EdgeNumTag;
   1.144 +    typedef EdgeNumTagIndicator<Graph> ArcNumTag;
   1.145      int arcNum() const { return _graph->edgeNum(); }
   1.146  
   1.147 -    typedef FindEdgeTagIndicator<Graph> FindEdgeTag;
   1.148 +    typedef FindEdgeTagIndicator<Graph> FindArcTag;
   1.149      Arc findArc(const Node& u, const Node& v,
   1.150                  const Arc& prev = INVALID) {
   1.151        Arc arc = prev;
   1.152 @@ -2884,17 +2898,16 @@
   1.153      }
   1.154  
   1.155      typedef True NodeNumTag;
   1.156 -
   1.157      int nodeNum() const {
   1.158        return  2 * countNodes(*_digraph);
   1.159      }
   1.160  
   1.161 -    typedef True EdgeNumTag;
   1.162 +    typedef True ArcNumTag;
   1.163      int arcNum() const {
   1.164        return countArcs(*_digraph) + countNodes(*_digraph);
   1.165      }
   1.166  
   1.167 -    typedef True FindEdgeTag;
   1.168 +    typedef True FindArcTag;
   1.169      Arc findArc(const Node& u, const Node& v,
   1.170                  const Arc& prev = INVALID) const {
   1.171        if (inNode(u)) {