diff -r 0dade87d013b -r 7ac0d4e8a31c src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Thu Apr 15 08:06:43 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Thu Apr 15 14:41:20 2004 +0000 @@ -896,19 +896,20 @@ - template + template class ResGraphWrapper : public GraphWrapper { protected: // typedef typename Graph::OutEdgeIt GraphOutEdgeIt; // typedef typename Graph::InEdgeIt GraphInEdgeIt; // typedef typename Graph::Edge GraphEdge; + const CapacityMap* capacity; FlowMap* flow; - const CapacityMap* capacity; public: - ResGraphWrapper(Graph& _graph, FlowMap& _flow, - const CapacityMap& _capacity) : - GraphWrapper(_graph), flow(&_flow), capacity(&_capacity) { } + ResGraphWrapper(Graph& _graph, const CapacityMap& _capacity, + FlowMap& _flow) : + GraphWrapper(_graph), capacity(&_capacity), flow(&_flow) { } class Edge; class OutEdgeIt; @@ -918,7 +919,7 @@ typedef typename GraphWrapper::Node Node; typedef typename GraphWrapper::NodeIt NodeIt; class Edge : public Graph::Edge { - friend class ResGraphWrapper; + friend class ResGraphWrapper; protected: bool forward; //true, iff forward // typename Graph::Edge e; @@ -940,7 +941,7 @@ } }; // class Edge { -// friend class ResGraphWrapper; +// friend class ResGraphWrapper; // protected: // bool out_or_in; //true, iff out // GraphOutEdgeIt out; @@ -967,7 +968,7 @@ // } // }; class OutEdgeIt { - friend class ResGraphWrapper; + friend class ResGraphWrapper; protected: typename Graph::OutEdgeIt out; typename Graph::InEdgeIt in; @@ -978,7 +979,7 @@ // OutEdgeIt(const Edge& e) : Edge(e) { } OutEdgeIt(const Invalid& i) : out(i), in(i), forward(false) { } //the unique invalid iterator - OutEdgeIt(const ResGraphWrapper& resG, Node v) { + OutEdgeIt(const ResGraphWrapper& resG, Node v) { forward=true; resG.graph->first(out, v); while( resG.graph->valid(out) && !(resG.resCap(*this)>0) ) { resG.graph->next(out); } @@ -1000,13 +1001,13 @@ } }; // class OutEdgeIt : public Edge { -// friend class ResGraphWrapper; +// friend class ResGraphWrapper; // public: // OutEdgeIt() { } // //FIXME // OutEdgeIt(const Edge& e) : Edge(e) { } // OutEdgeIt(const Invalid& i) : Edge(i) { } -// OutEdgeIt(const ResGraphWrapper& resG, Node v) : Edge() { +// OutEdgeIt(const ResGraphWrapper& resG, Node v) : Edge() { // resG.graph->first(out, v); // while( resG.graph->valid(out) && !(resG.resCap(out)>0) ) { resG.graph->next(out); } // if (!resG.graph->valid(out)) { @@ -1038,7 +1039,7 @@ // class InEdgeIt : public Edge { }; class InEdgeIt { - friend class ResGraphWrapper; + friend class ResGraphWrapper; protected: typename Graph::OutEdgeIt out; typename Graph::InEdgeIt in; @@ -1049,7 +1050,7 @@ // OutEdgeIt(const Edge& e) : Edge(e) { } InEdgeIt(const Invalid& i) : out(i), in(i), forward(false) { } //the unique invalid iterator - InEdgeIt(const ResGraphWrapper& resG, Node v) { + InEdgeIt(const ResGraphWrapper& resG, Node v) { forward=true; resG.graph->first(in, v); while( resG.graph->valid(in) && !(resG.resCap(*this)>0) ) { resG.graph->next(in); } @@ -1072,14 +1073,14 @@ }; class EdgeIt { - friend class ResGraphWrapper; + friend class ResGraphWrapper; protected: typename Graph::EdgeIt e; bool forward; public: EdgeIt() { } EdgeIt(const Invalid& i) : e(i), forward(false) { } - EdgeIt(const ResGraphWrapper& resG) { + EdgeIt(const ResGraphWrapper& resG) { forward=true; resG.graph->first(e); while (resG.graph->valid(e) && !(resG.resCap(*this)>0)) resG.graph->next(e); @@ -1094,13 +1095,13 @@ } }; // class EdgeIt : public Edge { -// friend class ResGraphWrapper; +// friend class ResGraphWrapper; // NodeIt v; // public: // EdgeIt() { } // //EdgeIt(const EdgeIt& e) : Edge(e), v(e.v) { } // EdgeIt(const Invalid& i) : Edge(i) { } -// EdgeIt(const ResGraphWrapper& resG) : Edge() { +// EdgeIt(const ResGraphWrapper& resG) : Edge() { // resG.graph->first(v); // if (resG.graph->valid(v)) resG.graph->first(out, v); else out=INVALID; // while (resG.graph->valid(out) && !(resG.resCap(out)>0) ) { resG.graph->next(out); } @@ -1317,9 +1318,9 @@ // template class NodeMap : public Graph::NodeMap { // public: -// NodeMap(const ResGraphWrapper& _G) +// NodeMap(const ResGraphWrapper& _G) // : Graph::NodeMap(_G.gw) { } -// NodeMap(const ResGraphWrapper& _G, +// NodeMap(const ResGraphWrapper& _G, // T a) : Graph::NodeMap(_G.gw, a) { } // }; @@ -1337,8 +1338,8 @@ class EdgeMap { typename Graph::EdgeMap forward_map, backward_map; public: - EdgeMap(const ResGraphWrapper& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { } - EdgeMap(const ResGraphWrapper& _G, T a) : forward_map(*(_G.graph), a), backward_map(*(_G.graph), a) { } + EdgeMap(const ResGraphWrapper& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { } + EdgeMap(const ResGraphWrapper& _G, T a) : forward_map(*(_G.graph), a), backward_map(*(_G.graph), a) { } void set(Edge e, T a) { if (e.forward) forward_map.set(e.out, a);