1.1 --- a/lemon/bits/iterable_graph_extender.h Thu Jan 26 06:44:22 2006 +0000
1.2 +++ b/lemon/bits/iterable_graph_extender.h Thu Jan 26 15:42:13 2006 +0000
1.3 @@ -16,7 +16,7 @@
1.4 ///\todo Better name?
1.5 ///
1.6 ///\bug Should it be here?
1.7 - typedef False UndirTag;
1.8 + typedef False UTag;
1.9
1.10 typedef _Base Parent;
1.11 typedef IterableGraphExtender<_Base> Graph;
1.12 @@ -174,7 +174,7 @@
1.13
1.14
1.15 template <typename _Base>
1.16 - class IterableUndirGraphExtender : public IterableGraphExtender<_Base> {
1.17 + class IterableUGraphExtender : public IterableGraphExtender<_Base> {
1.18 public:
1.19
1.20 /// Indicates that the graph is undirected.
1.21 @@ -184,52 +184,52 @@
1.22 ///\bug Should it be here?
1.23 ///\bug Should be tested in the concept checker whether it is defined
1.24 ///correctly.
1.25 - typedef True UndirTag;
1.26 + typedef True UTag;
1.27
1.28 typedef IterableGraphExtender<_Base> Parent;
1.29 - typedef IterableUndirGraphExtender<_Base> Graph;
1.30 + typedef IterableUGraphExtender<_Base> Graph;
1.31 typedef typename Parent::Node Node;
1.32 typedef typename Parent::Edge Edge;
1.33 - typedef typename Parent::UndirEdge UndirEdge;
1.34 + typedef typename Parent::UEdge UEdge;
1.35
1.36 - class UndirEdgeIt : public Parent::UndirEdge {
1.37 + class UEdgeIt : public Parent::UEdge {
1.38 const Graph* graph;
1.39 public:
1.40
1.41 - UndirEdgeIt() { }
1.42 + UEdgeIt() { }
1.43
1.44 - UndirEdgeIt(Invalid i) : UndirEdge(i) { }
1.45 + UEdgeIt(Invalid i) : UEdge(i) { }
1.46
1.47 - explicit UndirEdgeIt(const Graph& _graph) : graph(&_graph) {
1.48 - _graph.first(*static_cast<UndirEdge*>(this));
1.49 + explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
1.50 + _graph.first(*static_cast<UEdge*>(this));
1.51 }
1.52
1.53 - UndirEdgeIt(const Graph& _graph, const UndirEdge& e) :
1.54 - UndirEdge(e), graph(&_graph) { }
1.55 + UEdgeIt(const Graph& _graph, const UEdge& e) :
1.56 + UEdge(e), graph(&_graph) { }
1.57
1.58 - UndirEdgeIt& operator++() {
1.59 + UEdgeIt& operator++() {
1.60 graph->next(*this);
1.61 return *this;
1.62 }
1.63
1.64 };
1.65
1.66 - class IncEdgeIt : public Parent::UndirEdge {
1.67 + class IncEdgeIt : public Parent::UEdge {
1.68 const Graph* graph;
1.69 bool direction;
1.70 - friend class IterableUndirGraphExtender;
1.71 + friend class IterableUGraphExtender;
1.72 public:
1.73
1.74 IncEdgeIt() { }
1.75
1.76 - IncEdgeIt(Invalid i) : UndirEdge(i), direction(false) { }
1.77 + IncEdgeIt(Invalid i) : UEdge(i), direction(false) { }
1.78
1.79 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
1.80 _graph.firstInc(*this, direction, n);
1.81 }
1.82
1.83 - IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n)
1.84 - : graph(&_graph), UndirEdge(ue) {
1.85 + IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n)
1.86 + : graph(&_graph), UEdge(ue) {
1.87 direction = (_graph.source(ue) == n);
1.88 }
1.89
1.90 @@ -258,7 +258,7 @@
1.91 /// \brief The opposite node on the given undirected edge.
1.92 ///
1.93 /// Gives back the opposite on the given undirected edge.
1.94 - Node oppositeNode(const Node& n, const UndirEdge& e) const {
1.95 + Node oppositeNode(const Node& n, const UEdge& e) const {
1.96 if (Parent::source(e) == n) {
1.97 return Parent::target(e);
1.98 } else {
1.99 @@ -270,16 +270,16 @@
1.100
1.101
1.102 template <typename _Base>
1.103 - class IterableUndirBipartiteGraphExtender : public _Base {
1.104 + class IterableUBipartiteGraphExtender : public _Base {
1.105 public:
1.106 typedef _Base Parent;
1.107 - typedef IterableUndirBipartiteGraphExtender Graph;
1.108 + typedef IterableUBipartiteGraphExtender Graph;
1.109
1.110 typedef typename Parent::Node Node;
1.111 typedef typename Parent::UpperNode UpperNode;
1.112 typedef typename Parent::LowerNode LowerNode;
1.113 typedef typename Parent::Edge Edge;
1.114 - typedef typename Parent::UndirEdge UndirEdge;
1.115 + typedef typename Parent::UEdge UEdge;
1.116
1.117 class NodeIt : public Node {
1.118 const Graph* graph;
1.119 @@ -304,7 +304,7 @@
1.120 };
1.121
1.122 class UpperNodeIt : public Node {
1.123 - friend class IterableUndirBipartiteGraphExtender;
1.124 + friend class IterableUBipartiteGraphExtender;
1.125 const Graph* graph;
1.126 public:
1.127
1.128 @@ -326,7 +326,7 @@
1.129 };
1.130
1.131 class LowerNodeIt : public Node {
1.132 - friend class IterableUndirBipartiteGraphExtender;
1.133 + friend class IterableUBipartiteGraphExtender;
1.134 const Graph* graph;
1.135 public:
1.136
1.137 @@ -348,7 +348,7 @@
1.138 };
1.139
1.140 class EdgeIt : public Edge {
1.141 - friend class IterableUndirBipartiteGraphExtender;
1.142 + friend class IterableUBipartiteGraphExtender;
1.143 const Graph* graph;
1.144 public:
1.145
1.146 @@ -370,30 +370,30 @@
1.147
1.148 };
1.149
1.150 - class UndirEdgeIt : public UndirEdge {
1.151 - friend class IterableUndirBipartiteGraphExtender;
1.152 + class UEdgeIt : public UEdge {
1.153 + friend class IterableUBipartiteGraphExtender;
1.154 const Graph* graph;
1.155 public:
1.156
1.157 - UndirEdgeIt() { }
1.158 + UEdgeIt() { }
1.159
1.160 - UndirEdgeIt(Invalid i) : UndirEdge(INVALID) { }
1.161 + UEdgeIt(Invalid i) : UEdge(INVALID) { }
1.162
1.163 - explicit UndirEdgeIt(const Graph& _graph) : graph(&_graph) {
1.164 - graph->first(static_cast<UndirEdge&>(*this));
1.165 + explicit UEdgeIt(const Graph& _graph) : graph(&_graph) {
1.166 + graph->first(static_cast<UEdge&>(*this));
1.167 }
1.168
1.169 - UndirEdgeIt(const Graph& _graph, const UndirEdge& edge)
1.170 - : UndirEdge(edge), graph(&_graph) { }
1.171 + UEdgeIt(const Graph& _graph, const UEdge& edge)
1.172 + : UEdge(edge), graph(&_graph) { }
1.173
1.174 - UndirEdgeIt& operator++() {
1.175 + UEdgeIt& operator++() {
1.176 graph->next(*this);
1.177 return *this;
1.178 }
1.179 };
1.180
1.181 class OutEdgeIt : public Edge {
1.182 - friend class IterableUndirBipartiteGraphExtender;
1.183 + friend class IterableUBipartiteGraphExtender;
1.184 const Graph* graph;
1.185 public:
1.186
1.187 @@ -418,7 +418,7 @@
1.188
1.189
1.190 class InEdgeIt : public Edge {
1.191 - friend class IterableUndirBipartiteGraphExtender;
1.192 + friend class IterableUBipartiteGraphExtender;
1.193 const Graph* graph;
1.194 public:
1.195
1.196 @@ -469,22 +469,22 @@
1.197 return Parent::source((Edge&)e);
1.198 }
1.199
1.200 - class IncEdgeIt : public Parent::UndirEdge {
1.201 - friend class IterableUndirBipartiteGraphExtender;
1.202 + class IncEdgeIt : public Parent::UEdge {
1.203 + friend class IterableUBipartiteGraphExtender;
1.204 const Graph* graph;
1.205 bool direction;
1.206 public:
1.207
1.208 IncEdgeIt() { }
1.209
1.210 - IncEdgeIt(Invalid i) : UndirEdge(i), direction(true) { }
1.211 + IncEdgeIt(Invalid i) : UEdge(i), direction(true) { }
1.212
1.213 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
1.214 graph->firstInc(*this, direction, n);
1.215 }
1.216
1.217 - IncEdgeIt(const Graph& _graph, const UndirEdge &ue, const Node &n)
1.218 - : graph(&_graph), UndirEdge(ue) {
1.219 + IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n)
1.220 + : graph(&_graph), UEdge(ue) {
1.221 direction = (graph->source(ue) == n);
1.222 }
1.223