lemon/core.h
branch1.1
changeset 738 c85f53572941
parent 672 da70af8844b9
parent 731 bb871cb8ac06
child 761 f1398882a928
child 789 157427808b40
equal deleted inserted replaced
17:402aa7f485de 19:215d9fa38d48
   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)],