COIN-OR::LEMON - Graph Library

Changeset 731:bb871cb8ac06 in lemon-1.1 for lemon


Ignore:
Timestamp:
06/22/10 15:39:26 (14 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Children:
734:9f22c22fe227, 737: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

    r634 r731  
    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.