Changeset 1909:2d806130e700 in lemon-0.x for lemon/bits/iterable_graph_extender.h
- Timestamp:
- 01/26/06 16:42:13 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2484
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/iterable_graph_extender.h
r1820 r1909 17 17 /// 18 18 ///\bug Should it be here? 19 typedef False U ndirTag;19 typedef False UTag; 20 20 21 21 typedef _Base Parent; … … 175 175 176 176 template <typename _Base> 177 class IterableU ndirGraphExtender : public IterableGraphExtender<_Base> {177 class IterableUGraphExtender : public IterableGraphExtender<_Base> { 178 178 public: 179 179 … … 185 185 ///\bug Should be tested in the concept checker whether it is defined 186 186 ///correctly. 187 typedef True U ndirTag;187 typedef True UTag; 188 188 189 189 typedef IterableGraphExtender<_Base> Parent; 190 typedef IterableU ndirGraphExtender<_Base> Graph;190 typedef IterableUGraphExtender<_Base> Graph; 191 191 typedef typename Parent::Node Node; 192 192 typedef typename Parent::Edge Edge; 193 typedef typename Parent::U ndirEdge UndirEdge;194 195 class U ndirEdgeIt : public Parent::UndirEdge {196 const Graph* graph; 197 public: 198 199 U ndirEdgeIt() { }200 201 U ndirEdgeIt(Invalid i) : UndirEdge(i) { }202 203 explicit U ndirEdgeIt(const Graph& _graph) : graph(&_graph) {204 _graph.first(*static_cast<U ndirEdge*>(this));205 } 206 207 U ndirEdgeIt(const Graph& _graph, const UndirEdge& e) :208 U ndirEdge(e), graph(&_graph) { }209 210 U ndirEdgeIt& operator++() {193 typedef typename Parent::UEdge UEdge; 194 195 class UEdgeIt : public Parent::UEdge { 196 const Graph* graph; 197 public: 198 199 UEdgeIt() { } 200 201 UEdgeIt(Invalid i) : UEdge(i) { } 202 203 explicit UEdgeIt(const Graph& _graph) : graph(&_graph) { 204 _graph.first(*static_cast<UEdge*>(this)); 205 } 206 207 UEdgeIt(const Graph& _graph, const UEdge& e) : 208 UEdge(e), graph(&_graph) { } 209 210 UEdgeIt& operator++() { 211 211 graph->next(*this); 212 212 return *this; … … 215 215 }; 216 216 217 class IncEdgeIt : public Parent::U ndirEdge {217 class IncEdgeIt : public Parent::UEdge { 218 218 const Graph* graph; 219 219 bool direction; 220 friend class IterableU ndirGraphExtender;220 friend class IterableUGraphExtender; 221 221 public: 222 222 223 223 IncEdgeIt() { } 224 224 225 IncEdgeIt(Invalid i) : U ndirEdge(i), direction(false) { }225 IncEdgeIt(Invalid i) : UEdge(i), direction(false) { } 226 226 227 227 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { … … 229 229 } 230 230 231 IncEdgeIt(const Graph& _graph, const U ndirEdge &ue, const Node &n)232 : graph(&_graph), U ndirEdge(ue) {231 IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n) 232 : graph(&_graph), UEdge(ue) { 233 233 direction = (_graph.source(ue) == n); 234 234 } … … 259 259 /// 260 260 /// Gives back the opposite on the given undirected edge. 261 Node oppositeNode(const Node& n, const U ndirEdge& e) const {261 Node oppositeNode(const Node& n, const UEdge& e) const { 262 262 if (Parent::source(e) == n) { 263 263 return Parent::target(e); … … 271 271 272 272 template <typename _Base> 273 class IterableU ndirBipartiteGraphExtender : public _Base {273 class IterableUBipartiteGraphExtender : public _Base { 274 274 public: 275 275 typedef _Base Parent; 276 typedef IterableU ndirBipartiteGraphExtender Graph;276 typedef IterableUBipartiteGraphExtender Graph; 277 277 278 278 typedef typename Parent::Node Node; … … 280 280 typedef typename Parent::LowerNode LowerNode; 281 281 typedef typename Parent::Edge Edge; 282 typedef typename Parent::U ndirEdge UndirEdge;282 typedef typename Parent::UEdge UEdge; 283 283 284 284 class NodeIt : public Node { … … 305 305 306 306 class UpperNodeIt : public Node { 307 friend class IterableU ndirBipartiteGraphExtender;307 friend class IterableUBipartiteGraphExtender; 308 308 const Graph* graph; 309 309 public: … … 327 327 328 328 class LowerNodeIt : public Node { 329 friend class IterableU ndirBipartiteGraphExtender;329 friend class IterableUBipartiteGraphExtender; 330 330 const Graph* graph; 331 331 public: … … 349 349 350 350 class EdgeIt : public Edge { 351 friend class IterableU ndirBipartiteGraphExtender;351 friend class IterableUBipartiteGraphExtender; 352 352 const Graph* graph; 353 353 public: … … 371 371 }; 372 372 373 class U ndirEdgeIt : public UndirEdge {374 friend class IterableU ndirBipartiteGraphExtender;375 const Graph* graph; 376 public: 377 378 U ndirEdgeIt() { }379 380 U ndirEdgeIt(Invalid i) : UndirEdge(INVALID) { }381 382 explicit U ndirEdgeIt(const Graph& _graph) : graph(&_graph) {383 graph->first(static_cast<U ndirEdge&>(*this));384 } 385 386 U ndirEdgeIt(const Graph& _graph, const UndirEdge& edge)387 : U ndirEdge(edge), graph(&_graph) { }388 389 U ndirEdgeIt& operator++() {373 class UEdgeIt : public UEdge { 374 friend class IterableUBipartiteGraphExtender; 375 const Graph* graph; 376 public: 377 378 UEdgeIt() { } 379 380 UEdgeIt(Invalid i) : UEdge(INVALID) { } 381 382 explicit UEdgeIt(const Graph& _graph) : graph(&_graph) { 383 graph->first(static_cast<UEdge&>(*this)); 384 } 385 386 UEdgeIt(const Graph& _graph, const UEdge& edge) 387 : UEdge(edge), graph(&_graph) { } 388 389 UEdgeIt& operator++() { 390 390 graph->next(*this); 391 391 return *this; … … 394 394 395 395 class OutEdgeIt : public Edge { 396 friend class IterableU ndirBipartiteGraphExtender;396 friend class IterableUBipartiteGraphExtender; 397 397 const Graph* graph; 398 398 public: … … 419 419 420 420 class InEdgeIt : public Edge { 421 friend class IterableU ndirBipartiteGraphExtender;421 friend class IterableUBipartiteGraphExtender; 422 422 const Graph* graph; 423 423 public: … … 470 470 } 471 471 472 class IncEdgeIt : public Parent::U ndirEdge {473 friend class IterableU ndirBipartiteGraphExtender;472 class IncEdgeIt : public Parent::UEdge { 473 friend class IterableUBipartiteGraphExtender; 474 474 const Graph* graph; 475 475 bool direction; … … 478 478 IncEdgeIt() { } 479 479 480 IncEdgeIt(Invalid i) : U ndirEdge(i), direction(true) { }480 IncEdgeIt(Invalid i) : UEdge(i), direction(true) { } 481 481 482 482 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { … … 484 484 } 485 485 486 IncEdgeIt(const Graph& _graph, const U ndirEdge &ue, const Node &n)487 : graph(&_graph), U ndirEdge(ue) {486 IncEdgeIt(const Graph& _graph, const UEdge &ue, const Node &n) 487 : graph(&_graph), UEdge(ue) { 488 488 direction = (graph->source(ue) == n); 489 489 }
Note: See TracChangeset
for help on using the changeset viewer.