diff -r 7949a29a334e -r 27fbd1559fb7 src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Thu Mar 11 12:55:50 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Thu Mar 11 14:15:07 2004 +0000 @@ -19,6 +19,12 @@ typedef typename Graph::InEdgeIt InEdgeIt; //typedef typename Graph::SymEdgeIt SymEdgeIt; typedef typename Graph::EachEdgeIt EachEdgeIt; + + //TrivGraphWrapper() : graph(0) { } + TrivGraphWrapper(Graph& _graph) : graph(&_graph) { } + + void setGraph(Graph& _graph) { graph = &_graph; } + Graph& getGraph() const { return (*graph); } template I& getFirst(I& i) const { return graph->getFirst(i); } template I& getFirst(I& i, const P& p) const { @@ -66,6 +72,7 @@ NodeMap(const TrivGraphWrapper& _G, T a) : Graph::NodeMap(_G.getGraph(), a) { } }; + template class EdgeMap : public Graph::EdgeMap { public: EdgeMap(const TrivGraphWrapper& _G) : @@ -73,12 +80,6 @@ EdgeMap(const TrivGraphWrapper& _G, T a) : Graph::EdgeMap(_G.getGraph(), a) { } }; - - void setGraph(Graph& _graph) { graph = &_graph; } - Graph& getGraph() const { return (*graph); } - - //TrivGraphWrapper() : graph(0) { } - TrivGraphWrapper(Graph& _graph) : graph(&_graph) { } }; template @@ -97,6 +98,12 @@ typedef typename Graph::InEdgeIt OutEdgeIt; //typedef typename Graph::SymEdgeIt SymEdgeIt; typedef typename Graph::EachEdgeIt EachEdgeIt; + + //RevGraphWrapper() : graph(0) { } + RevGraphWrapper(Graph& _graph) : graph(&_graph) { } + + void setGraph(Graph& _graph) { graph = &_graph; } + Graph& getGraph() const { return (*graph); } template I& getFirst(I& i) const { return graph->getFirst(i); } template I& getFirst(I& i, const P& p) const { @@ -144,6 +151,7 @@ NodeMap(const RevGraphWrapper& _G, T a) : Graph::NodeMap(_G.getGraph(), a) { } }; + template class EdgeMap : public Graph::EdgeMap { public: EdgeMap(const RevGraphWrapper& _G) : @@ -151,12 +159,6 @@ EdgeMap(const RevGraphWrapper& _G, T a) : Graph::EdgeMap(_G.getGraph(), a) { } }; - - void setGraph(Graph& _graph) { graph = &_graph; } - Graph& getGraph() const { return (*graph); } - - //RevGraphWrapper() : graph(0) { } - RevGraphWrapper(Graph& _graph) : graph(&_graph) { } }; @@ -182,6 +184,12 @@ typedef typename Graph::InEdgeIt GraphInEdgeIt; //public: + //UndirGraphWrapper() : graph(0) { } + UndirGraphWrapper(Graph& _graph) : graph(&_graph) { } + + void setGraph(Graph& _graph) { graph = &_graph; } + Graph& getGraph() const { return (*graph); } + class EdgeIt { friend class UndirGraphWrapper; bool out_or_in; //true iff out @@ -196,9 +204,6 @@ class OutEdgeIt : public EdgeIt { friend class UndirGraphWrapper; - //bool out_or_in; //true iff out - //GraphOutEdgeIt out; - //GraphInEdgeIt in; public: OutEdgeIt() : EdgeIt() { } OutEdgeIt(const UndirGraphWrapper& _G, const NodeIt& n) : EdgeIt() { @@ -287,6 +292,7 @@ NodeMap(const UndirGraphWrapper& _G, T a) : Graph::NodeMap(_G.getGraph(), a) { } }; + template class EdgeMap : public Graph::EdgeMap { public: EdgeMap(const UndirGraphWrapper& _G) : @@ -294,12 +300,6 @@ EdgeMap(const UndirGraphWrapper& _G, T a) : Graph::EdgeMap(_G.getGraph(), a) { } }; - - void setGraph(Graph& _graph) { graph = &_graph; } - Graph& getGraph() const { return (*graph); } - - //TrivGraphWrapper() : graph(0) { } - UndirGraphWrapper(Graph& _graph) : graph(&_graph) { } }; @@ -386,13 +386,16 @@ FlowMap* flow; const CapacityMap* capacity; public: + ResGraphWrapper(const Graph& _G, FlowMap& _flow, const CapacityMap& _capacity) : G(&_G), flow(&_flow), capacity(&_capacity) { } // ResGraphWrapper(const ResGraphWrapper& res_graph_wrapper) : // G(res_graph_wrapper.G), flow(res_graph_wrapper.flow), capacity(res_graph_wrapper.capacity) { } - void setGraph(Graph& _graph) { graph = &_graph; } - Graph& getGraph() const { return (*graph); } + + void setGraph(const Graph& _graph) { graph = &_graph; } + const Graph& getGraph() const { return (*G); } + class EdgeIt; class OutEdgeIt; friend class EdgeIt; @@ -401,94 +404,49 @@ class EdgeIt { friend class ResGraphWrapper; protected: - //const ResGraph3* resG; - const Graph* G; - FlowMap* flow; - const CapacityMap* capacity; - //OldSymEdgeIt sym; + bool out_or_in; //true, iff out OldOutEdgeIt out; OldInEdgeIt in; - bool out_or_in; //true, iff out public: EdgeIt() : out_or_in(true) { } - EdgeIt(const Graph& _G, FlowMap& _flow, const CapacityMap& _capacity) : - G(&_G), flow(&_flow), capacity(&_capacity), out_or_in(true) { } - //EdgeIt(const EdgeIt& e) : G(e.G), flow(e.flow), capacity(e.capacity), out(e.out), in(e.in), out_or_in(e.out_or_in) { } - Number free() const { - if (out_or_in) { - return (/*resG->*/capacity->get(out)-/*resG->*/flow->get(out)); - } else { - return (/*resG->*/flow->get(in)); - } - } - bool valid() const { - return out_or_in && out.valid() || in.valid(); } - void augment(Number a) const { - if (out_or_in) { - /*resG->*/flow->set(out, /*resG->*/flow->get(out)+a); - } else { - /*resG->*/flow->set(in, /*resG->*/flow->get(in)-a); - } - } - void print() { - if (out_or_in) { - std::cout << "out "; - if (out.valid()) - std::cout << G->id(G->tail(out)) << "--"<< G->id(out) <<"->"<< G->id(G->head(out)); - else - std::cout << "invalid"; - } - else { - std::cout << "in "; - if (in.valid()) - std::cout << G->id(G->head(in)) << "<-"<< G->id(in) <<"--"<< G->id(G->tail(in)); - else - std::cout << "invalid"; - } - std::cout << std::endl; - } +// bool valid() const { +// return out_or_in && out.valid() || in.valid(); } }; - Number free(OldOutEdgeIt out) const { - return (/*resG->*/capacity->get(out)-/*resG->*/flow->get(out)); - } - Number free(OldInEdgeIt in) const { - return (/*resG->*/flow->get(in)); - } class OutEdgeIt : public EdgeIt { friend class ResGraphWrapper; public: OutEdgeIt() { } + //FIXME + OutEdgeIt(const EdgeIt& e) : EdgeIt(e) { } private: - OutEdgeIt(const Graph& _G, NodeIt v, FlowMap& _flow, const CapacityMap& _capacity) : EdgeIt(_G, _flow, _capacity) { - //out=/*resG->*/G->template first(v); - G->getFirst(out, v); - while( out.valid() && !(EdgeIt::free()>0) ) { ++out; } + OutEdgeIt(const ResGraphWrapper& resG, NodeIt v) : EdgeIt() { + resG.G->getFirst(out, v); + while( out.valid() && !(resG.free(out)>0) ) { ++out; } if (!out.valid()) { out_or_in=0; - //in=/*resG->*/G->template first(v); - G->getFirst(in, v); - while( in.valid() && !(EdgeIt::free()>0) ) { ++in; } + resG.G->getFirst(in, v); + while( in.valid() && !(resG.free(in)>0) ) { ++in; } } } - public: - OutEdgeIt& operator++() { - if (out_or_in) { - NodeIt v=/*resG->*/G->aNode(out); - ++out; - while( out.valid() && !(EdgeIt::free()>0) ) { ++out; } - if (!out.valid()) { - out_or_in=0; - G->getFirst(in, v); //=/*resG->*/G->template first(v); - while( in.valid() && !(EdgeIt::free()>0) ) { ++in; } - } - } else { - ++in; - while( in.valid() && !(EdgeIt::free()>0) ) { ++in; } - } - return *this; - } +// public: +// OutEdgeIt& operator++() { +// if (out_or_in) { +// NodeIt v=/*resG->*/G->aNode(out); +// ++out; +// while( out.valid() && !(EdgeIt::free()>0) ) { ++out; } +// if (!out.valid()) { +// out_or_in=0; +// G->getFirst(in, v); +// while( in.valid() && !(EdgeIt::free()>0) ) { ++in; } +// } +// } else { +// ++in; +// while( in.valid() && !(EdgeIt::free()>0) ) { ++in; } +// } +// return *this; +// } }; class EachEdgeIt : public EdgeIt { @@ -497,67 +455,66 @@ public: EachEdgeIt() { } //EachEdgeIt(const EachEdgeIt& e) : EdgeIt(e), v(e.v) { } - EachEdgeIt(const Graph& _G, FlowMap& _flow, const CapacityMap& _capacity) : EdgeIt(_G, _flow, _capacity) { - out_or_in=true; - G->getFirst(v); - if (v.valid()) G->getFirst(out, v); else out=OldOutEdgeIt(); - while (out.valid() && !(EdgeIt::free()>0) ) { ++out; } + EachEdgeIt(const ResGraphWrapper& resG) : EdgeIt() { + resG.G->getFirst(v); + if (v.valid()) resG.G->getFirst(out, v); else out=OldOutEdgeIt(); + while (out.valid() && !(resG.free(out)>0) ) { ++out; } while (v.valid() && !out.valid()) { ++v; - if (v.valid()) G->getFirst(out, v); - while (out.valid() && !(EdgeIt::free()>0) ) { ++out; } + if (v.valid()) resG.G->getFirst(out, v); + while (out.valid() && !(resG.free(out)>0) ) { ++out; } } if (!out.valid()) { out_or_in=0; - G->getFirst(v); - if (v.valid()) G->getFirst(in, v); else in=OldInEdgeIt(); - while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } + resG.G->getFirst(v); + if (v.valid()) resG.G->getFirst(in, v); else in=OldInEdgeIt(); + while (in.valid() && !(resG.free(in)>0) ) { ++in; } while (v.valid() && !in.valid()) { ++v; - if (v.valid()) G->getFirst(in, v); - while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } + if (v.valid()) resG.G->getFirst(in, v); + while (in.valid() && !(resG.free(in)>0) ) { ++in; } } } } - EachEdgeIt& operator++() { - if (out_or_in) { - ++out; - while (out.valid() && !(EdgeIt::free()>0) ) { ++out; } - while (v.valid() && !out.valid()) { - ++v; - if (v.valid()) G->getFirst(out, v); - while (out.valid() && !(EdgeIt::free()>0) ) { ++out; } - } - if (!out.valid()) { - out_or_in=0; - G->getFirst(v); - if (v.valid()) G->getFirst(in, v); else in=OldInEdgeIt(); - while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } - while (v.valid() && !in.valid()) { - ++v; - if (v.valid()) G->getFirst(in, v); - while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } - } - } - } else { - ++in; - while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } - while (v.valid() && !in.valid()) { - ++v; - if (v.valid()) G->getFirst(in, v); - while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } - } - } - return *this; - } +// EachEdgeIt& operator++() { +// if (out_or_in) { +// ++out; +// while (out.valid() && !(EdgeIt::free()>0) ) { ++out; } +// while (v.valid() && !out.valid()) { +// ++v; +// if (v.valid()) G->getFirst(out, v); +// while (out.valid() && !(EdgeIt::free()>0) ) { ++out; } +// } +// if (!out.valid()) { +// out_or_in=0; +// G->getFirst(v); +// if (v.valid()) G->getFirst(in, v); else in=OldInEdgeIt(); +// while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } +// while (v.valid() && !in.valid()) { +// ++v; +// if (v.valid()) G->getFirst(in, v); +// while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } +// } +// } +// } else { +// ++in; +// while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } +// while (v.valid() && !in.valid()) { +// ++v; +// if (v.valid()) G->getFirst(in, v); +// while (in.valid() && !(EdgeIt::free()>0) ) { ++in; } +// } +// } +// return *this; +// } }; - void getFirst(EachNodeIt& v) const { G->getFirst(v); } - void getFirst(OutEdgeIt& e, NodeIt v) const { - e=OutEdgeIt(*G, v, *flow, *capacity); + EachNodeIt& getFirst(EachNodeIt& v) const { G->getFirst(v); } + OutEdgeIt& getFirst(OutEdgeIt& e, NodeIt v) const { + e=OutEdgeIt(*this, v); } - void getFirst(EachEdgeIt& e) const { - e=EachEdgeIt(*G, *flow, *capacity); + EachEdgeIt& getFirst(EachEdgeIt& e) const { + e=EachEdgeIt(*this); } EachNodeIt& next(EachNodeIt& n) const { return G->next(n); } @@ -566,15 +523,15 @@ if (e.out_or_in) { NodeIt v=G->aNode(e.out); ++(e.out); - while( G->valid(e.out) && !(e.free()>0) ) { ++(e.out); } + while( G->valid(e.out) && !(free(e.out)>0) ) { ++(e.out); } if (!G->valid(e.out)) { e.out_or_in=0; - G->getFirst(e.in, v); //=/*resG->*/G->template first(v); - while( G->valid(e.in) && !(e.free()>0) ) { ++(e.in); } + G->getFirst(e.in, v); + while( G->valid(e.in) && !(free(e.in)>0) ) { ++(e.in); } } } else { ++(e.in); - while( G->valid(e.in) && !(e.free()>0) ) { ++(e.in); } + while( G->valid(e.in) && !(free(e.in)>0) ) { ++(e.in); } } return e; } @@ -582,30 +539,30 @@ EachEdgeIt& next(EachEdgeIt& e) const { if (e.out_or_in) { ++(e.out); - while (G->valid(e.out) && !(e.free()>0) ) { ++(e.out); } + while (G->valid(e.out) && !(free(e.out)>0) ) { ++(e.out); } while (G->valid(e.v) && !G->valid(e.out)) { ++(e.v); if (G->valid(e.v)) G->getFirst(e.out, e.v); - while (G->valid(e.out) && !(e.free()>0) ) { ++(e.out); } + while (G->valid(e.out) && !(free(e.out)>0) ) { ++(e.out); } } if (!G->valid(e.out)) { e.out_or_in=0; G->getFirst(e.v); if (G->valid(e.v)) G->getFirst(e.in, e.v); else e.in=OldInEdgeIt(); - while (G->valid(e.in) && !(e.free()>0) ) { ++(e.in); } + while (G->valid(e.in) && !(free(e.in)>0) ) { ++(e.in); } while (G->valid(e.v) && !G->valid(e.in)) { ++(e.v); if (G->valid(e.v)) G->getFirst(e.in, e.v); - while (G->valid(e.in) && !(e.free()>0) ) { ++(e.in); } + while (G->valid(e.in) && !(free(e.in)>0) ) { ++(e.in); } } } } else { ++(e.in); - while (G->valid(e.in) && !(e.free()>0) ) { ++(e.in); } + while (G->valid(e.in) && !(free(e.in)>0) ) { ++(e.in); } while (G->valid(e.v) && !G->valid(e.in)) { ++(e.v); if (G->valid(e.v)) G->getFirst(e.in, e.v); - while (G->valid(e.in) && !(e.free()>0) ) { ++(e.in); } + while (G->valid(e.in) && !(free(e.in)>0) ) { ++(e.in); } } } return e; @@ -642,6 +599,28 @@ bool valid(EdgeIt e) const { return e.out_or_in ? G->valid(e.out) : G->valid(e.in); } + void augment(const EdgeIt& e, Number a) const { + if (e.out_or_in) + flow->set(e.out, flow->get(e.out)+a); + else + flow->set(e.in, flow->get(e.in)-a); + } + + Number free(const EdgeIt& e) const { + if (e.out_or_in) + return (capacity->get(e.out)-flow->get(e.out)); + else + return (flow->get(e.in)); + } + + Number free(OldOutEdgeIt out) const { + return (capacity->get(out)-flow->get(out)); + } + + Number free(OldInEdgeIt in) const { + return (flow->get(in)); + } + template class NodeMap : public Graph::NodeMap { public: NodeMap(const ResGraphWrapper& _G) @@ -679,6 +658,243 @@ return backward_map.get(e.in); } }; + }; + + template + class ErasingResGraphWrapper : public ResGraphWrapper { + protected: + ResGraphWrapper::NodeMap::OutEdgeIt> first_out_edges; + //ResGraphWrapper::NodeMap dist; + public: + ErasingResGraphWrapper(const Graph& _G, FlowMap& _flow, + const CapacityMap& _capacity) : + ResGraphWrapper(_G, _flow, _capacity), + first_out_edges(*this) /*, dist(*this)*/ { + for(EachNodeIt n=this->template first(); this->valid(n); this->next(n)) { + OutEdgeIt e; + ResGraphWrapper::getFirst(e, n); + first_out_edges.set(n, e); + } + } + + //void setGraph(Graph& _graph) { graph = &_graph; } + //Graph& getGraph() const { return (*graph); } + + //TrivGraphWrapper() : graph(0) { } + //ErasingResGraphWrapper(Graph& _graph) : graph(&_graph) { } + + //typedef Graph BaseGraph; + + //typedef typename Graph::NodeIt NodeIt; + //typedef typename Graph::EachNodeIt EachNodeIt; + + //typedef typename Graph::EdgeIt EdgeIt; + //typedef typename Graph::OutEdgeIt OutEdgeIt; + //typedef typename Graph::InEdgeIt InEdgeIt; + //typedef typename Graph::SymEdgeIt SymEdgeIt; + //typedef typename Graph::EachEdgeIt EachEdgeIt; + + typedef typename ResGraphWrapper::NodeIt NodeIt; + typedef typename ResGraphWrapper::EachNodeIt EachNodeIt; + + typedef typename ResGraphWrapper::EdgeIt EdgeIt; + typedef typename ResGraphWrapper::OutEdgeIt OutEdgeIt; + //typedef typename ResGraphWrapper::InEdgeIt InEdgeIt; + //typedef typename Graph::SymEdgeIt SymEdgeIt; + //typedef typename ResGraphWrapper::EachEdgeIt EachEdgeIt; + + EachNodeIt& getFirst(EachNodeIt& n) const { + return ResGraphWrapper::getFirst(n); + } + + OutEdgeIt& getFirst(OutEdgeIt& e, const NodeIt& n) const { + e=first_out_edges.get(n); + return e; + } + + //ROSSZ template I& getFirst(I& i) const { return getFirst(i); } + //ROSSZ template I& getFirst(I& i, const P& p) const { + // return getFirst(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; getFirst(e); return e; } + + template< typename It > It first(const NodeIt& v) const { + It e; getFirst(e, v); return e; } + + //NodeIt head(const EdgeIt& e) const { return graph->head(e); } + //NodeIt tail(const EdgeIt& e) const { return graph->tail(e); } + + //template bool valid(const I& i) const + // { return graph->valid(i); } + + //int nodeNum() const { return graph->nodeNum(); } + //int edgeNum() const { return graph->edgeNum(); } + + //template NodeIt aNode(const I& e) const { + // return graph->aNode(e); } + //template NodeIt bNode(const I& e) const { + // return graph->bNode(e); } + + //NodeIt addNode() const { return graph->addNode(); } + //EdgeIt addEdge(const NodeIt& tail, const NodeIt& head) const { + // return graph->addEdge(tail, head); } + + //void erase(const OutEdgeIt& e) { + // first_out_edge(this->tail(e))=e; + //} + void erase(const EdgeIt& e) { + OutEdgeIt f(e); + next(f); + first_out_edges.set(this->tail(e), f); + } + //template void erase(const I& i) const { graph->erase(i); } + + //void clear() const { graph->clear(); } + + template class NodeMap : public ResGraphWrapper::NodeMap { + public: + NodeMap(const ErasingResGraphWrapper& _G) : + ResGraphWrapper::NodeMap(_G /*_G.getGraph()*/) { } + NodeMap(const ErasingResGraphWrapper& _G, T a) : + ResGraphWrapper::NodeMap(_G /*_G.getGraph()*/, a) { } + }; + + template class EdgeMap : public ResGraphWrapper::EdgeMap { + public: + EdgeMap(const ErasingResGraphWrapper& _G) : + ResGraphWrapper::EdgeMap(_G /*_G.getGraph()*/) { } + EdgeMap(const ErasingResGraphWrapper& _G, T a) : + ResGraphWrapper::EdgeMap(_G /*_G.getGraph()*/, a) { } + }; + }; + + template + class FilterGraphWrapper { + }; + + template + class FilterGraphWrapper > : public ErasingResGraphWrapper { + + //Graph* graph; + + public: + //typedef Graph BaseGraph; + + typedef typename ErasingResGraphWrapper::NodeIt NodeIt; + typedef typename ErasingResGraphWrapper::EachNodeIt EachNodeIt; + + typedef typename ErasingResGraphWrapper::EdgeIt EdgeIt; + typedef typename ErasingResGraphWrapper::OutEdgeIt OutEdgeIt; + //typedef typename ErasingResGraphWrapper::InEdgeIt InEdgeIt; + //typedef typename Graph::SymEdgeIt SymEdgeIt; + typedef typename ErasingResGraphWrapper::EachEdgeIt EachEdgeIt; + + //FilterGraphWrapper::NodeMap::OutEdgeIt> first_out_edges; + + public: + FilterGraphWrapper(const Graph& _G, FlowMap& _flow, + const CapacityMap& _capacity) : + ErasingResGraphWrapper(_G, _flow, _capacity), dist(*this) { + } + + OutEdgeIt& getFirst(OutEdgeIt& e, const NodeIt& n) const { + ErasingResGraphWrapper::getFirst(e, n); + while (valid(e) && (dist.get(tail(e))+1!=dist.get(head(e)))) + ErasingResGraphWrapper::next(e); + return e; + } + + EachNodeIt& next(EachNodeIt& e) const { + return ErasingResGraphWrapper::next(e); + } + + OutEdgeIt& next(OutEdgeIt& e) const { + ErasingResGraphWrapper::next(e); + while (valid(e) && (dist.get(tail(e))+1!=dist.get(head(e)))) + ErasingResGraphWrapper::next(e); + return e; + } + + EachNodeIt& getFirst(EachNodeIt& n) const { + return ErasingResGraphWrapper::getFirst(n); + } + + void erase(const EdgeIt& e) { + OutEdgeIt f(e); + ErasingResGraphWrapper::next(f); + while (valid(f) && (dist.get(tail(f))+1!=dist.get(head(f)))) + ErasingResGraphWrapper::next(f); + first_out_edges.set(this->tail(e), f); + } + + //TrivGraphWrapper() : graph(0) { } + //TrivGraphWrapper(Graph& _graph) : graph(&_graph) { } + + //void setGraph(Graph& _graph) { graph = &_graph; } + //Graph& getGraph() const { return (*graph); } + + //template I& getFirst(I& i) const { return graph->getFirst(i); } + //template I& getFirst(I& i, const P& p) const { + // return graph->getFirst(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; getFirst(e); return e; } + + template< typename It > It first(const NodeIt& v) const { + It e; getFirst(e, v); return e; } + + //NodeIt head(const EdgeIt& e) const { return graph->head(e); } + //NodeIt tail(const EdgeIt& e) const { return graph->tail(e); } + + //template bool valid(const I& i) const + // { return graph->valid(i); } + + //template void setInvalid(const I &i); + //{ return graph->setInvalid(i); } + + //int nodeNum() const { return graph->nodeNum(); } + //int edgeNum() const { return graph->edgeNum(); } + + //template NodeIt aNode(const I& e) const { + // return graph->aNode(e); } + //template NodeIt bNode(const I& e) const { + // return graph->bNode(e); } + + //NodeIt addNode() const { return graph->addNode(); } + //EdgeIt addEdge(const NodeIt& tail, const NodeIt& head) const { + // return graph->addEdge(tail, head); } + + //template void erase(const I& i) const { graph->erase(i); } + + //void clear() const { graph->clear(); } + + template class NodeMap : public ErasingResGraphWrapper::NodeMap { + public: + NodeMap(const FilterGraphWrapper >& _G) : + ErasingResGraphWrapper::NodeMap(_G /*_G.getGraph()*/) { } + NodeMap(const FilterGraphWrapper >& _G, T a) : + ErasingResGraphWrapper::NodeMap(_G /*_G.getGraph()*/, a) { } + }; + + template class EdgeMap : public ErasingResGraphWrapper::EdgeMap { + public: + EdgeMap(const FilterGraphWrapper >& _G) : + ErasingResGraphWrapper::EdgeMap(_G /*_G.getGraph()*/) { } + EdgeMap(const FilterGraphWrapper >& _G, T a) : + ErasingResGraphWrapper::EdgeMap(_G /*_G.getGraph()*/, a) { } + }; + + public: + ErasingResGraphWrapper::NodeMap dist; };