COIN-OR::LEMON - Graph Library

Changeset 893:bb871cb8ac06 in lemon-1.2 for lemon/core.h


Ignore:
Timestamp:
06/22/10 15:39:26 (9 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Children:
896:e958855b8186, 899:e24922c56bc2
Phase:
public
Message:

Bug fix in (di)graphCopy() (#371)

The target graph is cleared before adding nodes and arcs/edges.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/core.h

    r501 r893  
    385385      static void copy(const From& from, Digraph &to,
    386386                       NodeRefMap& nodeRefMap, ArcRefMap& arcRefMap) {
     387        to.clear();
    387388        for (typename From::NodeIt it(from); it != INVALID; ++it) {
    388389          nodeRefMap[it] = to.addNode();
     
    412413      static void copy(const From& from, Graph &to,
    413414                       NodeRefMap& nodeRefMap, EdgeRefMap& edgeRefMap) {
     415        to.clear();
    414416        for (typename From::NodeIt it(from); it != INVALID; ++it) {
    415417          nodeRefMap[it] = to.addNode();
Note: See TracChangeset for help on using the changeset viewer.