Changes in lemon/adaptors.h [956:141f9c0db4a3:703:cb38ccedd2c1] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/adaptors.h
r956 r703 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 105 * Copyright (C) 2003-2009 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 361 361 /// parameter is set to be \c const. 362 362 /// 363 /// This class provides item counting in the same time as the adapted364 /// digraph structure.365 ///366 363 /// \tparam DGR The type of the adapted digraph. 367 364 /// It must conform to the \ref concepts::Digraph "Digraph" concept. … … 422 419 Parent::initialize(digraph); 423 420 _node_filter = &node_filter; 424 _arc_filter = &arc_filter; 421 _arc_filter = &arc_filter; 425 422 } 426 423 … … 509 506 510 507 template <typename V> 511 class NodeMap 512 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 513 508 class NodeMap 509 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 510 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> { 514 511 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 515 512 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; 516 513 517 514 public: … … 536 533 537 534 template <typename V> 538 class ArcMap 535 class ArcMap 539 536 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 540 537 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> { 541 538 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, ch>, 542 539 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> Parent; … … 583 580 Parent::initialize(digraph); 584 581 _node_filter = &node_filter; 585 _arc_filter = &arc_filter; 582 _arc_filter = &arc_filter; 586 583 } 587 584 … … 652 649 653 650 template <typename V> 654 class NodeMap 651 class NodeMap 655 652 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 656 653 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> { 657 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 654 typedef SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 658 655 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, NodeMap<V>)> Parent; 659 656 … … 679 676 680 677 template <typename V> 681 class ArcMap 678 class ArcMap 682 679 : public SubMapExtender<SubDigraphBase<DGR, NF, AF, false>, 683 680 LEMON_SCOPE_FIX(DigraphAdaptorBase<DGR>, ArcMap<V>)> { … … 722 719 /// by adding or removing nodes or arcs, unless the \c GR template 723 720 /// parameter is set to be \c const. 724 ///725 /// This class provides only linear time counting for nodes and arcs.726 721 /// 727 722 /// \tparam DGR The type of the adapted digraph. … … 1022 1017 1023 1018 template <typename V> 1024 class NodeMap 1019 class NodeMap 1025 1020 : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1026 1021 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> { 1027 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1022 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1028 1023 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; 1029 1024 … … 1049 1044 1050 1045 template <typename V> 1051 class ArcMap 1046 class ArcMap 1052 1047 : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1053 1048 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> { 1054 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1049 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1055 1050 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; 1056 1051 … … 1076 1071 1077 1072 template <typename V> 1078 class EdgeMap 1073 class EdgeMap 1079 1074 : public SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1080 1075 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> { 1081 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1076 typedef SubMapExtender<SubGraphBase<GR, NF, EF, ch>, 1082 1077 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; 1083 1078 … … 1118 1113 NF* _node_filter; 1119 1114 EF* _edge_filter; 1120 SubGraphBase() 1121 1115 SubGraphBase() 1116 : Parent(), _node_filter(0), _edge_filter(0) { } 1122 1117 1123 1118 void initialize(GR& graph, NF& node_filter, EF& edge_filter) { … … 1220 1215 1221 1216 template <typename V> 1222 class NodeMap 1217 class NodeMap 1223 1218 : public SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1224 1219 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> { 1225 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1220 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1226 1221 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, NodeMap<V>)> Parent; 1227 1222 … … 1247 1242 1248 1243 template <typename V> 1249 class ArcMap 1244 class ArcMap 1250 1245 : public SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1251 1246 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> { 1252 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1247 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1253 1248 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, ArcMap<V>)> Parent; 1254 1249 … … 1274 1269 1275 1270 template <typename V> 1276 class EdgeMap 1271 class EdgeMap 1277 1272 : public SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1278 1273 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> { 1279 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1280 1274 typedef SubMapExtender<SubGraphBase<GR, NF, EF, false>, 1275 LEMON_SCOPE_FIX(GraphAdaptorBase<GR>, EdgeMap<V>)> Parent; 1281 1276 1282 1277 public: … … 1319 1314 /// by adding or removing nodes or edges, unless the \c GR template 1320 1315 /// parameter is set to be \c const. 1321 ///1322 /// This class provides only linear time counting for nodes, edges and arcs.1323 1316 /// 1324 1317 /// \tparam GR The type of the adapted graph. … … 1478 1471 /// by adding or removing nodes or arcs/edges, unless the \c GR template 1479 1472 /// parameter is set to be \c const. 1480 ///1481 /// This class provides only linear time item counting.1482 1473 /// 1483 1474 /// \tparam GR The type of the adapted digraph or graph. … … 1505 1496 #endif 1506 1497 typedef DigraphAdaptorExtender< 1507 SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 1498 SubDigraphBase<GR, NF, ConstMap<typename GR::Arc, Const<bool, true> >, 1508 1499 true> > Parent; 1509 1500 … … 1526 1517 /// Creates a subgraph for the given digraph or graph with the 1527 1518 /// given node filter map. 1528 FilterNodes(GR& graph, NF& node_filter) 1519 FilterNodes(GR& graph, NF& node_filter) 1529 1520 : Parent(), const_true_map() 1530 1521 { … … 1564 1555 typename enable_if<UndirectedTagIndicator<GR> >::type> : 1565 1556 public GraphAdaptorExtender< 1566 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1557 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1567 1558 true> > { 1568 1559 1569 1560 typedef GraphAdaptorExtender< 1570 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1561 SubGraphBase<GR, NF, ConstMap<typename GR::Edge, Const<bool, true> >, 1571 1562 true> > Parent; 1572 1563 … … 1628 1619 /// by adding or removing nodes or arcs, unless the \c GR template 1629 1620 /// parameter is set to be \c const. 1630 ///1631 /// This class provides only linear time counting for nodes and arcs.1632 1621 /// 1633 1622 /// \tparam DGR The type of the adapted digraph. … … 1654 1643 #endif 1655 1644 typedef DigraphAdaptorExtender< 1656 SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 1645 SubDigraphBase<DGR, ConstMap<typename DGR::Node, Const<bool, true> >, 1657 1646 AF, false> > Parent; 1658 1647 … … 1740 1729 /// by adding or removing nodes or edges, unless the \c GR template 1741 1730 /// parameter is set to be \c const. 1742 ///1743 /// This class provides only linear time counting for nodes, edges and arcs.1744 1731 /// 1745 1732 /// \tparam GR The type of the adapted graph. … … 1762 1749 class FilterEdges : 1763 1750 public GraphAdaptorExtender< 1764 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 1751 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true> >, 1765 1752 EF, false> > { 1766 1753 #endif 1767 1754 typedef GraphAdaptorExtender< 1768 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 1755 SubGraphBase<GR, ConstMap<typename GR::Node, Const<bool, true > >, 1769 1756 EF, false> > Parent; 1770 1757 … … 1791 1778 /// Creates a subgraph for the given graph with the given edge 1792 1779 /// filter map. 1793 FilterEdges(GR& graph, EF& edge_filter) 1780 FilterEdges(GR& graph, EF& edge_filter) 1794 1781 : Parent(), const_true_map() { 1795 1782 Parent::initialize(graph, const_true_map, edge_filter); … … 1859 1846 bool _forward; 1860 1847 1861 Arc(const Edge& edge, bool forward) 1848 Arc(const Edge& edge, bool forward) 1862 1849 : _edge(edge), _forward(forward) {} 1863 1850 … … 2099 2086 2100 2087 ArcMapBase(const UndirectorBase<DGR>& adaptor, const V& value) 2101 : _forward(*adaptor._digraph, value), 2088 : _forward(*adaptor._digraph, value), 2102 2089 _backward(*adaptor._digraph, value) {} 2103 2090 … … 2217 2204 typedef typename ItemSetTraits<DGR, Edge>::ItemNotifier EdgeNotifier; 2218 2205 EdgeNotifier& notifier(Edge) const { return _digraph->notifier(Edge()); } 2219 2206 2220 2207 typedef EdgeNotifier ArcNotifier; 2221 2208 ArcNotifier& notifier(Arc) const { return _digraph->notifier(Edge()); } … … 2245 2232 /// by adding or removing nodes or edges, unless the \c GR template 2246 2233 /// parameter is set to be \c const. 2247 ///2248 /// This class provides item counting in the same time as the adapted2249 /// digraph structure.2250 2234 /// 2251 2235 /// \tparam DGR The type of the adapted digraph. … … 2551 2535 /// by adding or removing nodes or arcs, unless the \c GR template 2552 2536 /// parameter is set to be \c const. 2553 ///2554 /// This class provides item counting in the same time as the adapted2555 /// graph structure.2556 2537 /// 2557 2538 /// \tparam GR The type of the adapted graph. … … 2698 2679 /// This class conforms to the \ref concepts::Digraph "Digraph" concept. 2699 2680 /// 2700 /// This class provides only linear time counting for nodes and arcs.2701 ///2702 2681 /// \tparam DGR The type of the adapted digraph. 2703 2682 /// It must conform to the \ref concepts::Digraph "Digraph" concept. … … 2729 2708 typename FM = CM, 2730 2709 typename TL = Tolerance<typename CM::Value> > 2731 class ResidualDigraph 2710 class ResidualDigraph 2732 2711 : public SubDigraph< 2733 2712 Undirector<const DGR>, … … 2786 2765 ResidualDigraph(const DGR& digraph, const CM& capacity, 2787 2766 FM& flow, const TL& tolerance = Tolerance()) 2788 : Parent(), _capacity(&capacity), _flow(&flow), 2767 : Parent(), _capacity(&capacity), _flow(&flow), 2789 2768 _graph(digraph), _node_filter(), 2790 2769 _forward_filter(capacity, flow, tolerance), … … 2868 2847 2869 2848 /// Constructor 2870 ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 2849 ResidualCapacity(const ResidualDigraph<DGR, CM, FM, TL>& adaptor) 2871 2850 : _adaptor(&adaptor) {} 2872 2851 … … 3347 3326 /// in the adaptor. 3348 3327 /// 3349 /// This class provides item counting in the same time as the adapted3350 /// digraph structure.3351 ///3352 3328 /// \tparam DGR The type of the adapted digraph. 3353 3329 /// It must conform to the \ref concepts::Digraph "Digraph" concept. … … 3448 3424 /// to get a node map of the split digraph. 3449 3425 /// Its value type is inherited from the first node map type (\c IN). 3450 /// \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. 3451 3427 /// \tparam OUT The type of the node map for the out-nodes. 3452 3428 template <typename IN, typename OUT>
Note: See TracChangeset
for help on using the changeset viewer.