COIN-OR::LEMON - Graph Library

Changeset 416:bb871cb8ac06 in lemon-1.0 for lemon


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

    r398 r416  
    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.