1.1 --- a/src/work/marci/experiment/graph_wrapper.h Fri Sep 17 15:11:39 2004 +0000
1.2 +++ b/src/work/marci/experiment/graph_wrapper.h Fri Sep 17 15:51:50 2004 +0000
1.3 @@ -161,7 +161,7 @@
1.4 };
1.5
1.6 template<typename GraphWrapper>
1.7 - class GraphWrapperSkeleton {
1.8 + class GraphWrapper {
1.9 protected:
1.10 GraphWrapper gw;
1.11
1.12 @@ -184,7 +184,7 @@
1.13 NodeIt(const typename GraphWrapper::NodeIt& n) :
1.14 GraphWrapper::NodeIt(n) { }
1.15 NodeIt(const Invalid& i) : GraphWrapper::NodeIt(i) { }
1.16 - NodeIt(const GraphWrapperSkeleton<GraphWrapper>& _G) :
1.17 + NodeIt(const GraphWrapper<GraphWrapper>& _G) :
1.18 GraphWrapper::NodeIt(_G.gw) { }
1.19 };
1.20 typedef typename GraphWrapper::Edge Edge;
1.21 @@ -195,7 +195,7 @@
1.22 OutEdgeIt(const typename GraphWrapper::OutEdgeIt& e) :
1.23 GraphWrapper::OutEdgeIt(e) { }
1.24 OutEdgeIt(const Invalid& i) : GraphWrapper::OutEdgeIt(i) { }
1.25 - OutEdgeIt(const GraphWrapperSkeleton<GraphWrapper>& _G, const Node& n) :
1.26 + OutEdgeIt(const GraphWrapper<GraphWrapper>& _G, const Node& n) :
1.27 GraphWrapper::OutEdgeIt(_G.gw, n) { }
1.28 };
1.29 //typedef typename GraphWrapper::InEdgeIt InEdgeIt;
1.30 @@ -205,7 +205,7 @@
1.31 InEdgeIt(const typename GraphWrapper::InEdgeIt& e) :
1.32 GraphWrapper::InEdgeIt(e) { }
1.33 InEdgeIt(const Invalid& i) : GraphWrapper::InEdgeIt(i) { }
1.34 - InEdgeIt(const GraphWrapperSkeleton<GraphWrapper>& _G, const Node& n) :
1.35 + InEdgeIt(const GraphWrapper<GraphWrapper>& _G, const Node& n) :
1.36 GraphWrapper::InEdgeIt(_G.gw, n) { }
1.37 };
1.38 //typedef typename GraphWrapper::SymEdgeIt SymEdgeIt;
1.39 @@ -216,13 +216,13 @@
1.40 EdgeIt(const typename GraphWrapper::EdgeIt& e) :
1.41 GraphWrapper::EdgeIt(e) { }
1.42 EdgeIt(const Invalid& i) : GraphWrapper::EdgeIt(i) { }
1.43 - EdgeIt(const GraphWrapperSkeleton<GraphWrapper>& _G) :
1.44 + EdgeIt(const GraphWrapper<GraphWrapper>& _G) :
1.45 GraphWrapper::EdgeIt(_G.gw) { }
1.46 };
1.47
1.48
1.49 - //GraphWrapperSkeleton() : gw() { }
1.50 - GraphWrapperSkeleton(GraphWrapper _gw) : gw(_gw) { }
1.51 + //GraphWrapper() : gw() { }
1.52 + GraphWrapper(GraphWrapper _gw) : gw(_gw) { }
1.53
1.54 //void setGraph(BaseGraph& _graph) { gw.setGraph(_graph); }
1.55 //BaseGraph& getGraph() const { return gw.getGraph(); }
1.56 @@ -269,17 +269,17 @@
1.57
1.58 template<typename T> class NodeMap : public GraphWrapper::NodeMap<T> {
1.59 public:
1.60 - NodeMap(const GraphWrapperSkeleton<GraphWrapper>& _G) :
1.61 + NodeMap(const GraphWrapper<GraphWrapper>& _G) :
1.62 GraphWrapper::NodeMap<T>(_G.gw) { }
1.63 - NodeMap(const GraphWrapperSkeleton<GraphWrapper>& _G, T a) :
1.64 + NodeMap(const GraphWrapper<GraphWrapper>& _G, T a) :
1.65 GraphWrapper::NodeMap<T>(_G.gw, a) { }
1.66 };
1.67
1.68 template<typename T> class EdgeMap : public GraphWrapper::EdgeMap<T> {
1.69 public:
1.70 - EdgeMap(const GraphWrapperSkeleton<GraphWrapper>& _G) :
1.71 + EdgeMap(const GraphWrapper<GraphWrapper>& _G) :
1.72 GraphWrapper::EdgeMap<T>(_G.gw) { }
1.73 - EdgeMap(const GraphWrapperSkeleton<GraphWrapper>& _G, T a) :
1.74 + EdgeMap(const GraphWrapper<GraphWrapper>& _G, T a) :
1.75 GraphWrapper::EdgeMap<T>(_G.gw, a) { }
1.76 };
1.77 };
1.78 @@ -365,9 +365,9 @@
1.79 // };
1.80
1.81 // template<typename /*Graph*/GraphWrapper
1.82 -// /*=typename GraphWrapperSkeleton< TrivGraphWrapper<Graph>*/ >
1.83 +// /*=typename GraphWrapper< TrivGraphWrapper<Graph>*/ >
1.84 // class RevGraphWrapper :
1.85 -// public GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/ {
1.86 +// public GraphWrapper/*GraphWrapper< TrivGraphWrapper<Graph> >*/ {
1.87 // protected:
1.88 // //Graph* graph;
1.89
1.90 @@ -378,13 +378,13 @@
1.91 // //typedef typename Graph::NodeIt NodeIt;
1.92
1.93 // //typedef typename Graph::Edge Edge;
1.94 -// typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/::OutEdgeIt InEdgeIt;
1.95 -// typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/::InEdgeIt OutEdgeIt;
1.96 +// typedef typename GraphWrapper/*typename GraphWrapper< TrivGraphWrapper<Graph> >*/::OutEdgeIt InEdgeIt;
1.97 +// typedef typename GraphWrapper/*typename GraphWrapper< TrivGraphWrapper<Graph> >*/::InEdgeIt OutEdgeIt;
1.98 // //typedef typename Graph::SymEdgeIt SymEdgeIt;
1.99 // //typedef typename Graph::EdgeIt EdgeIt;
1.100
1.101 // //RevGraphWrapper() : graph(0) { }
1.102 -// RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper<Graph> >*/(_gw/*TrivGraphWrapper<Graph>(_graph)*/) { }
1.103 +// RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapper< TrivGraphWrapper<Graph> >*/(_gw/*TrivGraphWrapper<Graph>(_graph)*/) { }
1.104
1.105 // //void setGraph(Graph& _graph) { graph = &_graph; }
1.106 // //Graph& getGraph() const { return (*graph); }
1.107 @@ -429,30 +429,30 @@
1.108 // //void clear() const { graph->clear(); }
1.109
1.110 // template<typename T> class NodeMap :
1.111 -// public GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>
1.112 +// public GraphWrapper/*< TrivGraphWrapper<Graph> >*/::NodeMap<T>
1.113 // {
1.114 // public:
1.115 // NodeMap(const RevGraphWrapper<GraphWrapper>& _gw) :
1.116 -// GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw) { }
1.117 +// GraphWrapper/*< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw) { }
1.118 // NodeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) :
1.119 -// GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw, a) { }
1.120 +// GraphWrapper/*< TrivGraphWrapper<Graph> >*/::NodeMap<T>(_gw, a) { }
1.121 // };
1.122
1.123 // template<typename T> class EdgeMap :
1.124 -// public GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T> {
1.125 +// public GraphWrapper/*< TrivGraphWrapper<Graph> >*/::EdgeMap<T> {
1.126 // public:
1.127 // EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw) :
1.128 -// GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw) { }
1.129 +// GraphWrapper/*< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw) { }
1.130 // EdgeMap(const RevGraphWrapper<GraphWrapper>& _gw, T a) :
1.131 -// GraphWrapper/*Skeleton< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw, a) { }
1.132 +// GraphWrapper/*< TrivGraphWrapper<Graph> >*/::EdgeMap<T>(_gw, a) { }
1.133 // };
1.134 // };
1.135
1.136 template<typename GraphWrapper>
1.137 - class RevGraphWrapper : public GraphWrapperSkeleton<GraphWrapper> {
1.138 + class RevGraphWrapper : public GraphWrapper<GraphWrapper> {
1.139 public:
1.140 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Node Node;
1.141 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Edge Edge;
1.142 + typedef typename GraphWrapper<GraphWrapper>::Node Node;
1.143 + typedef typename GraphWrapper<GraphWrapper>::Edge Edge;
1.144 //FIXME
1.145 //If GraphWrapper::OutEdgeIt is not defined
1.146 //and we do not want to use RevGraphWrapper::InEdgeIt,
1.147 @@ -461,33 +461,33 @@
1.148 //graphs have to define their non-existing iterators to void
1.149 //Unfortunately all the typedefs are instantiated in templates,
1.150 //unlike other stuff
1.151 - typedef typename GraphWrapperSkeleton<GraphWrapper>::OutEdgeIt InEdgeIt;
1.152 - typedef typename GraphWrapperSkeleton<GraphWrapper>::InEdgeIt OutEdgeIt;
1.153 + typedef typename GraphWrapper<GraphWrapper>::OutEdgeIt InEdgeIt;
1.154 + typedef typename GraphWrapper<GraphWrapper>::InEdgeIt OutEdgeIt;
1.155
1.156 RevGraphWrapper(GraphWrapper _gw) :
1.157 - GraphWrapperSkeleton<GraphWrapper>(_gw) { }
1.158 + GraphWrapper<GraphWrapper>(_gw) { }
1.159
1.160 Node head(const Edge& e) const
1.161 - { return GraphWrapperSkeleton<GraphWrapper>::tail(e); }
1.162 + { return GraphWrapper<GraphWrapper>::tail(e); }
1.163 Node tail(const Edge& e) const
1.164 - { return GraphWrapperSkeleton<GraphWrapper>::head(e); }
1.165 + { return GraphWrapper<GraphWrapper>::head(e); }
1.166 };
1.167
1.168 //Subgraph on the same node-set and partial edge-set
1.169 template<typename GraphWrapper, typename EdgeFilterMap>
1.170 - class SubGraphWrapper : public GraphWrapperSkeleton<GraphWrapper> {
1.171 + class SubGraphWrapper : public GraphWrapper<GraphWrapper> {
1.172 protected:
1.173 EdgeFilterMap* filter_map;
1.174 public:
1.175 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Node Node;
1.176 - typedef typename GraphWrapperSkeleton<GraphWrapper>::NodeIt NodeIt;
1.177 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Edge Edge;
1.178 - typedef typename GraphWrapperSkeleton<GraphWrapper>::EdgeIt EdgeIt;
1.179 - typedef typename GraphWrapperSkeleton<GraphWrapper>::InEdgeIt InEdgeIt;
1.180 - typedef typename GraphWrapperSkeleton<GraphWrapper>::OutEdgeIt OutEdgeIt;
1.181 + typedef typename GraphWrapper<GraphWrapper>::Node Node;
1.182 + typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt;
1.183 + typedef typename GraphWrapper<GraphWrapper>::Edge Edge;
1.184 + typedef typename GraphWrapper<GraphWrapper>::EdgeIt EdgeIt;
1.185 + typedef typename GraphWrapper<GraphWrapper>::InEdgeIt InEdgeIt;
1.186 + typedef typename GraphWrapper<GraphWrapper>::OutEdgeIt OutEdgeIt;
1.187
1.188 SubGraphWrapper(GraphWrapper _gw, EdgeFilterMap& _filter_map) :
1.189 - GraphWrapperSkeleton<GraphWrapper>(_gw), filter_map(&_filter_map) { }
1.190 + GraphWrapper<GraphWrapper>(_gw), filter_map(&_filter_map) { }
1.191
1.192 template<typename I> I& first(I& i) const {
1.193 gw.first(i);
1.194 @@ -677,30 +677,30 @@
1.195
1.196
1.197 template<typename GraphWrapper>
1.198 - class UndirGraphWrapper : public GraphWrapperSkeleton<GraphWrapper> {
1.199 + class UndirGraphWrapper : public GraphWrapper<GraphWrapper> {
1.200 protected:
1.201 // GraphWrapper gw;
1.202
1.203 public:
1.204 //typedef GraphWrapper BaseGraph;
1.205
1.206 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Node Node;
1.207 - typedef typename GraphWrapperSkeleton<GraphWrapper>::NodeIt NodeIt;
1.208 + typedef typename GraphWrapper<GraphWrapper>::Node Node;
1.209 + typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt;
1.210
1.211 //private:
1.212 //FIXME ezeknek valojaban a GraphWrapper megfelelo dolgai kellene hogy
1.213 //legyenek, at kell irni
1.214 - typedef typename /*GraphWrapperSkeleton<GraphWrapper>*/
1.215 + typedef typename /*GraphWrapper<GraphWrapper>*/
1.216 GraphWrapper::Edge GraphEdge;
1.217 - typedef typename /*GraphWrapperSkeleton<GraphWrapper>*/
1.218 + typedef typename /*GraphWrapper<GraphWrapper>*/
1.219 GraphWrapper::OutEdgeIt GraphOutEdgeIt;
1.220 - typedef typename /*GraphWrapperSkeleton<GraphWrapper>*/
1.221 + typedef typename /*GraphWrapper<GraphWrapper>*/
1.222 GraphWrapper::InEdgeIt GraphInEdgeIt;
1.223 //public:
1.224
1.225 //UndirGraphWrapper() : graph(0) { }
1.226 UndirGraphWrapper(GraphWrapper _gw) :
1.227 - GraphWrapperSkeleton<GraphWrapper>(_gw) { }
1.228 + GraphWrapper<GraphWrapper>(_gw) { }
1.229
1.230 //UndirGraphWrapper(GraphWrapper _gw) : gw(_gw) { }
1.231
1.232 @@ -864,10 +864,10 @@
1.233 // };
1.234
1.235 // template<typename T> class EdgeMap :
1.236 -// public GraphWrapperSkeleton<GraphWrapper>::EdgeMap<T> {
1.237 +// public GraphWrapper<GraphWrapper>::EdgeMap<T> {
1.238 // public:
1.239 // EdgeMap(const UndirGraphWrapper<GraphWrapper>& _G) :
1.240 -// GraphWrapperSkeleton<GraphWrapper>::EdgeMap<T>(_G.gw) { }
1.241 +// GraphWrapper<GraphWrapper>::EdgeMap<T>(_G.gw) { }
1.242 // EdgeMap(const UndirGraphWrapper<GraphWrapper>& _G, T a) :
1.243 // GraphWrapper::EdgeMap<T>(_G.gw, a) { }
1.244 // };
1.245 @@ -947,16 +947,16 @@
1.246
1.247
1.248 template<typename GraphWrapper, typename Number, typename FlowMap, typename CapacityMap>
1.249 - class ResGraphWrapper : public GraphWrapperSkeleton<GraphWrapper>{
1.250 + class ResGraphWrapper : public GraphWrapper<GraphWrapper>{
1.251 public:
1.252 //typedef Graph BaseGraph;
1.253 //typedef TrivGraphWrapper<const Graph> GraphWrapper;
1.254 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Node Node;
1.255 - typedef typename GraphWrapperSkeleton<GraphWrapper>::NodeIt NodeIt;
1.256 + typedef typename GraphWrapper<GraphWrapper>::Node Node;
1.257 + typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt;
1.258 private:
1.259 - typedef typename /*GraphWrapperSkeleton<GraphWrapper>*/
1.260 + typedef typename /*GraphWrapper<GraphWrapper>*/
1.261 GraphWrapper::OutEdgeIt OldOutEdgeIt;
1.262 - typedef typename /*GraphWrapperSkeleton<GraphWrapper>*/
1.263 + typedef typename /*GraphWrapper<GraphWrapper>*/
1.264 GraphWrapper::InEdgeIt OldInEdgeIt;
1.265 protected:
1.266 //const Graph* graph;
1.267 @@ -967,7 +967,7 @@
1.268
1.269 ResGraphWrapper(const GraphWrapper& _gw, FlowMap& _flow,
1.270 const CapacityMap& _capacity) :
1.271 - GraphWrapperSkeleton<GraphWrapper>(_gw),
1.272 + GraphWrapper<GraphWrapper>(_gw),
1.273 flow(&_flow), capacity(&_capacity) { }
1.274
1.275 //void setGraph(const Graph& _graph) { graph = &_graph; }
1.276 @@ -1264,19 +1264,19 @@
1.277
1.278 //Subgraph on the same node-set and partial edge-set
1.279 template<typename GraphWrapper, typename FirstOutEdgesMap>
1.280 - class ErasingFirstGraphWrapper : public GraphWrapperSkeleton<GraphWrapper> {
1.281 + class ErasingFirstGraphWrapper : public GraphWrapper<GraphWrapper> {
1.282 protected:
1.283 FirstOutEdgesMap* first_out_edges;
1.284 public:
1.285 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Node Node;
1.286 - typedef typename GraphWrapperSkeleton<GraphWrapper>::NodeIt NodeIt;
1.287 - typedef typename GraphWrapperSkeleton<GraphWrapper>::Edge Edge;
1.288 - typedef typename GraphWrapperSkeleton<GraphWrapper>::EdgeIt EdgeIt;
1.289 - typedef typename GraphWrapperSkeleton<GraphWrapper>::InEdgeIt InEdgeIt;
1.290 - typedef typename GraphWrapperSkeleton<GraphWrapper>::OutEdgeIt OutEdgeIt;
1.291 + typedef typename GraphWrapper<GraphWrapper>::Node Node;
1.292 + typedef typename GraphWrapper<GraphWrapper>::NodeIt NodeIt;
1.293 + typedef typename GraphWrapper<GraphWrapper>::Edge Edge;
1.294 + typedef typename GraphWrapper<GraphWrapper>::EdgeIt EdgeIt;
1.295 + typedef typename GraphWrapper<GraphWrapper>::InEdgeIt InEdgeIt;
1.296 + typedef typename GraphWrapper<GraphWrapper>::OutEdgeIt OutEdgeIt;
1.297
1.298 ErasingFirstGraphWrapper(GraphWrapper _gw, FirstOutEdgesMap& _first_out_edges) :
1.299 - GraphWrapperSkeleton<GraphWrapper>(_gw), first_out_edges(&_first_out_edges) { }
1.300 + GraphWrapper<GraphWrapper>(_gw), first_out_edges(&_first_out_edges) { }
1.301
1.302 template<typename I> I& first(I& i) const {
1.303 gw.first(i);