# HG changeset patch # User Peter Kovacs # Date 2008-12-12 22:00:03 # Node ID d369e885d19681445ed911f72fb321e3268ea064 # Parent ad483acf1654bd4d0c093b807b858ed59529f78e Fix the usage of tags in adaptors.h (#67) There are separate tags for arcs and edges now. diff --git a/lemon/adaptors.h b/lemon/adaptors.h --- a/lemon/adaptors.h +++ b/lemon/adaptors.h @@ -70,10 +70,10 @@ typedef NodeNumTagIndicator NodeNumTag; int nodeNum() const { return _digraph->nodeNum(); } - typedef EdgeNumTagIndicator EdgeNumTag; + typedef ArcNumTagIndicator ArcNumTag; int arcNum() const { return _digraph->arcNum(); } - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) { return _digraph->findArc(u, v, prev); } @@ -198,14 +198,18 @@ typedef NodeNumTagIndicator NodeNumTag; int nodeNum() const { return _graph->nodeNum(); } + typedef ArcNumTagIndicator ArcNumTag; + int arcNum() const { return _graph->arcNum(); } + typedef EdgeNumTagIndicator EdgeNumTag; - int arcNum() const { return _graph->arcNum(); } int edgeNum() const { return _graph->edgeNum(); } - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) { return _graph->findArc(u, v, prev); } + + typedef FindEdgeTagIndicator FindEdgeTag; Edge findEdge(const Node& u, const Node& v, const Edge& prev = INVALID) { return _graph->findEdge(u, v, prev); } @@ -330,7 +334,7 @@ Arc addArc(const Node& u, const Node& v) { return Parent::addArc(v, u); } - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) { return Parent::findArc(v, u, prev); @@ -467,9 +471,9 @@ bool hidden(const Arc& a) const { return !(*_arc_filter)[a]; } typedef False NodeNumTag; - typedef False EdgeNumTag; - - typedef FindEdgeTagIndicator FindEdgeTag; + typedef False ArcNumTag; + + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& source, const Node& target, const Arc& prev = INVALID) { if (!(*_node_filter)[source] || !(*_node_filter)[target]) { @@ -610,9 +614,9 @@ bool hidden(const Arc& e) const { return !(*_arc_filter)[e]; } typedef False NodeNumTag; - typedef False EdgeNumTag; - - typedef FindEdgeTagIndicator FindEdgeTag; + typedef False ArcNumTag; + + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& source, const Node& target, const Arc& prev = INVALID) { if (!(*_node_filter)[source] || !(*_node_filter)[target]) { @@ -935,9 +939,10 @@ bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; } typedef False NodeNumTag; + typedef False ArcNumTag; typedef False EdgeNumTag; - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) { if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) { @@ -949,6 +954,8 @@ } return arc; } + + typedef FindEdgeTagIndicator FindEdgeTag; Edge findEdge(const Node& u, const Node& v, const Edge& prev = INVALID) { if (!(*_node_filter_map)[u] || !(*_node_filter_map)[v]) { @@ -1131,9 +1138,10 @@ bool hidden(const Edge& e) const { return !(*_edge_filter_map)[e]; } typedef False NodeNumTag; + typedef False ArcNumTag; typedef False EdgeNumTag; - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindArcTagIndicator FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) { Arc arc = Parent::findArc(u, v, prev); @@ -1142,6 +1150,8 @@ } return arc; } + + typedef FindEdgeTagIndicator FindEdgeTag; Edge findEdge(const Node& u, const Node& v, const Edge& prev = INVALID) { Edge edge = Parent::findEdge(u, v, prev); @@ -1846,11 +1856,14 @@ typedef NodeNumTagIndicator NodeNumTag; int nodeNum() const { return 2 * _digraph->arcNum(); } - typedef EdgeNumTagIndicator EdgeNumTag; + + typedef ArcNumTagIndicator ArcNumTag; int arcNum() const { return 2 * _digraph->arcNum(); } + + typedef ArcNumTag EdgeNumTag; int edgeNum() const { return _digraph->arcNum(); } - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindArcTagIndicator FindArcTag; Arc findArc(Node s, Node t, Arc p = INVALID) const { if (p == INVALID) { Edge arc = _digraph->findArc(s, t); @@ -1869,6 +1882,7 @@ return INVALID; } + typedef FindArcTag FindEdgeTag; Edge findEdge(Node s, Node t, Edge p = INVALID) const { if (s != t) { if (p == INVALID) { @@ -2224,10 +2238,10 @@ typedef NodeNumTagIndicator NodeNumTag; int nodeNum() const { return _graph->nodeNum(); } - typedef EdgeNumTagIndicator EdgeNumTag; + typedef EdgeNumTagIndicator ArcNumTag; int arcNum() const { return _graph->edgeNum(); } - typedef FindEdgeTagIndicator FindEdgeTag; + typedef FindEdgeTagIndicator FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) { Arc arc = prev; @@ -2884,17 +2898,16 @@ } typedef True NodeNumTag; - int nodeNum() const { return 2 * countNodes(*_digraph); } - typedef True EdgeNumTag; + typedef True ArcNumTag; int arcNum() const { return countArcs(*_digraph) + countNodes(*_digraph); } - typedef True FindEdgeTag; + typedef True FindArcTag; Arc findArc(const Node& u, const Node& v, const Arc& prev = INVALID) const { if (inNode(u)) {