diff -r 5e284075b193 -r 9d0bfd35b97c src/work/marci/experiment/graph_wrapper.h --- a/src/work/marci/experiment/graph_wrapper.h Fri Sep 17 15:11:39 2004 +0000 +++ b/src/work/marci/experiment/graph_wrapper.h Fri Sep 17 15:51:50 2004 +0000 @@ -161,7 +161,7 @@ }; template - class GraphWrapperSkeleton { + class GraphWrapper { protected: GraphWrapper gw; @@ -184,7 +184,7 @@ NodeIt(const typename GraphWrapper::NodeIt& n) : GraphWrapper::NodeIt(n) { } NodeIt(const Invalid& i) : GraphWrapper::NodeIt(i) { } - NodeIt(const GraphWrapperSkeleton& _G) : + NodeIt(const GraphWrapper& _G) : GraphWrapper::NodeIt(_G.gw) { } }; typedef typename GraphWrapper::Edge Edge; @@ -195,7 +195,7 @@ OutEdgeIt(const typename GraphWrapper::OutEdgeIt& e) : GraphWrapper::OutEdgeIt(e) { } OutEdgeIt(const Invalid& i) : GraphWrapper::OutEdgeIt(i) { } - OutEdgeIt(const GraphWrapperSkeleton& _G, const Node& n) : + OutEdgeIt(const GraphWrapper& _G, const Node& n) : GraphWrapper::OutEdgeIt(_G.gw, n) { } }; //typedef typename GraphWrapper::InEdgeIt InEdgeIt; @@ -205,7 +205,7 @@ InEdgeIt(const typename GraphWrapper::InEdgeIt& e) : GraphWrapper::InEdgeIt(e) { } InEdgeIt(const Invalid& i) : GraphWrapper::InEdgeIt(i) { } - InEdgeIt(const GraphWrapperSkeleton& _G, const Node& n) : + InEdgeIt(const GraphWrapper& _G, const Node& n) : GraphWrapper::InEdgeIt(_G.gw, n) { } }; //typedef typename GraphWrapper::SymEdgeIt SymEdgeIt; @@ -216,13 +216,13 @@ EdgeIt(const typename GraphWrapper::EdgeIt& e) : GraphWrapper::EdgeIt(e) { } EdgeIt(const Invalid& i) : GraphWrapper::EdgeIt(i) { } - EdgeIt(const GraphWrapperSkeleton& _G) : + EdgeIt(const GraphWrapper& _G) : GraphWrapper::EdgeIt(_G.gw) { } }; - //GraphWrapperSkeleton() : gw() { } - GraphWrapperSkeleton(GraphWrapper _gw) : gw(_gw) { } + //GraphWrapper() : gw() { } + GraphWrapper(GraphWrapper _gw) : gw(_gw) { } //void setGraph(BaseGraph& _graph) { gw.setGraph(_graph); } //BaseGraph& getGraph() const { return gw.getGraph(); } @@ -269,17 +269,17 @@ template class NodeMap : public GraphWrapper::NodeMap { public: - NodeMap(const GraphWrapperSkeleton& _G) : + NodeMap(const GraphWrapper& _G) : GraphWrapper::NodeMap(_G.gw) { } - NodeMap(const GraphWrapperSkeleton& _G, T a) : + NodeMap(const GraphWrapper& _G, T a) : GraphWrapper::NodeMap(_G.gw, a) { } }; template class EdgeMap : public GraphWrapper::EdgeMap { public: - EdgeMap(const GraphWrapperSkeleton& _G) : + EdgeMap(const GraphWrapper& _G) : GraphWrapper::EdgeMap(_G.gw) { } - EdgeMap(const GraphWrapperSkeleton& _G, T a) : + EdgeMap(const GraphWrapper& _G, T a) : GraphWrapper::EdgeMap(_G.gw, a) { } }; }; @@ -365,9 +365,9 @@ // }; // template*/ > +// /*=typename GraphWrapper< TrivGraphWrapper*/ > // class RevGraphWrapper : -// public GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper >*/ { +// public GraphWrapper/*GraphWrapper< TrivGraphWrapper >*/ { // protected: // //Graph* graph; @@ -378,13 +378,13 @@ // //typedef typename Graph::NodeIt NodeIt; // //typedef typename Graph::Edge Edge; -// typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper >*/::OutEdgeIt InEdgeIt; -// typedef typename GraphWrapper/*typename GraphWrapperSkeleton< TrivGraphWrapper >*/::InEdgeIt OutEdgeIt; +// typedef typename GraphWrapper/*typename GraphWrapper< TrivGraphWrapper >*/::OutEdgeIt InEdgeIt; +// typedef typename GraphWrapper/*typename GraphWrapper< TrivGraphWrapper >*/::InEdgeIt OutEdgeIt; // //typedef typename Graph::SymEdgeIt SymEdgeIt; // //typedef typename Graph::EdgeIt EdgeIt; // //RevGraphWrapper() : graph(0) { } -// RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper >*/(_gw/*TrivGraphWrapper(_graph)*/) { } +// RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapper< TrivGraphWrapper >*/(_gw/*TrivGraphWrapper(_graph)*/) { } // //void setGraph(Graph& _graph) { graph = &_graph; } // //Graph& getGraph() const { return (*graph); } @@ -429,30 +429,30 @@ // //void clear() const { graph->clear(); } // template class NodeMap : -// public GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap +// public GraphWrapper/*< TrivGraphWrapper >*/::NodeMap // { // public: // NodeMap(const RevGraphWrapper& _gw) : -// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap(_gw) { } +// GraphWrapper/*< TrivGraphWrapper >*/::NodeMap(_gw) { } // NodeMap(const RevGraphWrapper& _gw, T a) : -// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap(_gw, a) { } +// GraphWrapper/*< TrivGraphWrapper >*/::NodeMap(_gw, a) { } // }; // template class EdgeMap : -// public GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap { +// public GraphWrapper/*< TrivGraphWrapper >*/::EdgeMap { // public: // EdgeMap(const RevGraphWrapper& _gw) : -// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap(_gw) { } +// GraphWrapper/*< TrivGraphWrapper >*/::EdgeMap(_gw) { } // EdgeMap(const RevGraphWrapper& _gw, T a) : -// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap(_gw, a) { } +// GraphWrapper/*< TrivGraphWrapper >*/::EdgeMap(_gw, a) { } // }; // }; template - class RevGraphWrapper : public GraphWrapperSkeleton { + class RevGraphWrapper : public GraphWrapper { public: - typedef typename GraphWrapperSkeleton::Node Node; - typedef typename GraphWrapperSkeleton::Edge Edge; + typedef typename GraphWrapper::Node Node; + typedef typename GraphWrapper::Edge Edge; //FIXME //If GraphWrapper::OutEdgeIt is not defined //and we do not want to use RevGraphWrapper::InEdgeIt, @@ -461,33 +461,33 @@ //graphs have to define their non-existing iterators to void //Unfortunately all the typedefs are instantiated in templates, //unlike other stuff - typedef typename GraphWrapperSkeleton::OutEdgeIt InEdgeIt; - typedef typename GraphWrapperSkeleton::InEdgeIt OutEdgeIt; + typedef typename GraphWrapper::OutEdgeIt InEdgeIt; + typedef typename GraphWrapper::InEdgeIt OutEdgeIt; RevGraphWrapper(GraphWrapper _gw) : - GraphWrapperSkeleton(_gw) { } + GraphWrapper(_gw) { } Node head(const Edge& e) const - { return GraphWrapperSkeleton::tail(e); } + { return GraphWrapper::tail(e); } Node tail(const Edge& e) const - { return GraphWrapperSkeleton::head(e); } + { return GraphWrapper::head(e); } }; //Subgraph on the same node-set and partial edge-set template - class SubGraphWrapper : public GraphWrapperSkeleton { + class SubGraphWrapper : public GraphWrapper { protected: EdgeFilterMap* filter_map; public: - typedef typename GraphWrapperSkeleton::Node Node; - typedef typename GraphWrapperSkeleton::NodeIt NodeIt; - typedef typename GraphWrapperSkeleton::Edge Edge; - typedef typename GraphWrapperSkeleton::EdgeIt EdgeIt; - typedef typename GraphWrapperSkeleton::InEdgeIt InEdgeIt; - typedef typename GraphWrapperSkeleton::OutEdgeIt OutEdgeIt; + typedef typename GraphWrapper::Node Node; + typedef typename GraphWrapper::NodeIt NodeIt; + typedef typename GraphWrapper::Edge Edge; + typedef typename GraphWrapper::EdgeIt EdgeIt; + typedef typename GraphWrapper::InEdgeIt InEdgeIt; + typedef typename GraphWrapper::OutEdgeIt OutEdgeIt; SubGraphWrapper(GraphWrapper _gw, EdgeFilterMap& _filter_map) : - GraphWrapperSkeleton(_gw), filter_map(&_filter_map) { } + GraphWrapper(_gw), filter_map(&_filter_map) { } template I& first(I& i) const { gw.first(i); @@ -677,30 +677,30 @@ template - class UndirGraphWrapper : public GraphWrapperSkeleton { + class UndirGraphWrapper : public GraphWrapper { protected: // GraphWrapper gw; public: //typedef GraphWrapper BaseGraph; - typedef typename GraphWrapperSkeleton::Node Node; - typedef typename GraphWrapperSkeleton::NodeIt NodeIt; + typedef typename GraphWrapper::Node Node; + typedef typename GraphWrapper::NodeIt NodeIt; //private: //FIXME ezeknek valojaban a GraphWrapper megfelelo dolgai kellene hogy //legyenek, at kell irni - typedef typename /*GraphWrapperSkeleton*/ + typedef typename /*GraphWrapper*/ GraphWrapper::Edge GraphEdge; - typedef typename /*GraphWrapperSkeleton*/ + typedef typename /*GraphWrapper*/ GraphWrapper::OutEdgeIt GraphOutEdgeIt; - typedef typename /*GraphWrapperSkeleton*/ + typedef typename /*GraphWrapper*/ GraphWrapper::InEdgeIt GraphInEdgeIt; //public: //UndirGraphWrapper() : graph(0) { } UndirGraphWrapper(GraphWrapper _gw) : - GraphWrapperSkeleton(_gw) { } + GraphWrapper(_gw) { } //UndirGraphWrapper(GraphWrapper _gw) : gw(_gw) { } @@ -864,10 +864,10 @@ // }; // template class EdgeMap : -// public GraphWrapperSkeleton::EdgeMap { +// public GraphWrapper::EdgeMap { // public: // EdgeMap(const UndirGraphWrapper& _G) : -// GraphWrapperSkeleton::EdgeMap(_G.gw) { } +// GraphWrapper::EdgeMap(_G.gw) { } // EdgeMap(const UndirGraphWrapper& _G, T a) : // GraphWrapper::EdgeMap(_G.gw, a) { } // }; @@ -947,16 +947,16 @@ template - class ResGraphWrapper : public GraphWrapperSkeleton{ + class ResGraphWrapper : public GraphWrapper{ public: //typedef Graph BaseGraph; //typedef TrivGraphWrapper GraphWrapper; - typedef typename GraphWrapperSkeleton::Node Node; - typedef typename GraphWrapperSkeleton::NodeIt NodeIt; + typedef typename GraphWrapper::Node Node; + typedef typename GraphWrapper::NodeIt NodeIt; private: - typedef typename /*GraphWrapperSkeleton*/ + typedef typename /*GraphWrapper*/ GraphWrapper::OutEdgeIt OldOutEdgeIt; - typedef typename /*GraphWrapperSkeleton*/ + typedef typename /*GraphWrapper*/ GraphWrapper::InEdgeIt OldInEdgeIt; protected: //const Graph* graph; @@ -967,7 +967,7 @@ ResGraphWrapper(const GraphWrapper& _gw, FlowMap& _flow, const CapacityMap& _capacity) : - GraphWrapperSkeleton(_gw), + GraphWrapper(_gw), flow(&_flow), capacity(&_capacity) { } //void setGraph(const Graph& _graph) { graph = &_graph; } @@ -1264,19 +1264,19 @@ //Subgraph on the same node-set and partial edge-set template - class ErasingFirstGraphWrapper : public GraphWrapperSkeleton { + class ErasingFirstGraphWrapper : public GraphWrapper { protected: FirstOutEdgesMap* first_out_edges; public: - typedef typename GraphWrapperSkeleton::Node Node; - typedef typename GraphWrapperSkeleton::NodeIt NodeIt; - typedef typename GraphWrapperSkeleton::Edge Edge; - typedef typename GraphWrapperSkeleton::EdgeIt EdgeIt; - typedef typename GraphWrapperSkeleton::InEdgeIt InEdgeIt; - typedef typename GraphWrapperSkeleton::OutEdgeIt OutEdgeIt; + typedef typename GraphWrapper::Node Node; + typedef typename GraphWrapper::NodeIt NodeIt; + typedef typename GraphWrapper::Edge Edge; + typedef typename GraphWrapper::EdgeIt EdgeIt; + typedef typename GraphWrapper::InEdgeIt InEdgeIt; + typedef typename GraphWrapper::OutEdgeIt OutEdgeIt; ErasingFirstGraphWrapper(GraphWrapper _gw, FirstOutEdgesMap& _first_out_edges) : - GraphWrapperSkeleton(_gw), first_out_edges(&_first_out_edges) { } + GraphWrapper(_gw), first_out_edges(&_first_out_edges) { } template I& first(I& i) const { gw.first(i);