# HG changeset patch # User marci # Date 1079975108 0 # Node ID aa50acc936dc97e7ba674c2f3276874a7509471d # Parent 348f8fd374ee738a36380e6a0885c383c9c6e5a2 . diff -r 348f8fd374ee -r aa50acc936dc src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Mon Mar 22 16:37:10 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Mon Mar 22 17:05:08 2004 +0000 @@ -240,88 +240,99 @@ // }; // }; - template*/ > - class RevGraphWrapper : - public GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper >*/ { - protected: - //Graph* graph; +// template*/ > +// class RevGraphWrapper : +// public GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper >*/ { +// protected: +// //Graph* graph; +// public: +// //typedef Graph BaseGraph; + +// //typedef typename Graph::Node Node; +// //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 Graph::SymEdgeIt SymEdgeIt; +// //typedef typename Graph::EdgeIt EdgeIt; + +// //RevGraphWrapper() : graph(0) { } +// RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper >*/(_gw/*TrivGraphWrapper(_graph)*/) { } + +// //void setGraph(Graph& _graph) { graph = &_graph; } +// //Graph& getGraph() const { return (*graph); } + +// //template I& first(I& i) const { return graph->first(i); } +// //template I& first(I& i, const P& p) const { +// // return graph->first(i, p); } + +// //template I getNext(const I& i) const { +// // return graph->getNext(i); } +// //template I& next(I &i) const { return graph->next(i); } + +// //template< typename It > It first() const { +// // It e; first(e); return e; } + +// //template< typename It > It first(const Node& v) const { +// // It e; first(e, v); return e; } + +// //Node head(const Edge& e) const { return graph->tail(e); } +// //Node tail(const Edge& e) const { return graph->head(e); } + +// //template bool valid(const I& i) const +// // { return graph->valid(i); } + +// //template void setInvalid(const I &i); +// //{ return graph->setInvalid(i); } + +// //template Node aNode(const I& e) const { +// // return graph->aNode(e); } +// //template Node bNode(const I& e) const { +// // return graph->bNode(e); } + +// //Node addNode() const { return graph->addNode(); } +// //Edge addEdge(const Node& tail, const Node& head) const { +// // return graph->addEdge(tail, head); } + +// //int nodeNum() const { return graph->nodeNum(); } +// //int edgeNum() const { return graph->edgeNum(); } + +// //template void erase(const I& i) const { graph->erase(i); } + +// //void clear() const { graph->clear(); } + +// template class NodeMap : +// public GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap +// { +// public: +// NodeMap(const RevGraphWrapper& _gw) : +// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap(_gw) { } +// NodeMap(const RevGraphWrapper& _gw, T a) : +// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap(_gw, a) { } +// }; + +// template class EdgeMap : +// public GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap { +// public: +// EdgeMap(const RevGraphWrapper& _gw) : +// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap(_gw) { } +// EdgeMap(const RevGraphWrapper& _gw, T a) : +// GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap(_gw, a) { } +// }; +// }; + + + template + class RevGraphWrapper : public GraphWrapperSkeleton { public: - //typedef Graph BaseGraph; - - //typedef typename Graph::Node Node; - //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 Graph::SymEdgeIt SymEdgeIt; - //typedef typename Graph::EdgeIt EdgeIt; - - //RevGraphWrapper() : graph(0) { } - RevGraphWrapper(GraphWrapper _gw/*BaseGraph& _graph*/) : GraphWrapper/*GraphWrapperSkeleton< TrivGraphWrapper >*/(_gw/*TrivGraphWrapper(_graph)*/) { } + typedef typename GraphWrapperSkeleton::OutEdgeIt InEdgeIt; + typedef typename GraphWrapperSkeleton::InEdgeIt OutEdgeIt; - //void setGraph(Graph& _graph) { graph = &_graph; } - //Graph& getGraph() const { return (*graph); } - - //template I& first(I& i) const { return graph->first(i); } - //template I& first(I& i, const P& p) const { - // return graph->first(i, p); } - - //template I getNext(const I& i) const { - // return graph->getNext(i); } - //template I& next(I &i) const { return graph->next(i); } - - //template< typename It > It first() const { - // It e; first(e); return e; } - - //template< typename It > It first(const Node& v) const { - // It e; first(e, v); return e; } - - //Node head(const Edge& e) const { return graph->tail(e); } - //Node tail(const Edge& e) const { return graph->head(e); } - - //template bool valid(const I& i) const - // { return graph->valid(i); } - - //template void setInvalid(const I &i); - //{ return graph->setInvalid(i); } - - //template Node aNode(const I& e) const { - // return graph->aNode(e); } - //template Node bNode(const I& e) const { - // return graph->bNode(e); } - - //Node addNode() const { return graph->addNode(); } - //Edge addEdge(const Node& tail, const Node& head) const { - // return graph->addEdge(tail, head); } - - //int nodeNum() const { return graph->nodeNum(); } - //int edgeNum() const { return graph->edgeNum(); } - - //template void erase(const I& i) const { graph->erase(i); } - - //void clear() const { graph->clear(); } - - template class NodeMap : - public GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap - { - public: - NodeMap(const RevGraphWrapper& _gw) : - GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap(_gw) { } - NodeMap(const RevGraphWrapper& _gw, T a) : - GraphWrapper/*Skeleton< TrivGraphWrapper >*/::NodeMap(_gw, a) { } - }; - - template class EdgeMap : - public GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap { - public: - EdgeMap(const RevGraphWrapper& _gw) : - GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap(_gw) { } - EdgeMap(const RevGraphWrapper& _gw, T a) : - GraphWrapper/*Skeleton< TrivGraphWrapper >*/::EdgeMap(_gw, a) { } - }; + RevGraphWrapper(GraphWrapper _gw) : + GraphWrapperSkeleton(_gw) { } };