11 typedef typename G::EdgeIt EdgeIt;
13 typedef typename G::InEdgeIt InEdgeIt;
14 typedef typename G::OutEdgeIt OutEdgeIt;
15 typedef typename G::SymEdgeIt SymEdgeIt;
16 typedef typename G::EachEdgeIt EachEdgeIt;
18 typedef typename G::NodeIt NodeIt;
20 template<typename I> I &getFirst(I &i); { return graph->getFirst(i); }
21 template<typename I,typename P> I &getFirst(I &i,const P &p);
22 { return graph->getFirst(i,p); }
23 template<typename I> I next(const I i); { return graph->goNext(i); }
24 template<typename I> I &goNext(I &i); { return graph->goNext(i); }
26 NodeIt head(const EdgeIt &e);
27 { return graph->head(e); }
28 NodeIt tail(const EdgeIt &e);
29 { return graph->tail(e); }
31 template<typename I> NodeIt aNode(const I e);
32 { return graph->aNode(e); }
33 template<typename I> NodeIt bNode(const I e);
34 { return graph->bNode(e); }
36 template<typename I> bool valid(const I i);
37 { return graph->valid(i); }
39 template<typename I> void setInvalid(const I &i);
40 { return graph->setInvalid(i); }
42 NodeIt addNode(); { return graph->addNode(); }
43 EdgeIt addEdge(const NodeIt from,const NodeIt to);
44 { return graph->addEdge(ftom,to); }
46 template<I> void delete(I i); { graph->delete(i); }
48 void clean(); { graph->clean(); }
50 template<class T> class NodeMap : public typename G::NodeMap<T>;
51 template<class T> class EdgeMap : public typename G::EdgeMap<T>;
53 void SetG(G &g) {graph = &g;}
55 TrivGraphWrapper() {graph = NULL;}
56 TrivGraphWrapper(G &g) {graph = &g;}
67 typedef typename G::EdgeIt EdgeIt;
69 typedef typename G::InEdgeIt OutEdgeIt;
70 typedef typename G::OutEdgeIt InEdgeIt;
71 typedef typename G::SymEdgeIt SymEdgeIt;
72 typedef typename G::EachEdgeIt EachEdgeIt;
74 typedef typename G::NodeIt NodeIt;
76 template<typename I> I &getFirst(I &i); { return graph->getFirst(i); }
77 template<typename I,typename P> I &getFirst(I &i,const P &p);
78 { return graph->getFirst(i,p); }
79 template<typename I> I next(const I i); { return graph->goNext(i); }
80 template<typename I> I &goNext(I &i); { return graph->goNext(i); }
82 NodeIt head(const EdgeIt &e);
83 { return graph->tail(e); }
84 NodeIt tail(const EdgeIt &e);
85 { return graph->head(e); }
87 template<typename I> NodeIt aNode(const I e);
88 { return graph->aNode(e); }
89 template<typename I> NodeIt bNode(const I e);
90 { return graph->bNode(e); }
92 template<typename I> bool valid(const I i);
93 { return graph->valid(i); }
95 template<typename I> void setInvalid(const I &i);
96 { return graph->setInvalid(i); }
98 NodeIt addNode(); { return graph->addNode(); }
99 EdgeIt addEdge(const NodeIt from,const NodeIt to);
100 { return graph->addEdge(to,from); }
102 template<I> void delete(I i); { graph->delete(i); }
104 void clean(); { graph->clean(); }
106 template<class T> class NodeMap : public typename G::NodeMap<T>;
107 template<class T> class EdgeMap : public typename G::EdgeMap<T>;
109 void SetG(G &g) {graph = &g;}
111 RevGraphWrapper() {graph = NULL;}
112 RevGraphWrapper(G &g) {graph = &g;}
116 class SymGraphWrapper
123 typedef typename G::EdgeIt EdgeIt;
125 typedef typename G::InEdgeIt SymEdgeIt;
126 typedef typename G::OutEdgeIt SymEdgeIt;
127 typedef typename G::SymEdgeIt SymEdgeIt;
128 typedef typename G::EachEdgeIt EachEdgeIt;
130 typedef typename G::NodeIt NodeIt;
132 template<typename I> I &getFirst(I &i); { return graph->getFirst(i); }
133 template<typename I,typename P> I &getFirst(I &i,const P &p);
134 { return graph->getFirst(i,p); }
135 template<typename I> I next(const I i); { return graph->goNext(i); }
136 template<typename I> I &goNext(I &i); { return graph->goNext(i); }
138 NodeIt head(const EdgeIt &e);
139 { return graph->head(e); }
140 NodeIt tail(const EdgeIt &e);
141 { return graph->tail(e); }
143 template<typename I> NodeIt aNode(const I e);
144 { return graph->aNode(e); }
145 template<typename I> NodeIt bNode(const I e);
146 { return graph->bNode(e); }
148 template<typename I> bool valid(const I i);
149 { return graph->valid(i); }
151 template<typename I> void setInvalid(const I &i);
152 { return graph->setInvalid(i); }
154 NodeIt addNode(); { return graph->addNode(); }
155 EdgeIt addEdge(const NodeIt from,const NodeIt to);
156 { return graph->addEdge(to,from); }
158 template<I> void delete(I i); { graph->delete(i); }
160 void clean(); { graph->clean(); }
162 template<class T> class NodeMap : public typename G::NodeMap<T>;
163 template<class T> class EdgeMap : public typename G::EdgeMap<T>;
165 void SetG(G &g) {graph = &g;}
167 RevGraphWrapper() {graph = NULL;}
168 RevGraphWrapper(G &g) {graph = &g;}
172 // FIXME: comparison should be made better!!!
173 template<typename G, typename lomap, typename fmap, typename himap>
174 class ResGraphWrapper
181 typedef typename G::EdgeIt EdgeIt;
197 typedef typename G::SymEdgeIt SymEdgeIt;
198 typedef typename G::EachEdgeIt EachEdgeIt;
200 typedef typename G::NodeIt NodeIt;
202 NodeIt &getFirst(NodeIt &n); { return graph->getFirst(n); }
204 // EachEdge and SymEdge is missing!!!!
205 // EdgeIt <-> In/OutEdgeIt conversion is missing!!!!
207 InEdgeIt &getFirst(InEdgeIt &e,const NodeIt &n)
210 graph->getFirst(e.i,n);
211 while(graph->valid(e.i) && fmap.get(e.i)>=himap.get(e.i))
213 if(!graph->valid(e.i)) {
214 graph->getFirst(e.o,n);
215 while(graph->valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))
220 InEdgeIt &goNext(InEdgeIt &e)
222 if(graph->valid(e.i)) {
223 while(graph->valid(e.i) && fmap.get(e.i)>=himap.get(e.i))
225 if(graph->valid(e.i)) return e;
226 else graph->getFirst(e.o,e.n);
229 while(graph->valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))
234 InEdgeIt Next(const InEdgeIt &e) {InEdgeIt t(e); return goNext(t);}
235 bool valid(const InEdgeIt e) { return graph->valid(e.i)||graph->valid(e.o);}
237 OutEdgeIt &getFirst(OutEdgeIt &e,const NodeIt &n)
240 graph->getFirst(e.o,n);
241 while(graph->valid(e.o) && fmap.get(e.o)>=himap.get(e.o))
243 if(!graph->valid(e.o)) {
244 graph->getFirst(e.i,n);
245 while(graph->valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))
250 OutEdgeIt &goNext(OutEdgeIt &e)
252 if(graph->valid(e.o)) {
253 while(graph->valid(e.o) && fmap.get(e.o)>=himap.get(e.o))
255 if(graph->valid(e.o)) return e;
256 else graph->getFirst(e.i,e.n);
259 while(graph->valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))
264 OutEdgeIt Next(const OutEdgeIt &e) {OutEdgeIt t(e); return goNext(t);}
265 bool valid(const OutEdgeIt e) { return graph->valid(e.o)||graph->valid(e.i);}
267 template<typename I> I &goNext(I &i); { return graph->goNext(i); }
268 template<typename I> I next(const I i); { return graph->goNext(i); }
270 NodeIt head(const EdgeIt &e);
271 { return graph->head(e); }
272 NodeIt tail(const EdgeIt &e);
273 { return graph->tail(e); }
275 template<typename I> NodeIt aNode(const I e);
276 { return graph->aNode(e); }
277 template<typename I> NodeIt bNode(const I e);
278 { return graph->bNode(e); }
280 template<typename I> bool valid(const I i);
281 { return graph->valid(i); }
283 template<typename I> void setInvalid(const I &i);
284 { return graph->setInvalid(i); }
286 NodeIt addNode(); { return graph->addNode(); }
287 EdgeIt addEdge(const NodeIt from,const NodeIt to);
288 { return graph->addEdge(to,from); }
290 template<I> void delete(I i); { graph->delete(i); }
292 void clean(); { graph->clean(); }
294 template<class T> class NodeMap : public typename G::NodeMap<T>;
295 template<class T> class EdgeMap : public typename G::EdgeMap<T>;
297 void SetG(G &g) {graph = &g;}
299 RevGraphWrapper() {graph = NULL;}
300 RevGraphWrapper(G &g) {graph = &g;}
305 // NodeIt &getFirst(NodeIt &n) { return graph->getFirst(n); }
306 // InEdgeIt &getFirst(InEdgeIt &e,const NodeIt &n);
307 // { return graph->getFirst(e,n); }
308 // OutEdgeIt &getFirst(OutEdgeIt &e,const NodeIt &n);
309 // { return graph->getFirst(e,n); }
310 // SymEdgeIt &getFirst(SymEdgeIt &e,const NodeIt &n);
311 // { return graph->getFirst(e,n); }
312 // EachEdgeIt &getFirst(EachEdgeIt &e);
313 // { return graph->getFirst(e); }
315 // NodeIt next(const NodeIt &n);
316 // { return graph->next(n); }
317 // InEdgeIt next(const InEdgeIt &e);
318 // { return graph->next(e); }
319 // OutEdgeIt next(const OutEdgeIt &e);
320 // { return graph->next(e); }
321 // SymEdgeIt next(const SymEdgeIt &e);
322 // { return graph->next(e); }
323 // EachEdgeIt next(const EachEdgeIt &e);
324 // { return graph->next(e); }
326 // NodeIt &goNext(NodeIt &n);
327 // { return graph->goNext(n); }
328 // InEdgeIt &goNext(InEdgeIt &e);
329 // { return graph->goNext(e); }
330 // OutEdgeIt &goNext(OutEdgeIt &e);
331 // { return graph->goNext(e); }
332 // SymEdgeIt &goNext(SymEdgeIt &e);
333 // { return graph->goNext(e); }
334 // EachEdgeIt &goNext(EachEdgeIt &e);
335 // { return graph->goNext(e); }