Changeset 2529:93de38566e6c in lemon-0.x for lemon/graph_adaptor.h
- Timestamp:
- 11/30/07 10:22:38 (17 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3405
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/graph_adaptor.h
r2422 r2529 35 35 #include <lemon/bits/graph_adaptor_extender.h> 36 36 #include <lemon/bits/graph_extender.h> 37 38 37 #include <lemon/tolerance.h> 39 38 … … 948 947 ///Graph::EdgeMap<int> flow(g, 0); 949 948 /// 950 ///Preflow<SubGA, int,ConstMap<Edge, int>, Graph::EdgeMap<int> >951 /// preflow(ga, s, t, const_1_map, flow);949 ///Preflow<SubGA, ConstMap<Edge, int>, Graph::EdgeMap<int> > 950 /// preflow(ga, const_1_map, s, t); 952 951 ///preflow.run(); 953 952 ///\endcode … … 959 958 /// << endl; 960 959 ///for(EdgeIt e(g); e!=INVALID; ++e) 961 /// if ( flow[e])960 /// if (preflow.flow(e)) 962 961 /// cout << " " << g.id(g.source(e)) << "--" 963 962 /// << length[e] << "->" << g.id(g.target(e)) << endl; … … 2022 2021 return INVALID; 2023 2022 } 2023 2024 2024 2025 2025 template <typename T> … … 2031 2031 NodeMap(const SplitGraphAdaptorBase& _graph, const T& t) 2032 2032 : inNodeMap(_graph, t), outNodeMap(_graph, t) {} 2033 2033 NodeMap& operator=(const NodeMap& cmap) { 2034 return operator=<NodeMap>(cmap); 2035 } 2036 template <typename CMap> 2037 NodeMap& operator=(const CMap& cmap) { 2038 Parent::operator=(cmap); 2039 return *this; 2040 } 2041 2034 2042 void set(const Node& key, const T& val) { 2035 2043 if (SplitGraphAdaptorBase::inNode(key)) { inNodeMap.set(key, val); } … … 2063 2071 EdgeMap(const SplitGraphAdaptorBase& _graph, const T& t) 2064 2072 : edge_map(_graph, t), node_map(_graph, t) {} 2073 EdgeMap& operator=(const EdgeMap& cmap) { 2074 return operator=<EdgeMap>(cmap); 2075 } 2076 template <typename CMap> 2077 EdgeMap& operator=(const CMap& cmap) { 2078 Parent::operator=(cmap); 2079 return *this; 2080 } 2065 2081 2066 2082 void set(const Edge& key, const T& val) { … … 2471 2487 /// SGraph::EdgeMap<int> sflow(sgraph); 2472 2488 /// 2473 /// Preflow<SGraph, int,SCapacity>2474 /// spreflow(sgraph, SGraph::outNode(source),SGraph::inNode(target),2475 /// scapacity, sflow);2489 /// Preflow<SGraph, SCapacity> 2490 /// spreflow(sgraph, scapacity, 2491 /// SGraph::outNode(source), SGraph::inNode(target)); 2476 2492 /// 2477 2493 /// spreflow.run();
Note: See TracChangeset
for help on using the changeset viewer.