Changeset 1979:c2992fd74dad in lemon0.x for lemon/graph_adaptor.h
 Timestamp:
 02/22/06 19:26:56 (14 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@2569
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

lemon/graph_adaptor.h
r1957 r1979 30 30 #include <lemon/invalid.h> 31 31 #include <lemon/maps.h> 32 #include <lemon/bits/erasable_graph_extender.h> 33 #include <lemon/bits/clearable_graph_extender.h> 34 #include <lemon/bits/extendable_graph_extender.h> 35 #include <lemon/bits/iterable_graph_extender.h> 36 #include <lemon/bits/alteration_notifier.h> 37 #include <lemon/bits/default_map.h> 32 33 #include <lemon/bits/graph_adaptor_extender.h> 38 34 #include <lemon/bits/graph_extender.h> 35 39 36 #include <iostream> 40 37 … … 118 115 int id(const Edge& e) const { return graph>id(e); } 119 116 120 Edge oppositeNode(const Edge& e) const {121 return Edge(graph>opposite(e));122 }123 124 117 template <typename _Value> 125 118 class NodeMap : public _Graph::template NodeMap<_Value> { … … 146 139 template <typename _Graph> 147 140 class GraphAdaptor : 148 public IterableGraphExtender<GraphAdaptorBase<_Graph> > {141 public GraphAdaptorExtender<GraphAdaptorBase<_Graph> > { 149 142 public: 150 143 typedef _Graph Graph; 151 typedef IterableGraphExtender<GraphAdaptorBase<_Graph> > Parent;144 typedef GraphAdaptorExtender<GraphAdaptorBase<_Graph> > Parent; 152 145 protected: 153 146 GraphAdaptor() : Parent() { } … … 199 192 template<typename _Graph> 200 193 class RevGraphAdaptor : 201 public IterableGraphExtender<RevGraphAdaptorBase<_Graph> > {194 public GraphAdaptorExtender<RevGraphAdaptorBase<_Graph> > { 202 195 public: 203 196 typedef _Graph Graph; 204 typedef IterableGraphExtender<197 typedef GraphAdaptorExtender< 205 198 RevGraphAdaptorBase<_Graph> > Parent; 206 199 protected: … … 323 316 bool hidden(const Edge& e) const { return !(*edge_filter_map)[e]; } 324 317 318 typedef False FindEdgeTag; 325 319 typedef False NodeNumTag; 326 320 typedef False EdgeNumTag; … … 429 423 bool hidden(const Edge& e) const { return !(*edge_filter_map)[e]; } 430 424 425 typedef False FindEdgeTag; 431 426 typedef False NodeNumTag; 432 427 typedef False EdgeNumTag; … … 497 492 typename EdgeFilterMap, bool checked = true> 498 493 class SubGraphAdaptor : 499 public IterableGraphExtender<494 public GraphAdaptorExtender< 500 495 SubGraphAdaptorBase<_Graph, NodeFilterMap, EdgeFilterMap, checked> > { 501 496 public: 502 497 typedef _Graph Graph; 503 typedef IterableGraphExtender<498 typedef GraphAdaptorExtender< 504 499 SubGraphAdaptorBase<_Graph, NodeFilterMap, EdgeFilterMap> > Parent; 505 500 protected: … … 704 699 705 700 template <typename _Graph> 706 class U GraphAdaptorBase :707 public UGraph Extender<GraphAdaptorBase<_Graph> > {701 class UndirectGraphAdaptorBase : 702 public UGraphBaseExtender<GraphAdaptorBase<_Graph> > { 708 703 public: 709 704 typedef _Graph Graph; 710 typedef UGraph Extender<GraphAdaptorBase<_Graph> > Parent;705 typedef UGraphBaseExtender<GraphAdaptorBase<_Graph> > Parent; 711 706 protected: 712 U GraphAdaptorBase() : Parent() { }707 UndirectGraphAdaptorBase() : Parent() { } 713 708 public: 714 709 typedef typename Parent::UEdge UEdge; … … 718 713 class EdgeMap { 719 714 protected: 720 const U GraphAdaptorBase<_Graph>* g;715 const UndirectGraphAdaptorBase<_Graph>* g; 721 716 template <typename TT> friend class EdgeMap; 722 717 typename _Graph::template EdgeMap<T> forward_map, backward_map; … … 725 720 typedef Edge Key; 726 721 727 EdgeMap(const U GraphAdaptorBase<_Graph>& _g) : g(&_g),722 EdgeMap(const UndirectGraphAdaptorBase<_Graph>& _g) : g(&_g), 728 723 forward_map(*(g>graph)), backward_map(*(g>graph)) { } 729 724 730 EdgeMap(const U GraphAdaptorBase<_Graph>& _g, T a) : g(&_g),725 EdgeMap(const UndirectGraphAdaptorBase<_Graph>& _g, T a) : g(&_g), 731 726 forward_map(*(g>graph), a), backward_map(*(g>graph), a) { } 732 727 … … 754 749 typedef UEdge Key; 755 750 756 UEdgeMap(const U GraphAdaptorBase<_Graph>& g) :751 UEdgeMap(const UndirectGraphAdaptorBase<_Graph>& g) : 757 752 map(*(g.graph)) { } 758 753 759 UEdgeMap(const U GraphAdaptorBase<_Graph>& g, T a) :754 UEdgeMap(const UndirectGraphAdaptorBase<_Graph>& g, T a) : 760 755 map(*(g.graph), a) { } 761 756 … … 779 774 /// \author Marton Makai 780 775 template<typename _Graph> 781 class U GraphAdaptor :782 public IterableUGraphExtender<783 U GraphAdaptorBase<_Graph> > {776 class UndirectGraphAdaptor : 777 public UGraphAdaptorExtender< 778 UndirectGraphAdaptorBase<_Graph> > { 784 779 public: 785 780 typedef _Graph Graph; 786 typedef IterableUGraphExtender<787 U GraphAdaptorBase<_Graph> > Parent;781 typedef UGraphAdaptorExtender< 782 UndirectGraphAdaptorBase<_Graph> > Parent; 788 783 protected: 789 U GraphAdaptor() { }790 public: 791 U GraphAdaptor(_Graph& _graph) {784 UndirectGraphAdaptor() { } 785 public: 786 UndirectGraphAdaptor(_Graph& _graph) { 792 787 setGraph(_graph); 793 788 } … … 1084 1079 typename ForwardFilterMap, typename BackwardFilterMap> 1085 1080 class SubBidirGraphAdaptor : 1086 public IterableGraphExtender<1081 public GraphAdaptorExtender< 1087 1082 SubBidirGraphAdaptorBase<_Graph, ForwardFilterMap, BackwardFilterMap> > { 1088 1083 public: 1089 1084 typedef _Graph Graph; 1090 typedef IterableGraphExtender<1085 typedef GraphAdaptorExtender< 1091 1086 SubBidirGraphAdaptorBase< 1092 1087 _Graph, ForwardFilterMap, BackwardFilterMap> > Parent; … … 1342 1337 template <typename _Graph, typename FirstOutEdgesMap> 1343 1338 class ErasingFirstGraphAdaptor : 1344 public IterableGraphExtender<1339 public GraphAdaptorExtender< 1345 1340 ErasingFirstGraphAdaptorBase<_Graph, FirstOutEdgesMap> > { 1346 1341 public: 1347 1342 typedef _Graph Graph; 1348 typedef IterableGraphExtender<1343 typedef GraphAdaptorExtender< 1349 1344 ErasingFirstGraphAdaptorBase<_Graph, FirstOutEdgesMap> > Parent; 1350 1345 ErasingFirstGraphAdaptor(Graph& _graph, … … 1712 1707 template <typename _Graph> 1713 1708 class SplitGraphAdaptor 1714 : public IterableGraphExtender<SplitGraphAdaptorBase<_Graph> > {1715 public: 1716 typedef IterableGraphExtender<SplitGraphAdaptorBase<_Graph> > Parent;1709 : public GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > { 1710 public: 1711 typedef GraphAdaptorExtender<SplitGraphAdaptorBase<_Graph> > Parent; 1717 1712 1718 1713 SplitGraphAdaptor(_Graph& graph) {
Note: See TracChangeset
for help on using the changeset viewer.