# HG changeset patch # User marci # Date 1081941972 0 # Node ID 7bec4e8fb7dd1fda553cc9cd5ca02ea4e04baabd # Parent 6e6db1c49bc133622bb9a57ad3a7c706fdff8a45 gw diff -r 6e6db1c49bc1 -r 7bec4e8fb7dd src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Tue Apr 13 20:35:47 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Wed Apr 14 11:26:12 2004 +0000 @@ -38,26 +38,6 @@ NodeIt(const GraphWrapper& _G) : n(*(_G.graph)) { } operator Node() const { return Node(typename Graph::Node(n)); } }; -// class Node : public Graph::Node { -// public: -// Node() { } -// Node(const typename Graph::Node& n) : Graph::Node(n) { } -// Node(const Invalid& i) : Graph::Node(i) { } -// }; -// class NodeIt : public Graph::NodeIt { -// typedef typename Graph::NodeIt GraphNodeIt; -// public: -// NodeIt() { } -// NodeIt(const typename Graph::NodeIt& n) : Graph::NodeIt(n) { } -// NodeIt(const Invalid& i) : Graph::NodeIt(i) { } -// NodeIt(const GraphWrapper& _G) : -// Graph::NodeIt(*(_G.graph)) { } -// operator Node() const { -// return Node(typename Graph::Node( -// static_cast(*this) -// )); -// } -// }; // typedef typename Graph::Edge Edge; class Edge : public Graph::Edge { friend class GraphWrapper; @@ -124,9 +104,6 @@ // return i; // } -// template I getNext(const I& i) const { -// return gw.getNext(i); } - NodeIt& next(NodeIt& i) const { graph->next(i.n); return i; } OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; } InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; } @@ -142,7 +119,6 @@ return Node(graph->head(static_cast(e))); } Node tail(const Edge& e) const { return Node(graph->tail(static_cast(e))); } -// Node tail(const OutEdgeIt& e) const { return graph->tail(Edge(e)); } bool valid(const Node& n) const { return graph->valid(static_cast(n)); } @@ -182,9 +158,6 @@ Graph::NodeMap(*(_G.graph)) { } NodeMap(const GraphWrapper& _G, T a) : Graph::NodeMap(*(_G.graph), a) { } -// T operator[](const Node& n) const { -// return Graph::NodeMap::operator[](n); -// } }; template class EdgeMap : public Graph::EdgeMap { @@ -225,8 +198,6 @@ // 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 { @@ -497,9 +468,6 @@ Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); } Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); } - //template I getNext(const I& i) const { - // return gw.getNext(i); - //} // template I& next(I &i) const { // graph->next(i); // // while (graph->valid(i) && !filter_map-get(i)) { graph->next(i); } @@ -638,9 +606,6 @@ // return i; // } -// //template I getNext(const I& i) const { -// // return gw.getNext(i); -// //} // // template I& next(I &i) const { // // graph->next(i); // // // while (graph->valid(i) && !filter_map-get(i)) { graph->next(i); } @@ -655,166 +620,6 @@ // It e; this->first(e, v); return e; } // }; -// template -// class UndirGraphWrapper { -// protected: -// //Graph* graph; -// GraphWrapper gw; - -// public: -// typedef GraphWrapper ParentGraph; - -// typedef typename GraphWrapper::Node Node; -// typedef typename GraphWrapper::NodeIt NodeIt; - -// //typedef typename Graph::Edge Edge; -// //typedef typename Graph::OutEdgeIt OutEdgeIt; -// //typedef typename Graph::InEdgeIt InEdgeIt; -// //typedef typename Graph::SymEdgeIt SymEdgeIt; -// //typedef typename Graph::EdgeIt EdgeIt; - -// //private: -// typedef typename GraphWrapper::Edge GraphEdge; -// typedef typename GraphWrapper::OutEdgeIt GraphOutEdgeIt; -// typedef typename GraphWrapper::InEdgeIt GraphInEdgeIt; -// //public: - -// //UndirGraphWrapper() : graph(0) { } -// UndirGraphWrapper(GraphWrapper _gw) : gw(_gw) { } - -// //void setGraph(Graph& _graph) { graph = &_graph; } -// //Graph& getGraph() const { return (*graph); } - -// class Edge { -// friend class UndirGraphWrapper; -// bool out_or_in; //true iff out -// GraphOutEdgeIt out; -// GraphInEdgeIt in; -// public: -// Edge() : out_or_in(), out(), in() { } -// Edge(const Invalid& i) : out_or_in(false), out(), in(i) { } -// operator GraphEdge() const { -// if (out_or_in) return(out); else return(in); -// } -// friend bool operator==(const Edge& u, const Edge& v) { -// if (v.out_or_in) -// return (u.out_or_in && u.out==v.out); -// else -// return (!u.out_or_in && u.in==v.in); -// } -// friend bool operator!=(const Edge& u, const Edge& v) { -// if (v.out_or_in) -// return (!u.out_or_in || u.out!=v.out); -// else -// return (u.out_or_in || u.in!=v.in); -// } -// }; - -// class OutEdgeIt : public Edge { -// friend class UndirGraphWrapper; -// public: -// OutEdgeIt() : Edge() { } -// OutEdgeIt(const Invalid& i) : Edge(i) { } -// OutEdgeIt(const UndirGraphWrapper& _G, const Node& n) -// : Edge() { -// out_or_in=true; -// _G.gw.first(out, n); -// if (!(_G.gw.valid(out))) { -// out_or_in=false; -// _G.gw.first(in, n); -// } -// } -// }; - -// OutEdgeIt& first(OutEdgeIt& e, const Node& n) const { -// e.out_or_in=true; -// gw.first(e.out, n); -// if (!(gw.valid(e.out))) { -// e.out_or_in=false; -// gw.first(e.in, n); -// } -// return e; -// } - -// OutEdgeIt& next(OutEdgeIt& e) const { -// if (e.out_or_in) { -// Node n=gw.tail(e.out); -// gw.next(e.out); -// if (!gw.valid(e.out)) { -// e.out_or_in=false; -// gw.first(e.in, n); -// } -// } else { -// gw.next(e.in); -// } -// return e; -// } - -// Node aNode(const OutEdgeIt& e) const { -// if (e.out_or_in) return gw.tail(e); else return gw.head(e); } -// Node bNode(const OutEdgeIt& e) const { -// if (e.out_or_in) return gw.head(e); else return gw.tail(e); } - -// typedef OutEdgeIt InEdgeIt; - -// template I& first(I& i) const { return gw.first(i); } -// // template I& first(I& i, const P& p) const { -// // return graph->first(i, p); } - -// template I getNext(const I& i) const { -// return gw.getNext(i); } -// template I& next(I &i) const { return gw.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 gw.head(e); } -// Node tail(const Edge& e) const { return gw.tail(e); } - -// template bool valid(const I& i) const -// { return gw.valid(i); } - -// //template void setInvalid(const I &i); -// //{ return graph->setInvalid(i); } - -// int nodeNum() const { return gw.nodeNum(); } -// int edgeNum() const { return gw.edgeNum(); } - -// // 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 gw.addNode(); } -// // FIXME: ez igy nem jo, mert nem -// // Edge addEdge(const Node& tail, const Node& head) const { -// // return graph->addEdge(tail, head); } - -// template void erase(const I& i) const { gw.erase(i); } - -// void clear() const { gw.clear(); } - -// template class NodeMap : public GraphWrapper::NodeMap { -// public: -// NodeMap(const UndirGraphWrapper& _G) : -// GraphWrapper::NodeMap(_G.gw) { } -// NodeMap(const UndirGraphWrapper& _G, T a) : -// GraphWrapper::NodeMap(_G.gw, a) { } -// }; - -// template class EdgeMap : public GraphWrapper::EdgeMap { -// public: -// EdgeMap(const UndirGraphWrapper& _G) : -// GraphWrapper::EdgeMap(_G.gw) { } -// EdgeMap(const UndirGraphWrapper& _G, T a) : -// GraphWrapper::EdgeMap(_G.gw, a) { } -// }; -// }; - - template class UndirGraphWrapper : public GraphWrapper { // protected: @@ -955,8 +760,6 @@ } // template I& next(I &i) const { graph->next(i); return i; } -// template I getNext(const I& i) const { return gw.getNext(i); } - template< typename It > It first() const { It e; this->first(e); return e; } @@ -1973,11 +1776,6 @@ // return i; // } - //template I getNext(const I& i) const { - // return gw.getNext(i); - //} - - NodeIt& next(NodeIt& i) const { graph->next(i.n); return i; } OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; } InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; } @@ -2086,11 +1884,6 @@ // // return i; // // } -// //template I getNext(const I& i) const { -// // return gw.getNext(i); -// //} - - // NodeIt& next(NodeIt& i) const { // graph->next(i); // return i;