lemon/core.h
changeset 416 bb871cb8ac06
parent 398 32fb28fc9d42
child 427 c59bdcc8e33e
equal deleted inserted replaced
10:4d343ae18379 11:6245d5a2dcd6
   382     template <typename Digraph, typename Enable = void>
   382     template <typename Digraph, typename Enable = void>
   383     struct DigraphCopySelector {
   383     struct DigraphCopySelector {
   384       template <typename From, typename NodeRefMap, typename ArcRefMap>
   384       template <typename From, typename NodeRefMap, typename ArcRefMap>
   385       static void copy(const From& from, Digraph &to,
   385       static void copy(const From& from, Digraph &to,
   386                        NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
   386                        NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
       
   387         to.clear();
   387         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   388         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   388           nodeRefMap[it] = to.addNode();
   389           nodeRefMap[it] = to.addNode();
   389         }
   390         }
   390         for (typename From::ArcIt it(from); it != INVALID; ++it) {
   391         for (typename From::ArcIt it(from); it != INVALID; ++it) {
   391           arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)],
   392           arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)],
   409     template <typename Graph, typename Enable = void>
   410     template <typename Graph, typename Enable = void>
   410     struct GraphCopySelector {
   411     struct GraphCopySelector {
   411       template <typename From, typename NodeRefMap, typename EdgeRefMap>
   412       template <typename From, typename NodeRefMap, typename EdgeRefMap>
   412       static void copy(const From& from, Graph &to,
   413       static void copy(const From& from, Graph &to,
   413                        NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
   414                        NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
       
   415         to.clear();
   414         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   416         for (typename From::NodeIt it(from); it != INVALID; ++it) {
   415           nodeRefMap[it] = to.addNode();
   417           nodeRefMap[it] = to.addNode();
   416         }
   418         }
   417         for (typename From::EdgeIt it(from); it != INVALID; ++it) {
   419         for (typename From::EdgeIt it(from); it != INVALID; ++it) {
   418           edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)],
   420           edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)],