[Lemon-commits] Balazs Dezso: Fix bug #83 in graph concept, exte...

Lemon HG hg at lemon.cs.elte.hu
Mon Apr 14 18:38:18 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/19e82bda606a
changeset: 125:19e82bda606a
user:      Balazs Dezso <deba [at] inf.elte.hu>
date:      Mon Apr 14 17:37:18 2008 +0100
description:
	Fix bug #83 in graph concept, extender and smart graph

diffstat:

4 files changed, 17 insertions(+), 17 deletions(-)
lemon/bits/graph_extender.h |   14 +++++++-------
lemon/concepts/digraph.h    |    8 ++++----
lemon/concepts/graph.h      |    8 ++++----
lemon/smart_graph.h         |    4 ++--

diffs (97 lines):

diff -r ae7785fe8431 -r 19e82bda606a lemon/bits/graph_extender.h
--- a/lemon/bits/graph_extender.h	Sat Apr 12 20:38:51 2008 +0100
+++ b/lemon/bits/graph_extender.h	Mon Apr 14 17:37:18 2008 +0100
@@ -367,10 +367,10 @@
     }
 
     Node oppositeNode(const Node &n, const Edge &e) const {
-      if( n == Parent::source(e))
-	return Parent::target(e);
-      else if( n == Parent::target(e))
-	return Parent::source(e);
+      if( n == Parent::u(e))
+	return Parent::v(e);
+      else if( n == Parent::v(e))
+	return Parent::u(e);
       else
 	return INVALID;
     }
@@ -381,7 +381,7 @@
 
     using Parent::direct;
     Arc direct(const Edge &edge, const Node &node) const {
-      return Parent::direct(edge, Parent::source(edge) == node);
+      return Parent::direct(edge, Parent::u(edge) == node);
     }
 
     // Alterable extension
@@ -586,13 +586,13 @@
     ///
     /// Returns the base node of the iterator
     Node baseNode(const IncEdgeIt &edge) const {
-      return edge._direction ? source(edge) : target(edge);
+      return edge._direction ? u(edge) : v(edge);
     }
     /// Running node of the iterator
     ///
     /// Returns the running node of the iterator
     Node runningNode(const IncEdgeIt &edge) const {
-      return edge._direction ? target(edge) : source(edge);
+      return edge._direction ? v(edge) : u(edge);
     }
 
     // Mappable extension
diff -r ae7785fe8431 -r 19e82bda606a lemon/concepts/digraph.h
--- a/lemon/concepts/digraph.h	Sat Apr 12 20:38:51 2008 +0100
+++ b/lemon/concepts/digraph.h	Mon Apr 14 17:37:18 2008 +0100
@@ -467,12 +467,12 @@
         }
       };
 
-      template <typename RDigraph>
+      template <typename _Digraph>
       struct Constraints {
         void constraints() {
-          checkConcept<IterableDigraphComponent<>, Digraph>();
-	  checkConcept<IDableDigraphComponent<>, Digraph>();
-          checkConcept<MappableDigraphComponent<>, Digraph>();
+          checkConcept<IterableDigraphComponent<>, _Digraph>();
+	  checkConcept<IDableDigraphComponent<>, _Digraph>();
+          checkConcept<MappableDigraphComponent<>, _Digraph>();
         }
       };
 
diff -r ae7785fe8431 -r 19e82bda606a lemon/concepts/graph.h
--- a/lemon/concepts/graph.h	Sat Apr 12 20:38:51 2008 +0100
+++ b/lemon/concepts/graph.h	Mon Apr 14 17:37:18 2008 +0100
@@ -731,12 +731,12 @@
 	return INVALID;
       }
 
-      template <typename Graph>
+      template <typename _Graph>
       struct Constraints {
 	void constraints() {
-	  checkConcept<IterableGraphComponent<>, Graph>();
-	  checkConcept<IDableGraphComponent<>, Graph>();
-	  checkConcept<MappableGraphComponent<>, Graph>();
+	  checkConcept<IterableGraphComponent<>, _Graph>();
+	  checkConcept<IDableGraphComponent<>, _Graph>();
+	  checkConcept<MappableGraphComponent<>, _Graph>();
 	}
       };
 
diff -r ae7785fe8431 -r 19e82bda606a lemon/smart_graph.h
--- a/lemon/smart_graph.h	Sat Apr 12 20:38:51 2008 +0100
+++ b/lemon/smart_graph.h	Mon Apr 14 17:37:18 2008 +0100
@@ -470,8 +470,8 @@
     Node source(Arc e) const { return Node(arcs[e._id ^ 1].target); }
     Node target(Arc e) const { return Node(arcs[e._id].target); }
 
-    Node source(Edge e) const { return Node(arcs[2 * e._id].target); }
-    Node target(Edge e) const { return Node(arcs[2 * e._id + 1].target); }
+    Node u(Edge e) const { return Node(arcs[2 * e._id].target); }
+    Node v(Edge e) const { return Node(arcs[2 * e._id + 1].target); }
 
     static bool direction(Arc e) {
       return (e._id & 1) == 1;



More information about the Lemon-commits mailing list