diff -r e6bc5c0032e9 -r 93de38566e6c lemon/graph_adaptor.h --- a/lemon/graph_adaptor.h Wed Nov 28 18:05:49 2007 +0000 +++ b/lemon/graph_adaptor.h Fri Nov 30 09:22:38 2007 +0000 @@ -34,7 +34,6 @@ #include #include #include - #include #include @@ -947,8 +946,8 @@ ///ConstMap const_1_map(1); ///Graph::EdgeMap flow(g, 0); /// - ///Preflow, Graph::EdgeMap > - /// preflow(ga, s, t, const_1_map, flow); + ///Preflow, Graph::EdgeMap > + /// preflow(ga, const_1_map, s, t); ///preflow.run(); ///\endcode ///Last, the output is: @@ -958,7 +957,7 @@ ///cout << "edges of the maximum number of edge-disjoint shortest s-t paths: " /// << endl; ///for(EdgeIt e(g); e!=INVALID; ++e) - /// if (flow[e]) + /// if (preflow.flow(e)) /// cout << " " << g.id(g.source(e)) << "--" /// << length[e] << "->" << g.id(g.target(e)) << endl; ///\endcode @@ -2021,6 +2020,7 @@ } return INVALID; } + template class NodeMap : public MapBase { @@ -2030,7 +2030,15 @@ : inNodeMap(_graph), outNodeMap(_graph) {} NodeMap(const SplitGraphAdaptorBase& _graph, const T& t) : inNodeMap(_graph, t), outNodeMap(_graph, t) {} - + NodeMap& operator=(const NodeMap& cmap) { + return operator=(cmap); + } + template + NodeMap& operator=(const CMap& cmap) { + Parent::operator=(cmap); + return *this; + } + void set(const Node& key, const T& val) { if (SplitGraphAdaptorBase::inNode(key)) { inNodeMap.set(key, val); } else {outNodeMap.set(key, val); } @@ -2062,6 +2070,14 @@ : edge_map(_graph), node_map(_graph) {} EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t) : edge_map(_graph, t), node_map(_graph, t) {} + EdgeMap& operator=(const EdgeMap& cmap) { + return operator=(cmap); + } + template + EdgeMap& operator=(const CMap& cmap) { + Parent::operator=(cmap); + return *this; + } void set(const Edge& key, const T& val) { if (SplitGraphAdaptorBase::origEdge(key)) { @@ -2470,9 +2486,9 @@ /// /// SGraph::EdgeMap sflow(sgraph); /// - /// Preflow - /// spreflow(sgraph, SGraph::outNode(source),SGraph::inNode(target), - /// scapacity, sflow); + /// Preflow + /// spreflow(sgraph, scapacity, + /// SGraph::outNode(source), SGraph::inNode(target)); /// /// spreflow.run(); ///