lemon/core.h
branch1.2
changeset 896 e958855b8186
parent 877 141f9c0db4a3
parent 893 bb871cb8ac06
child 944 02c93d1f00d7
equal deleted inserted replaced
18:0800646476d7 20:d36623dbff37
   392     template <typename Digraph, typename Enable = void>
   392     template <typename Digraph, typename Enable = void>
   393     struct DigraphCopySelector {
   393     struct DigraphCopySelector {
   394       template <typename From, typename NodeRefMap, typename ArcRefMap>
   394       template <typename From, typename NodeRefMap, typename ArcRefMap>
   395       static void copy(const From& from, Digraph &to,
   395       static void copy(const From& from, Digraph &to,
   396                        NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
   396                        NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
       
   397         to.clear();
   397         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   398         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   398           nodeRefMap[it] = to.addNode();
   399           nodeRefMap[it] = to.addNode();
   399         }
   400         }
   400         for (typename From::ArcIt it(from); it != INVALID; ++it) {
   401         for (typename From::ArcIt it(from); it != INVALID; ++it) {
   401           arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)],
   402           arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)],
   419     template <typename Graph, typename Enable = void>
   420     template <typename Graph, typename Enable = void>
   420     struct GraphCopySelector {
   421     struct GraphCopySelector {
   421       template <typename From, typename NodeRefMap, typename EdgeRefMap>
   422       template <typename From, typename NodeRefMap, typename EdgeRefMap>
   422       static void copy(const From& from, Graph &to,
   423       static void copy(const From& from, Graph &to,
   423                        NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
   424                        NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
       
   425         to.clear();
   424         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   426         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   425           nodeRefMap[it] = to.addNode();
   427           nodeRefMap[it] = to.addNode();
   426         }
   428         }
   427         for (typename From::EdgeIt it(from); it != INVALID; ++it) {
   429         for (typename From::EdgeIt it(from); it != INVALID; ++it) {
   428           edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)],
   430           edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)],