lemon/core.h
changeset 914 35ba7236bd67
parent 883 dc376822c17d
parent 890 bb871cb8ac06
child 919 e0cef67fe565
equal deleted inserted replaced
19:22d185f7fe69 21:6dfad6d75eb3
   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)],