Ticket #252: 252-b483e15fab8e.patch
File 252-b483e15fab8e.patch, 22.2 KB (added by , 15 years ago) |
---|
-
lemon/bits/edge_set_extender.h
# HG changeset patch # User Peter Kovacs <kpeter@inf.elte.hu> # Date 1251033254 -7200 # Node ID b483e15fab8e4bb49446a4a63728074c9ede748b # Parent fb93895f84d9050f68f4e9db6f3d70da4038be69 Smaller iterator classes for some graph structures (#252) This changeset redesigns the extenders for graph and arc/edge set structures and specializes NodeIt, ArcIt and EdgeIt to be smaller whenever it is possible. It means that a pointer to the underlying graph structure is not stored in these itartor classes when the corresponding next() function is static. diff --git a/lemon/bits/edge_set_extender.h b/lemon/bits/edge_set_extender.h
a b 22 22 #include <lemon/core.h> 23 23 #include <lemon/error.h> 24 24 #include <lemon/bits/default_map.h> 25 #include <lemon/bits/graph_extender.h> 25 26 #include <lemon/bits/map_extender.h> 26 27 27 28 //\ingroup digraphbits … … 89 90 return arc_notifier; 90 91 } 91 92 92 // Iterable extensions 93 94 class NodeIt : public Node { 95 const Digraph* digraph; 96 public: 97 98 NodeIt() {} 99 100 NodeIt(Invalid i) : Node(i) { } 101 102 explicit NodeIt(const Digraph& _graph) : digraph(&_graph) { 103 _graph.first(static_cast<Node&>(*this)); 104 } 105 106 NodeIt(const Digraph& _graph, const Node& node) 107 : Node(node), digraph(&_graph) {} 108 109 NodeIt& operator++() { 110 digraph->next(*this); 111 return *this; 112 } 113 114 }; 115 116 117 class ArcIt : public Arc { 118 const Digraph* digraph; 119 public: 120 121 ArcIt() { } 122 123 ArcIt(Invalid i) : Arc(i) { } 124 125 explicit ArcIt(const Digraph& _graph) : digraph(&_graph) { 126 _graph.first(static_cast<Arc&>(*this)); 127 } 128 129 ArcIt(const Digraph& _graph, const Arc& e) : 130 Arc(e), digraph(&_graph) { } 131 132 ArcIt& operator++() { 133 digraph->next(*this); 134 return *this; 135 } 136 137 }; 138 139 140 class OutArcIt : public Arc { 141 const Digraph* digraph; 142 public: 143 144 OutArcIt() { } 145 146 OutArcIt(Invalid i) : Arc(i) { } 147 148 OutArcIt(const Digraph& _graph, const Node& node) 149 : digraph(&_graph) { 150 _graph.firstOut(*this, node); 151 } 152 153 OutArcIt(const Digraph& _graph, const Arc& arc) 154 : Arc(arc), digraph(&_graph) {} 155 156 OutArcIt& operator++() { 157 digraph->nextOut(*this); 158 return *this; 159 } 160 161 }; 162 163 164 class InArcIt : public Arc { 165 const Digraph* digraph; 166 public: 167 168 InArcIt() { } 169 170 InArcIt(Invalid i) : Arc(i) { } 171 172 InArcIt(const Digraph& _graph, const Node& node) 173 : digraph(&_graph) { 174 _graph.firstIn(*this, node); 175 } 176 177 InArcIt(const Digraph& _graph, const Arc& arc) : 178 Arc(arc), digraph(&_graph) {} 179 180 InArcIt& operator++() { 181 digraph->nextIn(*this); 182 return *this; 183 } 184 185 }; 93 typedef _graph_bits::NodeIt<Digraph> NodeIt; 94 typedef _graph_bits::ArcIt<Digraph> ArcIt; 95 typedef _graph_bits::OutArcIt<Digraph> OutArcIt; 96 typedef _graph_bits::InArcIt<Digraph> InArcIt; 186 97 187 98 // \brief Base node of the iterator 188 99 // … … 347 258 return edge_notifier; 348 259 } 349 260 350 351 class NodeIt : public Node { 352 const Graph* graph; 353 public: 354 355 NodeIt() {} 356 357 NodeIt(Invalid i) : Node(i) { } 358 359 explicit NodeIt(const Graph& _graph) : graph(&_graph) { 360 _graph.first(static_cast<Node&>(*this)); 361 } 362 363 NodeIt(const Graph& _graph, const Node& node) 364 : Node(node), graph(&_graph) {} 365 366 NodeIt& operator++() { 367 graph->next(*this); 368 return *this; 369 } 370 371 }; 372 373 374 class ArcIt : public Arc { 375 const Graph* graph; 376 public: 377 378 ArcIt() { } 379 380 ArcIt(Invalid i) : Arc(i) { } 381 382 explicit ArcIt(const Graph& _graph) : graph(&_graph) { 383 _graph.first(static_cast<Arc&>(*this)); 384 } 385 386 ArcIt(const Graph& _graph, const Arc& e) : 387 Arc(e), graph(&_graph) { } 388 389 ArcIt& operator++() { 390 graph->next(*this); 391 return *this; 392 } 393 394 }; 395 396 397 class OutArcIt : public Arc { 398 const Graph* graph; 399 public: 400 401 OutArcIt() { } 402 403 OutArcIt(Invalid i) : Arc(i) { } 404 405 OutArcIt(const Graph& _graph, const Node& node) 406 : graph(&_graph) { 407 _graph.firstOut(*this, node); 408 } 409 410 OutArcIt(const Graph& _graph, const Arc& arc) 411 : Arc(arc), graph(&_graph) {} 412 413 OutArcIt& operator++() { 414 graph->nextOut(*this); 415 return *this; 416 } 417 418 }; 419 420 421 class InArcIt : public Arc { 422 const Graph* graph; 423 public: 424 425 InArcIt() { } 426 427 InArcIt(Invalid i) : Arc(i) { } 428 429 InArcIt(const Graph& _graph, const Node& node) 430 : graph(&_graph) { 431 _graph.firstIn(*this, node); 432 } 433 434 InArcIt(const Graph& _graph, const Arc& arc) : 435 Arc(arc), graph(&_graph) {} 436 437 InArcIt& operator++() { 438 graph->nextIn(*this); 439 return *this; 440 } 441 442 }; 443 444 445 class EdgeIt : public Parent::Edge { 446 const Graph* graph; 447 public: 448 449 EdgeIt() { } 450 451 EdgeIt(Invalid i) : Edge(i) { } 452 453 explicit EdgeIt(const Graph& _graph) : graph(&_graph) { 454 _graph.first(static_cast<Edge&>(*this)); 455 } 456 457 EdgeIt(const Graph& _graph, const Edge& e) : 458 Edge(e), graph(&_graph) { } 459 460 EdgeIt& operator++() { 461 graph->next(*this); 462 return *this; 463 } 464 465 }; 466 467 class IncEdgeIt : public Parent::Edge { 468 friend class EdgeSetExtender; 469 const Graph* graph; 470 bool direction; 471 public: 472 473 IncEdgeIt() { } 474 475 IncEdgeIt(Invalid i) : Edge(i), direction(false) { } 476 477 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { 478 _graph.firstInc(*this, direction, n); 479 } 480 481 IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n) 482 : graph(&_graph), Edge(ue) { 483 direction = (_graph.source(ue) == n); 484 } 485 486 IncEdgeIt& operator++() { 487 graph->nextInc(*this, direction); 488 return *this; 489 } 490 }; 261 typedef _graph_bits::NodeIt<Graph> NodeIt; 262 typedef _graph_bits::ArcIt<Graph> ArcIt; 263 typedef _graph_bits::EdgeIt<Graph> EdgeIt; 264 typedef _graph_bits::OutArcIt<Graph> OutArcIt; 265 typedef _graph_bits::InArcIt<Graph> InArcIt; 266 typedef _graph_bits::IncEdgeIt<Graph> IncEdgeIt; 491 267 492 268 // \brief Base node of the iterator 493 269 // … … 521 297 // 522 298 // Returns the base node of the iterator 523 299 Node baseNode(const IncEdgeIt &e) const { 524 return e.direction ? u(e) : v(e);300 return e.direction() ? u(e) : v(e); 525 301 } 526 302 // Running node of the iterator 527 303 // 528 304 // Returns the running node of the iterator 529 305 Node runningNode(const IncEdgeIt &e) const { 530 return e.direction ? v(e) : u(e);306 return e.direction() ? v(e) : u(e); 531 307 } 532 308 533 309 -
lemon/bits/graph_extender.h
diff --git a/lemon/bits/graph_extender.h b/lemon/bits/graph_extender.h
a b 32 32 //\brief Extenders for the graph types 33 33 namespace lemon { 34 34 35 namespace _graph_bits { 36 37 template <typename GR, typename Enable = void> 38 class NodeIt : public GR::Node { 39 typedef typename GR::Node Node; 40 public: 41 NodeIt() {} 42 43 NodeIt(Invalid i) : Node(i) {} 44 45 explicit NodeIt(const GR& gr) : _gr(&gr) { 46 _gr->first(static_cast<Node&>(*this)); 47 } 48 49 NodeIt(const GR& gr, const Node& n) : Node(n), _gr(&gr) {} 50 51 NodeIt& operator++() { 52 _gr->next(*this); 53 return *this; 54 } 55 56 private: 57 const GR* _gr; 58 }; 59 60 template <typename GR> 61 class NodeIt<GR, 62 typename enable_if<typename GR::StaticNextNodeTag, void>::type> : 63 public GR::Node 64 { 65 typedef typename GR::Node Node; 66 public: 67 NodeIt() {} 68 69 NodeIt(Invalid i) : Node(i) {} 70 71 explicit NodeIt(const GR& gr) { 72 gr.first(static_cast<Node&>(*this)); 73 } 74 75 NodeIt(const GR&, const Node& n) : Node(n) {} 76 77 NodeIt& operator++() { 78 GR::next(*this); 79 return *this; 80 } 81 }; 82 83 84 template <typename GR, typename Enable = void> 85 class ArcIt : public GR::Arc { 86 typedef typename GR::Arc Arc; 87 public: 88 ArcIt() {} 89 90 ArcIt(Invalid i) : Arc(i) {} 91 92 explicit ArcIt(const GR& gr) : _gr(&gr) { 93 _gr->first(static_cast<Arc&>(*this)); 94 } 95 96 ArcIt(const GR& gr, const Arc& a) : Arc(a), _gr(&gr) {} 97 98 ArcIt& operator++() { 99 _gr->next(*this); 100 return *this; 101 } 102 103 private: 104 const GR* _gr; 105 }; 106 107 template <typename GR> 108 class ArcIt<GR, 109 typename enable_if<typename GR::StaticNextArcTag, void>::type> : 110 public GR::Arc 111 { 112 typedef typename GR::Arc Arc; 113 public: 114 ArcIt() {} 115 116 ArcIt(Invalid i) : Arc(i) {} 117 118 explicit ArcIt(const GR& gr) { 119 gr.first(static_cast<Arc&>(*this)); 120 } 121 122 ArcIt(const GR&, const Arc& a) : Arc(a) {} 123 124 ArcIt& operator++() { 125 GR::next(*this); 126 return *this; 127 } 128 }; 129 130 131 template <typename GR, typename Enable = void> 132 class EdgeIt : public GR::Edge { 133 typedef typename GR::Edge Edge; 134 public: 135 EdgeIt() {} 136 137 EdgeIt(Invalid i) : Edge(i) {} 138 139 explicit EdgeIt(const GR& gr) : _gr(&gr) { 140 _gr->first(static_cast<Edge&>(*this)); 141 } 142 143 EdgeIt(const GR& gr, const Edge& e) : Edge(e), _gr(&gr) {} 144 145 EdgeIt& operator++() { 146 _gr->next(*this); 147 return *this; 148 } 149 150 private: 151 const GR* _gr; 152 }; 153 154 template <typename GR> 155 class EdgeIt<GR, 156 typename enable_if<typename GR::StaticNextEdgeTag, void>::type> : 157 public GR::Edge 158 { 159 typedef typename GR::Edge Edge; 160 public: 161 EdgeIt() {} 162 163 EdgeIt(Invalid i) : Edge(i) {} 164 165 explicit EdgeIt(const GR& gr) { 166 gr.first(static_cast<Edge&>(*this)); 167 } 168 169 EdgeIt(const GR&, const Edge& e) : Edge(e) {} 170 171 EdgeIt& operator++() { 172 GR::next(*this); 173 return *this; 174 } 175 }; 176 177 178 template <typename GR> 179 class OutArcIt : public GR::Arc { 180 typedef typename GR::Node Node; 181 typedef typename GR::Arc Arc; 182 public: 183 OutArcIt() {} 184 185 OutArcIt(Invalid i) : Arc(i) {} 186 187 OutArcIt(const GR& gr, const Node& n) : _gr(&gr) { 188 _gr->firstOut(*this, n); 189 } 190 191 OutArcIt(const GR& gr, const Arc& a) : Arc(a), _gr(&gr) {} 192 193 OutArcIt& operator++() { 194 _gr->nextOut(*this); 195 return *this; 196 } 197 198 private: 199 const GR* _gr; 200 }; 201 202 203 template <typename GR> 204 class InArcIt : public GR::Arc { 205 typedef typename GR::Node Node; 206 typedef typename GR::Arc Arc; 207 public: 208 InArcIt() {} 209 210 InArcIt(Invalid i) : Arc(i) {} 211 212 InArcIt(const GR& gr, const Node& n) : _gr(&gr) { 213 _gr->firstIn(*this, n); 214 } 215 216 InArcIt(const GR& gr, const Arc& a) : Arc(a), _gr(&gr) {} 217 218 InArcIt& operator++() { 219 _gr->nextIn(*this); 220 return *this; 221 } 222 223 private: 224 const GR* _gr; 225 }; 226 227 228 template <typename GR> 229 class IncEdgeIt : public GR::Edge { 230 typedef typename GR::Node Node; 231 typedef typename GR::Edge Edge; 232 public: 233 IncEdgeIt() {} 234 235 IncEdgeIt(Invalid i) : Edge(i), _direction(false) {} 236 237 IncEdgeIt(const GR& gr, const Node &node) : _gr(&gr) { 238 _gr->firstInc(*this, _direction, node); 239 } 240 241 IncEdgeIt(const GR& gr, const Edge &edge, const Node &node) 242 : _gr(&gr), Edge(edge) { 243 _direction = (_gr->u(edge) == node); 244 } 245 246 IncEdgeIt& operator++() { 247 _gr->nextInc(*this, _direction); 248 return *this; 249 } 250 251 bool direction() const { return _direction; } 252 253 private: 254 const GR* _gr; 255 bool _direction; 256 }; 257 258 } 259 260 35 261 // \ingroup graphbits 36 262 // 37 263 // \brief Extender for the digraph implementations … … 94 320 return arc_notifier; 95 321 } 96 322 97 class NodeIt : public Node { 98 const Digraph* _digraph; 99 public: 100 101 NodeIt() {} 102 103 NodeIt(Invalid i) : Node(i) { } 104 105 explicit NodeIt(const Digraph& digraph) : _digraph(&digraph) { 106 _digraph->first(static_cast<Node&>(*this)); 107 } 108 109 NodeIt(const Digraph& digraph, const Node& node) 110 : Node(node), _digraph(&digraph) {} 111 112 NodeIt& operator++() { 113 _digraph->next(*this); 114 return *this; 115 } 116 117 }; 118 119 120 class ArcIt : public Arc { 121 const Digraph* _digraph; 122 public: 123 124 ArcIt() { } 125 126 ArcIt(Invalid i) : Arc(i) { } 127 128 explicit ArcIt(const Digraph& digraph) : _digraph(&digraph) { 129 _digraph->first(static_cast<Arc&>(*this)); 130 } 131 132 ArcIt(const Digraph& digraph, const Arc& arc) : 133 Arc(arc), _digraph(&digraph) { } 134 135 ArcIt& operator++() { 136 _digraph->next(*this); 137 return *this; 138 } 139 140 }; 141 142 143 class OutArcIt : public Arc { 144 const Digraph* _digraph; 145 public: 146 147 OutArcIt() { } 148 149 OutArcIt(Invalid i) : Arc(i) { } 150 151 OutArcIt(const Digraph& digraph, const Node& node) 152 : _digraph(&digraph) { 153 _digraph->firstOut(*this, node); 154 } 155 156 OutArcIt(const Digraph& digraph, const Arc& arc) 157 : Arc(arc), _digraph(&digraph) {} 158 159 OutArcIt& operator++() { 160 _digraph->nextOut(*this); 161 return *this; 162 } 163 164 }; 165 166 167 class InArcIt : public Arc { 168 const Digraph* _digraph; 169 public: 170 171 InArcIt() { } 172 173 InArcIt(Invalid i) : Arc(i) { } 174 175 InArcIt(const Digraph& digraph, const Node& node) 176 : _digraph(&digraph) { 177 _digraph->firstIn(*this, node); 178 } 179 180 InArcIt(const Digraph& digraph, const Arc& arc) : 181 Arc(arc), _digraph(&digraph) {} 182 183 InArcIt& operator++() { 184 _digraph->nextIn(*this); 185 return *this; 186 } 187 188 }; 323 typedef _graph_bits::NodeIt<Digraph> NodeIt; 324 typedef _graph_bits::ArcIt<Digraph> ArcIt; 325 typedef _graph_bits::OutArcIt<Digraph> OutArcIt; 326 typedef _graph_bits::InArcIt<Digraph> InArcIt; 189 327 190 328 // \brief Base node of the iterator 191 329 // … … 412 550 return edge_notifier; 413 551 } 414 552 415 416 417 class NodeIt : public Node { 418 const Graph* _graph; 419 public: 420 421 NodeIt() {} 422 423 NodeIt(Invalid i) : Node(i) { } 424 425 explicit NodeIt(const Graph& graph) : _graph(&graph) { 426 _graph->first(static_cast<Node&>(*this)); 427 } 428 429 NodeIt(const Graph& graph, const Node& node) 430 : Node(node), _graph(&graph) {} 431 432 NodeIt& operator++() { 433 _graph->next(*this); 434 return *this; 435 } 436 437 }; 438 439 440 class ArcIt : public Arc { 441 const Graph* _graph; 442 public: 443 444 ArcIt() { } 445 446 ArcIt(Invalid i) : Arc(i) { } 447 448 explicit ArcIt(const Graph& graph) : _graph(&graph) { 449 _graph->first(static_cast<Arc&>(*this)); 450 } 451 452 ArcIt(const Graph& graph, const Arc& arc) : 453 Arc(arc), _graph(&graph) { } 454 455 ArcIt& operator++() { 456 _graph->next(*this); 457 return *this; 458 } 459 460 }; 461 462 463 class OutArcIt : public Arc { 464 const Graph* _graph; 465 public: 466 467 OutArcIt() { } 468 469 OutArcIt(Invalid i) : Arc(i) { } 470 471 OutArcIt(const Graph& graph, const Node& node) 472 : _graph(&graph) { 473 _graph->firstOut(*this, node); 474 } 475 476 OutArcIt(const Graph& graph, const Arc& arc) 477 : Arc(arc), _graph(&graph) {} 478 479 OutArcIt& operator++() { 480 _graph->nextOut(*this); 481 return *this; 482 } 483 484 }; 485 486 487 class InArcIt : public Arc { 488 const Graph* _graph; 489 public: 490 491 InArcIt() { } 492 493 InArcIt(Invalid i) : Arc(i) { } 494 495 InArcIt(const Graph& graph, const Node& node) 496 : _graph(&graph) { 497 _graph->firstIn(*this, node); 498 } 499 500 InArcIt(const Graph& graph, const Arc& arc) : 501 Arc(arc), _graph(&graph) {} 502 503 InArcIt& operator++() { 504 _graph->nextIn(*this); 505 return *this; 506 } 507 508 }; 509 510 511 class EdgeIt : public Parent::Edge { 512 const Graph* _graph; 513 public: 514 515 EdgeIt() { } 516 517 EdgeIt(Invalid i) : Edge(i) { } 518 519 explicit EdgeIt(const Graph& graph) : _graph(&graph) { 520 _graph->first(static_cast<Edge&>(*this)); 521 } 522 523 EdgeIt(const Graph& graph, const Edge& edge) : 524 Edge(edge), _graph(&graph) { } 525 526 EdgeIt& operator++() { 527 _graph->next(*this); 528 return *this; 529 } 530 531 }; 532 533 class IncEdgeIt : public Parent::Edge { 534 friend class GraphExtender; 535 const Graph* _graph; 536 bool _direction; 537 public: 538 539 IncEdgeIt() { } 540 541 IncEdgeIt(Invalid i) : Edge(i), _direction(false) { } 542 543 IncEdgeIt(const Graph& graph, const Node &node) : _graph(&graph) { 544 _graph->firstInc(*this, _direction, node); 545 } 546 547 IncEdgeIt(const Graph& graph, const Edge &edge, const Node &node) 548 : _graph(&graph), Edge(edge) { 549 _direction = (_graph->source(edge) == node); 550 } 551 552 IncEdgeIt& operator++() { 553 _graph->nextInc(*this, _direction); 554 return *this; 555 } 556 }; 553 typedef _graph_bits::NodeIt<Graph> NodeIt; 554 typedef _graph_bits::ArcIt<Graph> ArcIt; 555 typedef _graph_bits::EdgeIt<Graph> EdgeIt; 556 typedef _graph_bits::OutArcIt<Graph> OutArcIt; 557 typedef _graph_bits::InArcIt<Graph> InArcIt; 558 typedef _graph_bits::IncEdgeIt<Graph> IncEdgeIt; 557 559 558 560 // \brief Base node of the iterator 559 561 // … … 587 589 // 588 590 // Returns the base node of the iterator 589 591 Node baseNode(const IncEdgeIt &edge) const { 590 return edge. _direction? u(edge) : v(edge);592 return edge.direction() ? u(edge) : v(edge); 591 593 } 592 594 // Running node of the iterator 593 595 // 594 596 // Returns the running node of the iterator 595 597 Node runningNode(const IncEdgeIt &edge) const { 596 return edge. _direction? v(edge) : u(edge);598 return edge.direction() ? v(edge) : u(edge); 597 599 } 598 600 599 601 // Mappable extension -
lemon/bits/traits.h
diff --git a/lemon/bits/traits.h b/lemon/bits/traits.h
a b 301 301 static const bool value = true; 302 302 }; 303 303 304 template <typename GR, typename Enable = void> 305 struct StaticNextNodeTagIndicator { 306 static const bool value = false; 307 }; 308 309 template <typename GR> 310 struct StaticNextNodeTagIndicator< 311 GR, 312 typename enable_if<typename GR::StaticNextNodeTag, void>::type 313 > { 314 static const bool value = true; 315 }; 316 317 template <typename GR, typename Enable = void> 318 struct StaticNextArcTagIndicator { 319 static const bool value = false; 320 }; 321 322 template <typename GR> 323 struct StaticNextArcTagIndicator< 324 GR, 325 typename enable_if<typename GR::StaticNextArcTag, void>::type 326 > { 327 static const bool value = true; 328 }; 329 330 template <typename GR, typename Enable = void> 331 struct StaticNextEdgeTagIndicator { 332 static const bool value = false; 333 }; 334 335 template <typename GR> 336 struct StaticNextEdgeTagIndicator< 337 GR, 338 typename enable_if<typename GR::StaticNextEdgeTag, void>::type 339 > { 340 static const bool value = true; 341 }; 342 304 343 } 305 344 306 345 #endif -
lemon/edge_set.h
diff --git a/lemon/edge_set.h b/lemon/edge_set.h
a b 855 855 arcs.clear(); 856 856 } 857 857 858 typedef True StaticNextArcTag; 859 858 860 void first(Node& node) const { 859 861 _graph->first(node); 860 862 } … … 867 869 arc.id = arcs.size() - 1; 868 870 } 869 871 870 void next(Arc& arc) const{872 static void next(Arc& arc) { 871 873 --arc.id; 872 874 } 873 875 … … 1161 1163 arcs.clear(); 1162 1164 } 1163 1165 1166 typedef True StaticNextArcTag; 1167 typedef True StaticNextEdgeTag; 1168 1164 1169 void first(Node& node) const { 1165 1170 _graph->first(node); 1166 1171 } … … 1173 1178 arc.id = arcs.size() - 1; 1174 1179 } 1175 1180 1176 void next(Arc& arc) const{1181 static void next(Arc& arc) { 1177 1182 --arc.id; 1178 1183 } 1179 1184 … … 1181 1186 arc.id = arcs.size() / 2 - 1; 1182 1187 } 1183 1188 1184 void next(Edge& arc) const{1189 static void next(Edge& arc) { 1185 1190 --arc.id; 1186 1191 } 1187 1192 -
lemon/full_graph.h
diff --git a/lemon/full_graph.h b/lemon/full_graph.h
a b 108 108 bool operator<(const Arc arc) const {return _id < arc._id;} 109 109 }; 110 110 111 typedef True StaticNextNodeTag; 112 typedef True StaticNextArcTag; 113 111 114 void first(Node& node) const { 112 115 node._id = _node_num - 1; 113 116 } … … 413 416 return Arc((edge._id << 1) | (dir ? 1 : 0)); 414 417 } 415 418 419 typedef True StaticNextNodeTag; 420 typedef True StaticNextEdgeTag; 421 typedef True StaticNextArcTag; 422 416 423 void first(Node& node) const { 417 424 node._id = _node_num - 1; 418 425 } -
lemon/grid_graph.h
diff --git a/lemon/grid_graph.h b/lemon/grid_graph.h
a b 226 226 return Arc((edge._id << 1) | (dir ? 1 : 0)); 227 227 } 228 228 229 typedef True StaticNextNodeTag; 230 typedef True StaticNextEdgeTag; 231 typedef True StaticNextArcTag; 232 229 233 void first(Node& node) const { 230 234 node._id = _node_num - 1; 231 235 } -
lemon/hypercube_graph.h
diff --git a/lemon/hypercube_graph.h b/lemon/hypercube_graph.h
a b 164 164 bool operator<(const Arc arc) const {return _id < arc._id;} 165 165 }; 166 166 167 typedef True StaticNextNodeTag; 168 typedef True StaticNextEdgeTag; 169 typedef True StaticNextArcTag; 170 167 171 void first(Node& node) const { 168 172 node._id = _node_num - 1; 169 173 } -
lemon/smart_graph.h
diff --git a/lemon/smart_graph.h b/lemon/smart_graph.h
a b 147 147 bool operator<(const Arc i) const {return _id < i._id;} 148 148 }; 149 149 150 typedef True StaticNextNodeTag; 151 typedef True StaticNextArcTag; 152 150 153 void first(Node& node) const { 151 154 node._id = nodes.size() - 1; 152 155 } … … 504 507 return Arc(e._id * 2 + (d ? 1 : 0)); 505 508 } 506 509 510 typedef True StaticNextNodeTag; 511 typedef True StaticNextEdgeTag; 512 typedef True StaticNextArcTag; 513 507 514 void first(Node& node) const { 508 515 node._id = nodes.size() - 1; 509 516 } 510 517 511 void next(Node& node) const{518 static void next(Node& node) { 512 519 --node._id; 513 520 } 514 521 … … 516 523 arc._id = arcs.size() - 1; 517 524 } 518 525 519 void next(Arc& arc) const{526 static void next(Arc& arc) { 520 527 --arc._id; 521 528 } 522 529 … … 524 531 arc._id = arcs.size() / 2 - 1; 525 532 } 526 533 527 void next(Edge& arc) const{534 static void next(Edge& arc) { 528 535 --arc._id; 529 536 } 530 537