# HG changeset patch # User Balazs Dezso # Date 2008-07-10 16:03:23 # Node ID e3aba2c72be4499ade5628680b74f8f5c1ad802d # Parent e80e08222fdf7808460dffd57a003b595d0098da Bug fix in GraphCopy (ticket #117) diff --git a/lemon/graph_utils.h b/lemon/graph_utils.h --- a/lemon/graph_utils.h +++ b/lemon/graph_utils.h @@ -602,7 +602,7 @@ } for (typename From::ArcIt it(from); it != INVALID; ++it) { arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)], - nodeRefMap[from.target(it)]); + nodeRefMap[from.target(it)]); } } }; @@ -628,8 +628,8 @@ nodeRefMap[it] = to.addNode(); } for (typename From::EdgeIt it(from); it != INVALID; ++it) { - edgeRefMap[it] = to.addArc(nodeRefMap[from.source(it)], - nodeRefMap[from.target(it)]); + edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)], + nodeRefMap[from.v(it)]); } } }; @@ -925,9 +925,10 @@ typedef typename To::Arc Value; Value operator[](const Key& key) const { - bool forward = - (_from.direction(key) == - (_node_ref[_from.source(key)] == _to.source(_edge_ref[key]))); + bool forward = _from.u(key) != _from.v(key) ? + _node_ref[_from.source(key)] == + _to.source(_to.direct(_edge_ref[key], true)) : + _from.direction(key); return _to.direct(_edge_ref[key], forward); }