[Lemon-commits] Balazs Dezso: Bug fix in GraphCopy (ticket #117)

Lemon HG hg at lemon.cs.elte.hu
Thu Jul 10 16:14:25 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/e3aba2c72be4
changeset: 199:e3aba2c72be4
user:      Balazs Dezso <deba [at] inf.elte.hu>
date:      Thu Jul 10 16:03:23 2008 +0200
description:
	Bug fix in GraphCopy (ticket #117)

diffstat:

1 file changed, 7 insertions(+), 6 deletions(-)
lemon/graph_utils.h |   13 +++++++------

diffs (37 lines):

diff -r e80e08222fdf -r e3aba2c72be4 lemon/graph_utils.h
--- a/lemon/graph_utils.h	Wed Jul 09 07:57:53 2008 +0200
+++ b/lemon/graph_utils.h	Thu Jul 10 16:03:23 2008 +0200
@@ -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); 
       }
       



More information about the Lemon-commits mailing list