lemon/graph_adaptor.h
changeset 2529 93de38566e6c
parent 2422 77ed2b97abbd
child 2553 bfced05fa852
     1.1 --- a/lemon/graph_adaptor.h	Wed Nov 28 18:05:49 2007 +0000
     1.2 +++ b/lemon/graph_adaptor.h	Fri Nov 30 09:22:38 2007 +0000
     1.3 @@ -34,7 +34,6 @@
     1.4  #include <lemon/bits/base_extender.h>
     1.5  #include <lemon/bits/graph_adaptor_extender.h>
     1.6  #include <lemon/bits/graph_extender.h>
     1.7 -
     1.8  #include <lemon/tolerance.h>
     1.9  
    1.10  #include <algorithm>
    1.11 @@ -947,8 +946,8 @@
    1.12    ///ConstMap<Edge, int> const_1_map(1);
    1.13    ///Graph::EdgeMap<int> flow(g, 0);
    1.14    ///
    1.15 -  ///Preflow<SubGA, int, ConstMap<Edge, int>, Graph::EdgeMap<int> > 
    1.16 -  ///  preflow(ga, s, t, const_1_map, flow);
    1.17 +  ///Preflow<SubGA, ConstMap<Edge, int>, Graph::EdgeMap<int> > 
    1.18 +  ///  preflow(ga, const_1_map, s, t);
    1.19    ///preflow.run();
    1.20    ///\endcode
    1.21    ///Last, the output is:
    1.22 @@ -958,7 +957,7 @@
    1.23    ///cout << "edges of the maximum number of edge-disjoint shortest s-t paths: " 
    1.24    ///     << endl;
    1.25    ///for(EdgeIt e(g); e!=INVALID; ++e) 
    1.26 -  ///  if (flow[e])
    1.27 +  ///  if (preflow.flow(e))
    1.28    ///    cout << " " << g.id(g.source(e)) << "--"
    1.29    ///         << length[e] << "->" << g.id(g.target(e)) << endl;
    1.30    ///\endcode
    1.31 @@ -2021,6 +2020,7 @@
    1.32        }
    1.33        return INVALID;
    1.34      }
    1.35 +
    1.36      
    1.37      template <typename T>
    1.38      class NodeMap : public MapBase<Node, T> {
    1.39 @@ -2030,7 +2030,15 @@
    1.40  	: inNodeMap(_graph), outNodeMap(_graph) {}
    1.41        NodeMap(const SplitGraphAdaptorBase& _graph, const T& t) 
    1.42  	: inNodeMap(_graph, t), outNodeMap(_graph, t) {}
    1.43 -      
    1.44 +      NodeMap& operator=(const NodeMap& cmap) {
    1.45 +        return operator=<NodeMap>(cmap);
    1.46 +      }
    1.47 +      template <typename CMap>
    1.48 +      NodeMap& operator=(const CMap& cmap) {
    1.49 +        Parent::operator=(cmap);
    1.50 +        return *this;
    1.51 +      }
    1.52 +
    1.53        void set(const Node& key, const T& val) {
    1.54  	if (SplitGraphAdaptorBase::inNode(key)) { inNodeMap.set(key, val); }
    1.55  	else {outNodeMap.set(key, val); }
    1.56 @@ -2062,6 +2070,14 @@
    1.57  	: edge_map(_graph), node_map(_graph) {}
    1.58        EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t) 
    1.59  	: edge_map(_graph, t), node_map(_graph, t) {}
    1.60 +      EdgeMap& operator=(const EdgeMap& cmap) {
    1.61 +        return operator=<EdgeMap>(cmap);
    1.62 +      }
    1.63 +      template <typename CMap>
    1.64 +      EdgeMap& operator=(const CMap& cmap) {
    1.65 +        Parent::operator=(cmap);
    1.66 +        return *this;
    1.67 +      }
    1.68        
    1.69        void set(const Edge& key, const T& val) {
    1.70  	if (SplitGraphAdaptorBase::origEdge(key)) { 
    1.71 @@ -2470,9 +2486,9 @@
    1.72    ///
    1.73    /// SGraph::EdgeMap<int> sflow(sgraph);
    1.74    ///
    1.75 -  /// Preflow<SGraph, int, SCapacity> 
    1.76 -  ///   spreflow(sgraph, SGraph::outNode(source),SGraph::inNode(target),  
    1.77 -  ///            scapacity, sflow);
    1.78 +  /// Preflow<SGraph, SCapacity> 
    1.79 +  ///   spreflow(sgraph, scapacity, 
    1.80 +  ///            SGraph::outNode(source), SGraph::inNode(target));
    1.81    ///                                            
    1.82    /// spreflow.run();
    1.83    ///