Changeset 1158:8d2e55fac752 in lemon
- Timestamp:
- 09/13/12 11:52:50 (12 years ago)
- Branch:
- 1.1
- Parents:
- 1156:939d747055cd (diff), 1157:761fe0846f49 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Phase:
- public
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/adaptors.h
r1081 r1158 1365 1365 /// and edge filter maps. 1366 1366 SubGraph(GR& graph, NF& node_filter, EF& edge_filter) { 1367 initialize(graph, node_filter, edge_filter);1367 this->initialize(graph, node_filter, edge_filter); 1368 1368 } 1369 1369 … … 2262 2262 /// Creates an undirected graph from the given digraph. 2263 2263 Undirector(DGR& digraph) { 2264 initialize(digraph);2264 this->initialize(digraph); 2265 2265 } 2266 2266 -
lemon/adaptors.h
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 419 419 Parent::initialize(digraph); 420 420 _node_filter = &node_filter; 421 _arc_filter = &arc_filter; 421 _arc_filter = &arc_filter; 422 422 } 423 423 … … 506 506 507 507 template <typename V> 508 class NodeMap 509 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 510 508 class NodeMap 509 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 510 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> { 511 511 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 512 512 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; 513 513 514 514 public: … … 533 533 534 534 template <typename V> 535 class ArcMap 535 class ArcMap 536 536 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 537 537 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> { 538 538 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 539 539 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent; … … 580 580 Parent::initialize(digraph); 581 581 _node_filter = &node_filter; 582 _arc_filter = &arc_filter; 582 _arc_filter = &arc_filter; 583 583 } 584 584 … … 649 649 650 650 template <typename V> 651 class NodeMap 651 class NodeMap 652 652 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 653 653 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> { 654 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 654 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 655 655 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; 656 656 … … 676 676 677 677 template <typename V> 678 class ArcMap 678 class ArcMap 679 679 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 680 680 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> { … … 1017 1017 1018 1018 template <typename V> 1019 class NodeMap 1019 class NodeMap 1020 1020 : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1021 1021 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> { 1022 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1022 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1023 1023 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; 1024 1024 … … 1044 1044 1045 1045 template <typename V> 1046 class ArcMap 1046 class ArcMap 1047 1047 : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1048 1048 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> { 1049 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1049 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1050 1050 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; 1051 1051 … … 1071 1071 1072 1072 template <typename V> 1073 class EdgeMap 1073 class EdgeMap 1074 1074 : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1075 1075 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> { 1076 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1076 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1077 1077 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; 1078 1078 … … 1113 1113 NF* _node_filter; 1114 1114 EF* _edge_filter; 1115 SubGraphBase() 1116 1115 SubGraphBase() 1116 : Parent(), _node_filter(0), _edge_filter(0) { } 1117 1117 1118 1118 void initialize(GR& graph, NF& node_filter, EF& edge_filter) { … … 1215 1215 1216 1216 template <typename V> 1217 class NodeMap 1217 class NodeMap 1218 1218 : public SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1219 1219 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> { 1220 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1220 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1221 1221 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; 1222 1222 … … 1242 1242 1243 1243 template <typename V> 1244 class ArcMap 1244 class ArcMap 1245 1245 : public SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1246 1246 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> { 1247 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1247 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1248 1248 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; 1249 1249 … … 1269 1269 1270 1270 template <typename V> 1271 class EdgeMap 1271 class EdgeMap 1272 1272 : public SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1273 1273 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> { 1274 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1275 1274 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1275 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; 1276 1276 1277 1277 public: … … 1496 1496 #endif 1497 1497 typedef DigraphAdaptorExtender< 1498 SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 1498 SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 1499 1499 true> > Parent; 1500 1500 … … 1517 1517 /// Creates a subgraph for the given digraph or graph with the 1518 1518 /// given node filter map. 1519 FilterNodes(GR& graph, NF& node_filter) 1519 FilterNodes(GR& graph, NF& node_filter) 1520 1520 : Parent(), const_true_map() 1521 1521 { … … 1555 1555 typename enable_if<UndirectedTagIndicator<GR> >::type> : 1556 1556 public GraphAdaptorExtender< 1557 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1557 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1558 1558 true> > { 1559 1559 1560 1560 typedef GraphAdaptorExtender< 1561 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1561 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1562 1562 true> > Parent; 1563 1563 … … 1643 1643 #endif 1644 1644 typedef DigraphAdaptorExtender< 1645 SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 1645 SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 1646 1646 AF, false> > Parent; 1647 1647 … … 1749 1749 class FilterEdges : 1750 1750 public GraphAdaptorExtender< 1751 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 1751 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 1752 1752 EF, false> > { 1753 1753 #endif 1754 1754 typedef GraphAdaptorExtender< 1755 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 1755 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 1756 1756 EF, false> > Parent; 1757 1757 … … 1778 1778 /// Creates a subgraph for the given graph with the given edge 1779 1779 /// filter map. 1780 FilterEdges(GR& graph, EF& edge_filter) 1780 FilterEdges(GR& graph, EF& edge_filter) 1781 1781 : Parent(), const_true_map() { 1782 1782 Parent::initialize(graph, const_true_map, edge_filter); … … 1846 1846 bool _forward; 1847 1847 1848 Arc(const Edge& edge, bool forward) 1848 Arc(const Edge& edge, bool forward) 1849 1849 : _edge(edge), _forward(forward) {} 1850 1850 … … 2086 2086 2087 2087 ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value) 2088 : _forward(*adaptor._digraph, value), 2088 : _forward(*adaptor._digraph, value), 2089 2089 _backward(*adaptor._digraph, value) {} 2090 2090 … … 2204 2204 typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier; 2205 2205 EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); } 2206 2206 2207 2207 typedef EdgeNotifier ArcNotifier; 2208 2208 ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); } … … 2708 2708 typename FM = CM, 2709 2709 typename TL = Tolerance<typename CM::Value> > 2710 class ResidualDigraph 2710 class ResidualDigraph 2711 2711 : public SubDigraph< 2712 2712 Undirector<const DGR>, … … 2765 2765 ResidualDigraph(const DGR& digraph, const CM& capacity, 2766 2766 FM& flow, const TL& tolerance = Tolerance()) 2767 : Parent(), _capacity(&capacity), _flow(&flow), 2767 : Parent(), _capacity(&capacity), _flow(&flow), 2768 2768 _graph(digraph), _node_filter(), 2769 2769 _forward_filter(capacity, flow, tolerance), … … 2847 2847 2848 2848 /// Constructor 2849 ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 2849 ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 2850 2850 : _adaptor(&adaptor) {} 2851 2851 … … 3424 3424 /// to get a node map of the split digraph. 3425 3425 /// Its value type is inherited from the first node map type (\c IN). 3426 /// \tparam IN The type of the node map for the in-nodes. 3426 /// \tparam IN The type of the node map for the in-nodes. 3427 3427 /// \tparam OUT The type of the node map for the out-nodes. 3428 3428 template <typename IN, typename OUT> -
lemon/bits/edge_set_extender.h
r1081 r1158 524 524 // Returns the base node of the iterator 525 525 Node baseNode(const IncEdgeIt &e) const { 526 return e.direction ? u(e) :v(e);526 return e.direction ? this->u(e) : this->v(e); 527 527 } 528 528 // Running node of the iterator … … 530 530 // Returns the running node of the iterator 531 531 Node runningNode(const IncEdgeIt &e) const { 532 return e.direction ? v(e) :u(e);532 return e.direction ? this->v(e) : this->u(e); 533 533 } 534 534 -
lemon/bits/edge_set_extender.h
r1157 r1158 1 /* -*- C++-*-1 /* -*- mode: C++; indent-tabs-mode: nil; -*- 2 2 * 3 * This file is a part of LEMON, a generic C++ optimization library 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 085 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 64 64 Node oppositeNode(const Node &n, const Arc &e) const { 65 65 if (n == Parent::source(e)) 66 66 return Parent::target(e); 67 67 else if(n==Parent::target(e)) 68 68 return Parent::source(e); 69 69 else 70 70 return INVALID; 71 71 } 72 72 … … 92 92 // Iterable extensions 93 93 94 class NodeIt : public Node { 94 class NodeIt : public Node { 95 95 const Digraph* digraph; 96 96 public: … … 101 101 102 102 explicit NodeIt(const Digraph& _graph) : digraph(&_graph) { 103 104 } 105 106 NodeIt(const Digraph& _graph, const Node& node) 107 108 109 NodeIt& operator++() { 110 111 return *this; 112 } 113 114 }; 115 116 117 class ArcIt : public Arc { 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 118 const Digraph* digraph; 119 119 public: … … 124 124 125 125 explicit ArcIt(const Digraph& _graph) : digraph(&_graph) { 126 127 } 128 129 ArcIt(const Digraph& _graph, const Arc& e) : 130 131 132 ArcIt& operator++() { 133 134 return *this; 135 } 136 137 }; 138 139 140 class OutArcIt : public Arc { 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 141 const Digraph* digraph; 142 142 public: … … 146 146 OutArcIt(Invalid i) : Arc(i) { } 147 147 148 OutArcIt(const Digraph& _graph, const Node& node) 149 150 151 } 152 153 OutArcIt(const Digraph& _graph, const Arc& arc) 154 155 156 OutArcIt& operator++() { 157 158 return *this; 159 } 160 161 }; 162 163 164 class InArcIt : public Arc { 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 165 const Digraph* digraph; 166 166 public: … … 170 170 InArcIt(Invalid i) : Arc(i) { } 171 171 172 InArcIt(const Digraph& _graph, const Node& node) 173 174 175 } 176 177 InArcIt(const Digraph& _graph, const Arc& arc) : 178 179 180 InArcIt& operator++() { 181 182 return *this; 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 183 } 184 184 … … 216 216 217 217 // Mappable extension 218 218 219 219 template <typename _Value> 220 class ArcMap 220 class ArcMap 221 221 : public MapExtender<DefaultMap<Digraph, Arc, _Value> > { 222 222 typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent; 223 223 224 224 public: 225 explicit ArcMap(const Digraph& _g) 226 227 ArcMap(const Digraph& _g, const _Value& _v) 228 225 explicit ArcMap(const Digraph& _g) 226 : Parent(_g) {} 227 ArcMap(const Digraph& _g, const _Value& _v) 228 : Parent(_g, _v) {} 229 229 230 230 ArcMap& operator=(const ArcMap& cmap) { 231 231 return operator=<ArcMap>(cmap); 232 232 } 233 233 … … 235 235 ArcMap& operator=(const CMap& cmap) { 236 236 Parent::operator=(cmap); 237 237 return *this; 238 238 } 239 239 … … 248 248 return arc; 249 249 } 250 250 251 251 void clear() { 252 252 notifier(Arc()).clear(); … … 313 313 Node oppositeNode(const Node &n, const Edge &e) const { 314 314 if( n == Parent::u(e)) 315 315 return Parent::v(e); 316 316 else if( n == Parent::v(e)) 317 317 return Parent::u(e); 318 318 else 319 319 return INVALID; 320 320 } 321 321 … … 341 341 342 342 using Parent::notifier; 343 343 344 344 ArcNotifier& notifier(Arc) const { 345 345 return arc_notifier; … … 351 351 352 352 353 class NodeIt : public Node { 353 class NodeIt : public Node { 354 354 const Graph* graph; 355 355 public: … … 360 360 361 361 explicit NodeIt(const Graph& _graph) : graph(&_graph) { 362 363 } 364 365 NodeIt(const Graph& _graph, const Node& node) 366 367 368 NodeIt& operator++() { 369 370 return *this; 371 } 372 373 }; 374 375 376 class ArcIt : public Arc { 362 _graph.first(static_cast<Node&>(*this)); 363 } 364 365 NodeIt(const Graph& _graph, const Node& node) 366 : Node(node), graph(&_graph) {} 367 368 NodeIt& operator++() { 369 graph->next(*this); 370 return *this; 371 } 372 373 }; 374 375 376 class ArcIt : public Arc { 377 377 const Graph* graph; 378 378 public: … … 383 383 384 384 explicit ArcIt(const Graph& _graph) : graph(&_graph) { 385 386 } 387 388 ArcIt(const Graph& _graph, const Arc& e) : 389 390 391 ArcIt& operator++() { 392 393 return *this; 394 } 395 396 }; 397 398 399 class OutArcIt : public Arc { 385 _graph.first(static_cast<Arc&>(*this)); 386 } 387 388 ArcIt(const Graph& _graph, const Arc& e) : 389 Arc(e), graph(&_graph) { } 390 391 ArcIt& operator++() { 392 graph->next(*this); 393 return *this; 394 } 395 396 }; 397 398 399 class OutArcIt : public Arc { 400 400 const Graph* graph; 401 401 public: … … 405 405 OutArcIt(Invalid i) : Arc(i) { } 406 406 407 OutArcIt(const Graph& _graph, const Node& node) 408 409 410 } 411 412 OutArcIt(const Graph& _graph, const Arc& arc) 413 414 415 OutArcIt& operator++() { 416 417 return *this; 418 } 419 420 }; 421 422 423 class InArcIt : public Arc { 407 OutArcIt(const Graph& _graph, const Node& node) 408 : graph(&_graph) { 409 _graph.firstOut(*this, node); 410 } 411 412 OutArcIt(const Graph& _graph, const Arc& arc) 413 : Arc(arc), graph(&_graph) {} 414 415 OutArcIt& operator++() { 416 graph->nextOut(*this); 417 return *this; 418 } 419 420 }; 421 422 423 class InArcIt : public Arc { 424 424 const Graph* graph; 425 425 public: … … 429 429 InArcIt(Invalid i) : Arc(i) { } 430 430 431 InArcIt(const Graph& _graph, const Node& node) 432 433 434 } 435 436 InArcIt(const Graph& _graph, const Arc& arc) : 437 438 439 InArcIt& operator++() { 440 441 return *this; 442 } 443 444 }; 445 446 447 class EdgeIt : public Parent::Edge { 431 InArcIt(const Graph& _graph, const Node& node) 432 : graph(&_graph) { 433 _graph.firstIn(*this, node); 434 } 435 436 InArcIt(const Graph& _graph, const Arc& arc) : 437 Arc(arc), graph(&_graph) {} 438 439 InArcIt& operator++() { 440 graph->nextIn(*this); 441 return *this; 442 } 443 444 }; 445 446 447 class EdgeIt : public Parent::Edge { 448 448 const Graph* graph; 449 449 public: … … 454 454 455 455 explicit EdgeIt(const Graph& _graph) : graph(&_graph) { 456 457 } 458 459 EdgeIt(const Graph& _graph, const Edge& e) : 460 461 462 EdgeIt& operator++() { 463 464 return *this; 456 _graph.first(static_cast<Edge&>(*this)); 457 } 458 459 EdgeIt(const Graph& _graph, const Edge& e) : 460 Edge(e), graph(&_graph) { } 461 462 EdgeIt& operator++() { 463 graph->next(*this); 464 return *this; 465 465 } 466 466 … … 478 478 479 479 IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) { 480 480 _graph.firstInc(*this, direction, n); 481 481 } 482 482 483 483 IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n) 484 485 484 : graph(&_graph), Edge(ue) { 485 direction = (_graph.source(ue) == n); 486 486 } 487 487 488 488 IncEdgeIt& operator++() { 489 490 return *this; 489 graph->nextInc(*this, direction); 490 return *this; 491 491 } 492 492 }; … … 535 535 536 536 template <typename _Value> 537 class ArcMap 537 class ArcMap 538 538 : public MapExtender<DefaultMap<Graph, Arc, _Value> > { 539 539 typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent; 540 540 541 541 public: 542 explicit ArcMap(const Graph& _g) 543 544 ArcMap(const Graph& _g, const _Value& _v) 545 542 explicit ArcMap(const Graph& _g) 543 : Parent(_g) {} 544 ArcMap(const Graph& _g, const _Value& _v) 545 : Parent(_g, _v) {} 546 546 547 547 ArcMap& operator=(const ArcMap& cmap) { 548 548 return operator=<ArcMap>(cmap); 549 549 } 550 550 … … 552 552 ArcMap& operator=(const CMap& cmap) { 553 553 Parent::operator=(cmap); 554 554 return *this; 555 555 } 556 556 … … 559 559 560 560 template <typename _Value> 561 class EdgeMap 561 class EdgeMap 562 562 : public MapExtender<DefaultMap<Graph, Edge, _Value> > { 563 563 typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent; 564 564 565 565 public: 566 explicit EdgeMap(const Graph& _g) 567 568 569 EdgeMap(const Graph& _g, const _Value& _v) 570 566 explicit EdgeMap(const Graph& _g) 567 : Parent(_g) {} 568 569 EdgeMap(const Graph& _g, const _Value& _v) 570 : Parent(_g, _v) {} 571 571 572 572 EdgeMap& operator=(const EdgeMap& cmap) { 573 573 return operator=<EdgeMap>(cmap); 574 574 } 575 575 … … 577 577 EdgeMap& operator=(const CMap& cmap) { 578 578 Parent::operator=(cmap); 579 579 return *this; 580 580 } 581 581 … … 594 594 return edge; 595 595 } 596 596 597 597 void clear() { 598 598 notifier(Arc()).clear(); … … 620 620 arc_notifier.clear(); 621 621 } 622 622 623 623 }; 624 624 -
lemon/circulation.h
r1081 r1158 559 559 560 560 Node act; 561 Node bact=INVALID;562 Node last_activated=INVALID;563 561 while((act=_level->highestActive())!=INVALID) { 564 562 int actlevel=(*_level)[act]; -
lemon/circulation.h
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 60 60 /// \brief The type of supply map. 61 61 /// 62 /// The type of the map that stores the signed supply values of the 63 /// nodes. 62 /// The type of the map that stores the signed supply values of the 63 /// nodes. 64 64 /// It must conform to the \ref concepts::ReadMap "ReadMap" concept. 65 65 typedef SM SupplyMap; … … 135 135 \geq sup(u) \quad \forall u\in V, \f] 136 136 \f[ lower(uv) \leq f(uv) \leq upper(uv) \quad \forall uv\in A. \f] 137 137 138 138 The sum of the supply values, i.e. \f$\sum_{u\in V} sup(u)\f$ must be 139 139 zero or negative in order to have a feasible solution (since the sum … … 145 145 constraints have to be satisfied with equality, i.e. all demands 146 146 have to be satisfied and all supplies have to be used. 147 147 148 148 If you need the opposite inequalities in the supply/demand constraints 149 149 (i.e. the total demand is less than the total supply and all the demands … … 326 326 /// \param graph The digraph the algorithm runs on. 327 327 /// \param lower The lower bounds for the flow values on the arcs. 328 /// \param upper The upper bounds (capacities) for the flow values 328 /// \param upper The upper bounds (capacities) for the flow values 329 329 /// on the arcs. 330 330 /// \param supply The signed supply values of the nodes. -
lemon/concepts/graph_components.h
r1126 r1158 495 495 _GraphItemIt it3 = it1; 496 496 _GraphItemIt it4 = INVALID; 497 ignore_unused_variable_warning(it3); 498 ignore_unused_variable_warning(it4); 497 499 498 500 it2 = ++it1; … … 584 586 _GraphIncIt it3 = it1; 585 587 _GraphIncIt it4 = INVALID; 588 ignore_unused_variable_warning(it3); 589 ignore_unused_variable_warning(it4); 586 590 587 591 it2 = ++it1; -
lemon/concepts/graph_components.h
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 39 39 /// \note This class is a template class so that we can use it to 40 40 /// create graph skeleton classes. The reason for this is that \c Node 41 /// and \c Arc (or \c Edge) types should \e not derive from the same 41 /// and \c Arc (or \c Edge) types should \e not derive from the same 42 42 /// base class. For \c Node you should instantiate it with character 43 43 /// \c 'n', for \c Arc with \c 'a' and for \c Edge with \c 'e'. … … 90 90 /// 91 91 /// This operator defines an ordering of the items. 92 /// It makes possible to use graph item types as key types in 92 /// It makes possible to use graph item types as key types in 93 93 /// associative containers (e.g. \c std::map). 94 94 /// … … 124 124 /// This class describes the base interface of directed graph types. 125 125 /// All digraph %concepts have to conform to this class. 126 /// It just provides types for nodes and arcs and functions 126 /// It just provides types for nodes and arcs and functions 127 127 /// to get the source and the target nodes of arcs. 128 128 class BaseDigraphComponent { … … 432 432 /// \brief Concept class for \c NodeIt, \c ArcIt and \c EdgeIt types. 433 433 /// 434 /// This class describes the concept of \c NodeIt, \c ArcIt and 434 /// This class describes the concept of \c NodeIt, \c ArcIt and 435 435 /// \c EdgeIt subtypes of digraph and graph types. 436 436 template <typename GR, typename Item> … … 472 472 /// next item. 473 473 GraphItemIt& operator++() { return *this; } 474 474 475 475 /// \brief Equality operator 476 476 /// … … 510 510 }; 511 511 512 /// \brief Concept class for \c InArcIt, \c OutArcIt and 512 /// \brief Concept class for \c InArcIt, \c OutArcIt and 513 513 /// \c IncEdgeIt types. 514 514 /// 515 /// This class describes the concept of \c InArcIt, \c OutArcIt 515 /// This class describes the concept of \c InArcIt, \c OutArcIt 516 516 /// and \c IncEdgeIt subtypes of digraph and graph types. 517 517 /// 518 518 /// \note Since these iterator classes do not inherit from the same 519 519 /// base class, there is an additional template parameter (selector) 520 /// \c sel. For \c InArcIt you should instantiate it with character 520 /// \c sel. For \c InArcIt you should instantiate it with character 521 521 /// \c 'i', for \c OutArcIt with \c 'o' and for \c IncEdgeIt with \c 'e'. 522 522 template <typename GR, … … 539 539 GraphIncIt(const GraphIncIt& it) : Item(it) {} 540 540 541 /// \brief Constructor that sets the iterator to the first 541 /// \brief Constructor that sets the iterator to the first 542 542 /// incoming or outgoing arc. 543 543 /// 544 /// Constructor that sets the iterator to the first arc 544 /// Constructor that sets the iterator to the first arc 545 545 /// incoming to or outgoing from the given node. 546 546 explicit GraphIncIt(const GR&, const Base&) {} … … 817 817 /// \brief Return the first edge incident to the given node. 818 818 /// 819 /// This function gives back the first edge incident to the given 819 /// This function gives back the first edge incident to the given 820 820 /// node. The bool parameter gives back the direction for which the 821 /// source node of the directed arc representing the edge is the 821 /// source node of the directed arc representing the edge is the 822 822 /// given node. 823 823 void firstInc(Edge&, bool&, const Node&) const {} … … 826 826 /// given node. 827 827 /// 828 /// This function gives back the next edge incident to the given 828 /// This function gives back the next edge incident to the given 829 829 /// node. The bool parameter should be used as \c firstInc() use it. 830 830 void nextInc(Edge&, bool&) const {} … … 1006 1006 /// 1007 1007 /// This class describes the concept of standard graph maps, i.e. 1008 /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 1008 /// the \c NodeMap, \c ArcMap and \c EdgeMap subtypes of digraph and 1009 1009 /// graph types, which can be used for associating data to graph items. 1010 1010 /// The standard graph maps must conform to the ReferenceMap concept. … … 1061 1061 _Map m1(g); 1062 1062 _Map m2(g,t); 1063 1063 1064 1064 // Copy constructor 1065 1065 // _Map m3(m); … … 1085 1085 /// 1086 1086 /// This class describes the interface of mappable directed graphs. 1087 /// It extends \ref BaseDigraphComponent with the standard digraph 1087 /// It extends \ref BaseDigraphComponent with the standard digraph 1088 1088 /// map classes, namely \c NodeMap and \c ArcMap. 1089 1089 /// This concept is part of the Digraph concept. … … 1223 1223 /// 1224 1224 /// This class describes the interface of mappable undirected graphs. 1225 /// It extends \ref MappableDigraphComponent with the standard graph 1225 /// It extends \ref MappableDigraphComponent with the standard graph 1226 1226 /// map class for edges (\c EdgeMap). 1227 1227 /// This concept is part of the Graph concept. … … 1309 1309 /// 1310 1310 /// This class describes the interface of extendable directed graphs. 1311 /// It extends \ref BaseDigraphComponent with functions for adding 1311 /// It extends \ref BaseDigraphComponent with functions for adding 1312 1312 /// nodes and arcs to the digraph. 1313 1313 /// This concept requires \ref AlterableDigraphComponent. … … 1354 1354 /// 1355 1355 /// This class describes the interface of extendable undirected graphs. 1356 /// It extends \ref BaseGraphComponent with functions for adding 1356 /// It extends \ref BaseGraphComponent with functions for adding 1357 1357 /// nodes and edges to the graph. 1358 1358 /// This concept requires \ref AlterableGraphComponent. … … 1399 1399 /// 1400 1400 /// This class describes the interface of erasable directed graphs. 1401 /// It extends \ref BaseDigraphComponent with functions for removing 1401 /// It extends \ref BaseDigraphComponent with functions for removing 1402 1402 /// nodes and arcs from the digraph. 1403 1403 /// This concept requires \ref AlterableDigraphComponent. … … 1412 1412 /// \brief Erase a node from the digraph. 1413 1413 /// 1414 /// This function erases the given node from the digraph and all arcs 1414 /// This function erases the given node from the digraph and all arcs 1415 1415 /// connected to the node. 1416 1416 void erase(const Node&) {} … … 1439 1439 /// 1440 1440 /// This class describes the interface of erasable undirected graphs. 1441 /// It extends \ref BaseGraphComponent with functions for removing 1441 /// It extends \ref BaseGraphComponent with functions for removing 1442 1442 /// nodes and edges from the graph. 1443 1443 /// This concept requires \ref AlterableGraphComponent. -
lemon/concepts/maps.h
r1126 r1158 50 50 /// Returns the value associated with the given key. 51 51 Value operator[](const Key &) const { 52 return * static_cast<Value *>(0);52 return *(static_cast<Value *>(0)+1); 53 53 } 54 54 -
lemon/concepts/maps.h
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). -
lemon/graph_to_eps.h
r1081 r1158 223 223 using T::_copyright; 224 224 225 using T::NodeTextColorType;225 using typename T::NodeTextColorType; 226 226 using T::CUST_COL; 227 227 using T::DIST_COL; -
lemon/graph_to_eps.h
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). -
test/adaptors_test.cc
r1156 r1158 66 66 Digraph::Arc a2 = digraph.addArc(n1, n3); 67 67 Digraph::Arc a3 = digraph.addArc(n2, n3); 68 ignore_unused_variable_warning(a3); 68 69 69 70 // Check the adaptor … … 100 101 Adaptor::Arc a7 = adaptor.addArc(n1, n4); 101 102 Adaptor::Arc a8 = adaptor.addArc(n1, n2); 103 ignore_unused_variable_warning(a6,a7,a8); 102 104 103 105 adaptor.erase(a1); … … 759 761 Digraph::Arc a2 = digraph.addArc(n1, n3); 760 762 Digraph::Arc a3 = digraph.addArc(n2, n3); 763 ignore_unused_variable_warning(a1,a2,a3); 761 764 762 765 checkGraphNodeList(adaptor, 6); -
test/adaptors_test.cc
r1157 r1158 1381 1381 1382 1382 // Apply several adaptors on the grid graph 1383 typedef SplitNodes< ReverseDigraph< const Orienter< 1384 const GridGraph, GridGraph::EdgeMap<bool> > > > 1385 RevSplitGridGraph; 1383 typedef Orienter<const GridGraph, GridGraph::EdgeMap<bool> > 1384 OrientedGridGraph; 1385 typedef ReverseDigraph<const OrientedGridGraph> RevOrientedGridGraph; 1386 typedef SplitNodes<RevOrientedGridGraph> RevSplitGridGraph; 1386 1387 typedef ReverseDigraph<const RevSplitGridGraph> SplitGridGraph; 1387 1388 typedef Undirector<const SplitGridGraph> USplitGridGraph; … … 1392 1393 checkConcept<concepts::Graph, UUSplitGridGraph>(); 1393 1394 1395 OrientedGridGraph ori_adaptor = orienter(graph, dir_map); 1396 RevOrientedGridGraph rev_ori_adaptor = reverseDigraph(ori_adaptor); 1394 1397 RevSplitGridGraph rev_adaptor = 1395 splitNodes(rev erseDigraph(orienter(graph, dir_map)));1398 splitNodes(rev_ori_adaptor); 1396 1399 SplitGridGraph adaptor = reverseDigraph(rev_adaptor); 1397 1400 USplitGridGraph uadaptor = undirector(adaptor); -
test/connectivity_test.cc
r1081 r1158 69 69 Graph g(d); 70 70 Digraph::Node n = d.addNode(); 71 ignore_unused_variable_warning(n); 71 72 72 73 check(stronglyConnected(d), "This digraph is strongly connected"); … … 246 247 Digraph::Node watch = d.addNode(); 247 248 Digraph::Node pants = d.addNode(); 249 ignore_unused_variable_warning(watch); 248 250 249 251 d.addArc(socks, shoe); -
test/connectivity_test.cc
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 30 30 typedef ListDigraph Digraph; 31 31 typedef Undirector<Digraph> Graph; 32 33 { 34 Digraph d; 35 Digraph::NodeMap<int> order(d); 36 Graph g(d); 37 32 33 { 34 Digraph d; 35 Digraph::NodeMap<int> order(d); 36 Graph g(d); 37 38 38 check(stronglyConnected(d), "The empty digraph is strongly connected"); 39 39 check(countStronglyConnectedComponents(d) == 0, … … 49 49 check(countBiEdgeConnectedComponents(g) == 0, 50 50 "The empty graph has 0 bi-edge-connected component"); 51 51 52 52 check(dag(d), "The empty digraph is DAG."); 53 53 check(checkedTopologicalSort(d, order), "The empty digraph is DAG."); … … 84 84 check(countBiEdgeConnectedComponents(g) == 1, 85 85 "This graph has 1 bi-edge-connected component"); 86 86 87 87 check(dag(d), "This digraph is DAG."); 88 88 check(checkedTopologicalSort(d, order), "This digraph is DAG."); … … 103 103 Digraph::NodeMap<int> order(d); 104 104 Graph g(d); 105 105 106 106 Digraph::Node n1 = d.addNode(); 107 107 Digraph::Node n2 = d.addNode(); … … 110 110 Digraph::Node n5 = d.addNode(); 111 111 Digraph::Node n6 = d.addNode(); 112 112 113 113 d.addArc(n1, n3); 114 114 d.addArc(n3, n2); … … 138 138 check(!parallelFree(g), "This graph is not parallel-free."); 139 139 check(!simpleGraph(g), "This graph is not simple."); 140 140 141 141 d.addArc(n3, n3); 142 142 143 143 check(!loopFree(d), "This digraph is not loop-free."); 144 144 check(!loopFree(g), "This graph is not loop-free."); 145 145 check(!simpleGraph(d), "This digraph is not simple."); 146 146 147 147 d.addArc(n3, n2); 148 148 149 149 check(!parallelFree(d), "This digraph is not parallel-free."); 150 150 } 151 151 152 152 { 153 153 Digraph d; 154 154 Digraph::ArcMap<bool> cutarcs(d, false); 155 155 Graph g(d); 156 156 157 157 Digraph::Node n1 = d.addNode(); 158 158 Digraph::Node n2 = d.addNode(); … … 174 174 d.addArc(n6, n7); 175 175 d.addArc(n7, n6); 176 176 177 177 check(!stronglyConnected(d), "This digraph is not strongly connected"); 178 178 check(countStronglyConnectedComponents(d) == 3, … … 237 237 Digraph d; 238 238 Digraph::NodeMap<int> order(d); 239 239 240 240 Digraph::Node belt = d.addNode(); 241 241 Digraph::Node trousers = d.addNode(); … … 258 258 d.addArc(shirt, necktie); 259 259 d.addArc(necktie, coat); 260 260 261 261 check(dag(d), "This digraph is DAG."); 262 262 topologicalSort(d, order); … … 270 270 ListGraph g; 271 271 ListGraph::NodeMap<bool> map(g); 272 272 273 273 ListGraph::Node n1 = g.addNode(); 274 274 ListGraph::Node n2 = g.addNode(); … … 286 286 g.addEdge(n4, n7); 287 287 g.addEdge(n5, n7); 288 288 289 289 check(bipartite(g), "This graph is bipartite"); 290 290 check(bipartitePartitions(g, map), "This graph is bipartite"); 291 291 292 292 check(map[n1] == map[n2] && map[n1] == map[n6] && map[n1] == map[n7], 293 293 "Wrong bipartitePartitions()"); -
test/edge_set_test.cc
r1081 r1158 45 45 46 46 Digraph::Arc ga1 = digraph.addArc(n1, n2); 47 ignore_unused_variable_warning(ga1); 47 48 48 49 ArcSet arc_set(digraph); 49 50 50 51 Digraph::Arc ga2 = digraph.addArc(n2, n1); 52 ignore_unused_variable_warning(ga2); 51 53 52 54 checkGraphNodeList(arc_set, 2); … … 76 78 a3 = arc_set.addArc(n2, n3), 77 79 a4 = arc_set.addArc(n2, n3); 80 ignore_unused_variable_warning(a2,a3,a4); 81 78 82 checkGraphNodeList(arc_set, 3); 79 83 checkGraphArcList(arc_set, 4); … … 111 115 112 116 Digraph::Arc ga1 = digraph.addArc(n1, n2); 117 ignore_unused_variable_warning(ga1); 113 118 114 119 ArcSet arc_set(digraph); 115 120 116 121 Digraph::Arc ga2 = digraph.addArc(n2, n1); 122 ignore_unused_variable_warning(ga2); 117 123 118 124 checkGraphNodeList(arc_set, 2); … … 142 148 a3 = arc_set.addArc(n2, n3), 143 149 a4 = arc_set.addArc(n2, n3); 150 ignore_unused_variable_warning(a2,a3,a4); 151 144 152 checkGraphNodeList(arc_set, 3); 145 153 checkGraphArcList(arc_set, 4); … … 191 199 192 200 Digraph::Arc ga1 = digraph.addArc(n1, n2); 201 ignore_unused_variable_warning(ga1); 193 202 194 203 EdgeSet edge_set(digraph); 195 204 196 205 Digraph::Arc ga2 = digraph.addArc(n2, n1); 206 ignore_unused_variable_warning(ga2); 197 207 198 208 checkGraphNodeList(edge_set, 2); … … 231 241 e3 = edge_set.addEdge(n2, n3), 232 242 e4 = edge_set.addEdge(n2, n3); 243 ignore_unused_variable_warning(e2,e3,e4); 244 233 245 checkGraphNodeList(edge_set, 3); 234 246 checkGraphEdgeList(edge_set, 4); … … 275 287 276 288 Digraph::Arc ga1 = digraph.addArc(n1, n2); 289 ignore_unused_variable_warning(ga1); 277 290 278 291 EdgeSet edge_set(digraph); 279 292 280 293 Digraph::Arc ga2 = digraph.addArc(n2, n1); 294 ignore_unused_variable_warning(ga2); 281 295 282 296 checkGraphNodeList(edge_set, 2); … … 315 329 e3 = edge_set.addEdge(n2, n3), 316 330 e4 = edge_set.addEdge(n2, n3); 331 ignore_unused_variable_warning(e2,e3,e4); 332 317 333 checkGraphNodeList(edge_set, 3); 318 334 checkGraphEdgeList(edge_set, 4); -
test/edge_set_test.cc
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 085 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). -
test/euler_test.cc
r1081 r1158 102 102 Graph g(d); 103 103 Digraph::Node n = d.addNode(); 104 104 ignore_unused_variable_warning(n); 105 105 106 checkDiEulerIt(d); 106 107 checkDiEulerIt(g); … … 190 191 Digraph::Node n4 = d.addNode(); 191 192 Digraph::Node n5 = d.addNode(); 193 ignore_unused_variable_warning(n0,n4,n5); 192 194 193 195 d.addArc(n1, n2); -
test/euler_test.cc
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 86 86 typedef ListDigraph Digraph; 87 87 typedef Undirector<Digraph> Graph; 88 89 { 90 Digraph d; 91 Graph g(d); 92 88 89 { 90 Digraph d; 91 Graph g(d); 92 93 93 checkDiEulerIt(d); 94 94 checkDiEulerIt(g); … … 130 130 Digraph::Node n2 = d.addNode(); 131 131 Digraph::Node n3 = d.addNode(); 132 132 133 133 d.addArc(n1, n2); 134 134 d.addArc(n2, n1); … … 155 155 Digraph::Node n5 = d.addNode(); 156 156 Digraph::Node n6 = d.addNode(); 157 157 158 158 d.addArc(n1, n2); 159 159 d.addArc(n2, n4); … … 214 214 Digraph::Node n2 = d.addNode(); 215 215 Digraph::Node n3 = d.addNode(); 216 216 217 217 d.addArc(n1, n2); 218 218 d.addArc(n2, n3); -
test/maps_test.cc
r1081 r1158 81 81 NullMap<A,B> map1; 82 82 NullMap<A,B> map2 = map1; 83 ignore_unused_variable_warning(map2); 83 84 map1 = nullMap<A,B>(); 84 85 } … … 91 92 ConstMap<A,B> map2 = B(); 92 93 ConstMap<A,B> map3 = map1; 94 ignore_unused_variable_warning(map2,map3); 95 93 96 map1 = constMap<A>(B()); 94 97 map1 = constMap<A,B>(); … … 96 99 ConstMap<A,C> map4(C(1)); 97 100 ConstMap<A,C> map5 = map4; 101 ignore_unused_variable_warning(map5); 102 98 103 map4 = constMap<A>(C(2)); 99 104 map4.setAll(C(3)); … … 116 121 IdentityMap<A> map1; 117 122 IdentityMap<A> map2 = map1; 123 ignore_unused_variable_warning(map2); 124 118 125 map1 = identityMap<A>(); 119 126 … … 175 182 checkConcept<ReadMap<B,double>, CompMap>(); 176 183 CompMap map1 = CompMap(DoubleMap(),ReadMap<B,A>()); 184 ignore_unused_variable_warning(map1); 177 185 CompMap map2 = composeMap(DoubleMap(), ReadMap<B,A>()); 186 ignore_unused_variable_warning(map2); 178 187 179 188 SparseMap<double, bool> m1(false); m1[3.14] = true; … … 188 197 checkConcept<ReadMap<A,double>, CombMap>(); 189 198 CombMap map1 = CombMap(DoubleMap(), DoubleMap()); 199 ignore_unused_variable_warning(map1); 190 200 CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus<double>()); 201 ignore_unused_variable_warning(map2); 191 202 192 203 check(combineMap(constMap<B,int,2>(), identityMap<B>(), &binc)[B()] == 3, … … 200 211 FunctorToMap<F> map1; 201 212 FunctorToMap<F> map2 = FunctorToMap<F>(F()); 213 ignore_unused_variable_warning(map2); 214 202 215 B b = functorToMap(F())[A()]; 216 ignore_unused_variable_warning(b); 203 217 204 218 checkConcept<ReadMap<A,B>, MapToFunctor<ReadMap<A,B> > >(); 205 219 MapToFunctor<ReadMap<A,B> > map = 206 220 MapToFunctor<ReadMap<A,B> >(ReadMap<A,B>()); 221 ignore_unused_variable_warning(map); 207 222 208 223 check(functorToMap(&func)[A()] == 3, … … 222 237 ConvertMap<ReadMap<double, int>, double> >(); 223 238 ConvertMap<RangeMap<bool>, int> map1(rangeMap(1, true)); 239 ignore_unused_variable_warning(map1); 224 240 ConvertMap<RangeMap<bool>, int> map2 = convertMap<int>(rangeMap(2, false)); 241 ignore_unused_variable_warning(map2); 242 225 243 } 226 244 -
test/maps_test.cc
r1157 r1158 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2011 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 71 71 checkConcept<ReadWriteMap<A,B>, ReadWriteMap<A,B> >(); 72 72 checkConcept<ReadWriteMap<A,C>, ReadWriteMap<A,C> >(); 73 checkConcept<ReferenceMap<A,B,B&,const B&>, ReferenceMap<A,B,B&,const B&> >(); 74 checkConcept<ReferenceMap<A,C,C&,const C&>, ReferenceMap<A,C,C&,const C&> >(); 73 checkConcept<ReferenceMap<A,B,B&,const B&>, 74 ReferenceMap<A,B,B&,const B&> >(); 75 checkConcept<ReferenceMap<A,C,C&,const C&>, 76 ReferenceMap<A,C,C&,const C&> >(); 75 77 76 78 // NullMap … … 369 371 check(v1[i++] == *it, "Something is wrong with LoggerBoolMap"); 370 372 } 371 373 372 374 // CrossRefMap 373 375 { … … 377 379 checkConcept<ReadWriteMap<Node, int>, 378 380 CrossRefMap<Graph, Node, int> >(); 379 381 380 382 Graph gr; 381 383 typedef CrossRefMap<Graph, Node, char> CRMap; 382 384 typedef CRMap::ValueIterator ValueIt; 383 385 CRMap map(gr); 384 386 385 387 Node n0 = gr.addNode(); 386 388 Node n1 = gr.addNode(); 387 389 Node n2 = gr.addNode(); 388 390 389 391 map.set(n0, 'A'); 390 392 map.set(n1, 'B');
Note: See TracChangeset
for help on using the changeset viewer.