1.1 --- a/src/work/marci/graph_wrapper.h Tue Apr 13 20:35:47 2004 +0000
1.2 +++ b/src/work/marci/graph_wrapper.h Wed Apr 14 11:26:12 2004 +0000
1.3 @@ -38,26 +38,6 @@
1.4 NodeIt(const GraphWrapper<Graph>& _G) : n(*(_G.graph)) { }
1.5 operator Node() const { return Node(typename Graph::Node(n)); }
1.6 };
1.7 -// class Node : public Graph::Node {
1.8 -// public:
1.9 -// Node() { }
1.10 -// Node(const typename Graph::Node& n) : Graph::Node(n) { }
1.11 -// Node(const Invalid& i) : Graph::Node(i) { }
1.12 -// };
1.13 -// class NodeIt : public Graph::NodeIt {
1.14 -// typedef typename Graph::NodeIt GraphNodeIt;
1.15 -// public:
1.16 -// NodeIt() { }
1.17 -// NodeIt(const typename Graph::NodeIt& n) : Graph::NodeIt(n) { }
1.18 -// NodeIt(const Invalid& i) : Graph::NodeIt(i) { }
1.19 -// NodeIt(const GraphWrapper<Graph>& _G) :
1.20 -// Graph::NodeIt(*(_G.graph)) { }
1.21 -// operator Node() const {
1.22 -// return Node(typename Graph::Node(
1.23 -// static_cast<typename Graph::NodeIt>(*this)
1.24 -// ));
1.25 -// }
1.26 -// };
1.27 // typedef typename Graph::Edge Edge;
1.28 class Edge : public Graph::Edge {
1.29 friend class GraphWrapper<Graph>;
1.30 @@ -124,9 +104,6 @@
1.31 // return i;
1.32 // }
1.33
1.34 -// template<typename I> I getNext(const I& i) const {
1.35 -// return gw.getNext(i); }
1.36 -
1.37 NodeIt& next(NodeIt& i) const { graph->next(i.n); return i; }
1.38 OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
1.39 InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
1.40 @@ -142,7 +119,6 @@
1.41 return Node(graph->head(static_cast<typename Graph::Edge>(e))); }
1.42 Node tail(const Edge& e) const {
1.43 return Node(graph->tail(static_cast<typename Graph::Edge>(e))); }
1.44 -// Node tail(const OutEdgeIt& e) const { return graph->tail(Edge(e)); }
1.45
1.46 bool valid(const Node& n) const {
1.47 return graph->valid(static_cast<typename Graph::Node>(n)); }
1.48 @@ -182,9 +158,6 @@
1.49 Graph::NodeMap<T>(*(_G.graph)) { }
1.50 NodeMap(const GraphWrapper<Graph>& _G, T a) :
1.51 Graph::NodeMap<T>(*(_G.graph), a) { }
1.52 -// T operator[](const Node& n) const {
1.53 -// return Graph::NodeMap<T>::operator[](n);
1.54 -// }
1.55 };
1.56
1.57 template<typename T> class EdgeMap : public Graph::EdgeMap<T> {
1.58 @@ -225,8 +198,6 @@
1.59 // template<typename I, typename P> I& first(I& i, const P& p) const {
1.60 // return graph->first(i, p); }
1.61
1.62 -// template<typename I> I getNext(const I& i) const {
1.63 -// return graph->getNext(i); }
1.64 // template<typename I> I& next(I &i) const { return graph->next(i); }
1.65
1.66 // template< typename It > It first() const {
1.67 @@ -497,9 +468,6 @@
1.68 Node bNode(const OutEdgeIt& e) const { return Node(graph->bNode(e.e)); }
1.69 Node bNode(const InEdgeIt& e) const { return Node(graph->bNode(e.e)); }
1.70
1.71 - //template<typename I> I getNext(const I& i) const {
1.72 - // return gw.getNext(i);
1.73 - //}
1.74 // template<typename I> I& next(I &i) const {
1.75 // graph->next(i);
1.76 // // while (graph->valid(i) && !filter_map-get(i)) { graph->next(i); }
1.77 @@ -638,9 +606,6 @@
1.78 // return i;
1.79 // }
1.80
1.81 -// //template<typename I> I getNext(const I& i) const {
1.82 -// // return gw.getNext(i);
1.83 -// //}
1.84 // // template<typename I> I& next(I &i) const {
1.85 // // graph->next(i);
1.86 // // // while (graph->valid(i) && !filter_map-get(i)) { graph->next(i); }
1.87 @@ -655,166 +620,6 @@
1.88 // It e; this->first(e, v); return e; }
1.89 // };
1.90
1.91 -// template<typename GraphWrapper>
1.92 -// class UndirGraphWrapper {
1.93 -// protected:
1.94 -// //Graph* graph;
1.95 -// GraphWrapper gw;
1.96 -
1.97 -// public:
1.98 -// typedef GraphWrapper ParentGraph;
1.99 -
1.100 -// typedef typename GraphWrapper::Node Node;
1.101 -// typedef typename GraphWrapper::NodeIt NodeIt;
1.102 -
1.103 -// //typedef typename Graph::Edge Edge;
1.104 -// //typedef typename Graph::OutEdgeIt OutEdgeIt;
1.105 -// //typedef typename Graph::InEdgeIt InEdgeIt;
1.106 -// //typedef typename Graph::SymEdgeIt SymEdgeIt;
1.107 -// //typedef typename Graph::EdgeIt EdgeIt;
1.108 -
1.109 -// //private:
1.110 -// typedef typename GraphWrapper::Edge GraphEdge;
1.111 -// typedef typename GraphWrapper::OutEdgeIt GraphOutEdgeIt;
1.112 -// typedef typename GraphWrapper::InEdgeIt GraphInEdgeIt;
1.113 -// //public:
1.114 -
1.115 -// //UndirGraphWrapper() : graph(0) { }
1.116 -// UndirGraphWrapper(GraphWrapper _gw) : gw(_gw) { }
1.117 -
1.118 -// //void setGraph(Graph& _graph) { graph = &_graph; }
1.119 -// //Graph& getGraph() const { return (*graph); }
1.120 -
1.121 -// class Edge {
1.122 -// friend class UndirGraphWrapper<GraphWrapper>;
1.123 -// bool out_or_in; //true iff out
1.124 -// GraphOutEdgeIt out;
1.125 -// GraphInEdgeIt in;
1.126 -// public:
1.127 -// Edge() : out_or_in(), out(), in() { }
1.128 -// Edge(const Invalid& i) : out_or_in(false), out(), in(i) { }
1.129 -// operator GraphEdge() const {
1.130 -// if (out_or_in) return(out); else return(in);
1.131 -// }
1.132 -// friend bool operator==(const Edge& u, const Edge& v) {
1.133 -// if (v.out_or_in)
1.134 -// return (u.out_or_in && u.out==v.out);
1.135 -// else
1.136 -// return (!u.out_or_in && u.in==v.in);
1.137 -// }
1.138 -// friend bool operator!=(const Edge& u, const Edge& v) {
1.139 -// if (v.out_or_in)
1.140 -// return (!u.out_or_in || u.out!=v.out);
1.141 -// else
1.142 -// return (u.out_or_in || u.in!=v.in);
1.143 -// }
1.144 -// };
1.145 -
1.146 -// class OutEdgeIt : public Edge {
1.147 -// friend class UndirGraphWrapper<GraphWrapper>;
1.148 -// public:
1.149 -// OutEdgeIt() : Edge() { }
1.150 -// OutEdgeIt(const Invalid& i) : Edge(i) { }
1.151 -// OutEdgeIt(const UndirGraphWrapper<GraphWrapper>& _G, const Node& n)
1.152 -// : Edge() {
1.153 -// out_or_in=true;
1.154 -// _G.gw.first(out, n);
1.155 -// if (!(_G.gw.valid(out))) {
1.156 -// out_or_in=false;
1.157 -// _G.gw.first(in, n);
1.158 -// }
1.159 -// }
1.160 -// };
1.161 -
1.162 -// OutEdgeIt& first(OutEdgeIt& e, const Node& n) const {
1.163 -// e.out_or_in=true;
1.164 -// gw.first(e.out, n);
1.165 -// if (!(gw.valid(e.out))) {
1.166 -// e.out_or_in=false;
1.167 -// gw.first(e.in, n);
1.168 -// }
1.169 -// return e;
1.170 -// }
1.171 -
1.172 -// OutEdgeIt& next(OutEdgeIt& e) const {
1.173 -// if (e.out_or_in) {
1.174 -// Node n=gw.tail(e.out);
1.175 -// gw.next(e.out);
1.176 -// if (!gw.valid(e.out)) {
1.177 -// e.out_or_in=false;
1.178 -// gw.first(e.in, n);
1.179 -// }
1.180 -// } else {
1.181 -// gw.next(e.in);
1.182 -// }
1.183 -// return e;
1.184 -// }
1.185 -
1.186 -// Node aNode(const OutEdgeIt& e) const {
1.187 -// if (e.out_or_in) return gw.tail(e); else return gw.head(e); }
1.188 -// Node bNode(const OutEdgeIt& e) const {
1.189 -// if (e.out_or_in) return gw.head(e); else return gw.tail(e); }
1.190 -
1.191 -// typedef OutEdgeIt InEdgeIt;
1.192 -
1.193 -// template<typename I> I& first(I& i) const { return gw.first(i); }
1.194 -// // template<typename I, typename P> I& first(I& i, const P& p) const {
1.195 -// // return graph->first(i, p); }
1.196 -
1.197 -// template<typename I> I getNext(const I& i) const {
1.198 -// return gw.getNext(i); }
1.199 -// template<typename I> I& next(I &i) const { return gw.next(i); }
1.200 -
1.201 -// template< typename It > It first() const {
1.202 -// It e; first(e); return e; }
1.203 -
1.204 -// template< typename It > It first(const Node& v) const {
1.205 -// It e; first(e, v); return e; }
1.206 -
1.207 -// Node head(const Edge& e) const { return gw.head(e); }
1.208 -// Node tail(const Edge& e) const { return gw.tail(e); }
1.209 -
1.210 -// template<typename I> bool valid(const I& i) const
1.211 -// { return gw.valid(i); }
1.212 -
1.213 -// //template<typename I> void setInvalid(const I &i);
1.214 -// //{ return graph->setInvalid(i); }
1.215 -
1.216 -// int nodeNum() const { return gw.nodeNum(); }
1.217 -// int edgeNum() const { return gw.edgeNum(); }
1.218 -
1.219 -// // template<typename I> Node aNode(const I& e) const {
1.220 -// // return graph->aNode(e); }
1.221 -// // template<typename I> Node bNode(const I& e) const {
1.222 -// // return graph->bNode(e); }
1.223 -
1.224 -// Node addNode() const { return gw.addNode(); }
1.225 -// // FIXME: ez igy nem jo, mert nem
1.226 -// // Edge addEdge(const Node& tail, const Node& head) const {
1.227 -// // return graph->addEdge(tail, head); }
1.228 -
1.229 -// template<typename I> void erase(const I& i) const { gw.erase(i); }
1.230 -
1.231 -// void clear() const { gw.clear(); }
1.232 -
1.233 -// template<typename T> class NodeMap : public GraphWrapper::NodeMap<T> {
1.234 -// public:
1.235 -// NodeMap(const UndirGraphWrapper<GraphWrapper>& _G) :
1.236 -// GraphWrapper::NodeMap<T>(_G.gw) { }
1.237 -// NodeMap(const UndirGraphWrapper<GraphWrapper>& _G, T a) :
1.238 -// GraphWrapper::NodeMap<T>(_G.gw, a) { }
1.239 -// };
1.240 -
1.241 -// template<typename T> class EdgeMap : public GraphWrapper::EdgeMap<T> {
1.242 -// public:
1.243 -// EdgeMap(const UndirGraphWrapper<GraphWrapper>& _G) :
1.244 -// GraphWrapper::EdgeMap<T>(_G.gw) { }
1.245 -// EdgeMap(const UndirGraphWrapper<GraphWrapper>& _G, T a) :
1.246 -// GraphWrapper::EdgeMap<T>(_G.gw, a) { }
1.247 -// };
1.248 -// };
1.249 -
1.250 -
1.251 template<typename Graph>
1.252 class UndirGraphWrapper : public GraphWrapper<Graph> {
1.253 // protected:
1.254 @@ -955,8 +760,6 @@
1.255 }
1.256
1.257 // template<typename I> I& next(I &i) const { graph->next(i); return i; }
1.258 -// template<typename I> I getNext(const I& i) const { return gw.getNext(i); }
1.259 -
1.260 template< typename It > It first() const {
1.261 It e; this->first(e); return e; }
1.262
1.263 @@ -1973,11 +1776,6 @@
1.264 // return i;
1.265 // }
1.266
1.267 - //template<typename I> I getNext(const I& i) const {
1.268 - // return gw.getNext(i);
1.269 - //}
1.270 -
1.271 -
1.272 NodeIt& next(NodeIt& i) const { graph->next(i.n); return i; }
1.273 OutEdgeIt& next(OutEdgeIt& i) const { graph->next(i.e); return i; }
1.274 InEdgeIt& next(InEdgeIt& i) const { graph->next(i.e); return i; }
1.275 @@ -2086,11 +1884,6 @@
1.276 // // return i;
1.277 // // }
1.278
1.279 -// //template<typename I> I getNext(const I& i) const {
1.280 -// // return gw.getNext(i);
1.281 -// //}
1.282 -
1.283 -
1.284 // NodeIt& next(NodeIt& i) const {
1.285 // graph->next(i);
1.286 // return i;