[Lemon-commits] Alpar Juttner: Merge #449 to branch 1.1

Lemon HG hg at lemon.cs.elte.hu
Fri Sep 14 13:32:38 CEST 2012


details:   http://lemon.cs.elte.hu/hg/lemon/rev/8d2e55fac752
changeset: 1158:8d2e55fac752
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Thu Sep 13 11:52:50 2012 +0200
description:
	Merge #449 to branch 1.1

diffstat:

 lemon/adaptors.h                  |   4 ++--
 lemon/bits/bezier.h               |   2 +-
 lemon/bits/edge_set_extender.h    |   4 ++--
 lemon/bits/graph_extender.h       |   4 ++--
 lemon/circulation.h               |   2 --
 lemon/concept_check.h             |  16 ++++++++++++++++
 lemon/concepts/graph_components.h |   4 ++++
 lemon/concepts/maps.h             |   2 +-
 lemon/graph_to_eps.h              |   2 +-
 test/adaptors_test.cc             |   3 +++
 test/connectivity_test.cc         |   2 ++
 test/digraph_test.cc              |   6 ++++++
 test/edge_set_test.cc             |  16 ++++++++++++++++
 test/euler_test.cc                |   4 +++-
 test/graph_test.cc                |   6 ++++++
 test/maps_test.cc                 |  18 ++++++++++++++++++
 test/time_measure_test.cc         |   6 +++++-
 17 files changed, 88 insertions(+), 13 deletions(-)

diffs (truncated from 520 to 300 lines):

diff --git a/lemon/adaptors.h b/lemon/adaptors.h
--- a/lemon/adaptors.h
+++ b/lemon/adaptors.h
@@ -1364,7 +1364,7 @@
     /// Creates a subgraph for the given graph with the given node
     /// and edge filter maps.
     SubGraph(GR& graph, NF& node_filter, EF& edge_filter) {
-      initialize(graph, node_filter, edge_filter);
+      this->initialize(graph, node_filter, edge_filter);
     }
 
     /// \brief Sets the status of the given node
@@ -2261,7 +2261,7 @@
     ///
     /// Creates an undirected graph from the given digraph.
     Undirector(DGR& digraph) {
-      initialize(digraph);
+      this->initialize(digraph);
     }
 
     /// \brief Arc map combined from two original arc maps
diff --git a/lemon/bits/bezier.h b/lemon/bits/bezier.h
--- a/lemon/bits/bezier.h
+++ b/lemon/bits/bezier.h
@@ -159,7 +159,7 @@
     const Point c=(p3+p4)/2;
     const Point d=(a+b)/2;
     const Point e=(b+c)/2;
-    const Point f=(d+e)/2;
+    // const Point f=(d+e)/2;
     R f1=_f(Bezier3(p1,a,d,e),_d);
     R f2=_f(Bezier3(e,d,c,p4),_d);
     return _s(f1,f2);
diff --git a/lemon/bits/edge_set_extender.h b/lemon/bits/edge_set_extender.h
--- a/lemon/bits/edge_set_extender.h
+++ b/lemon/bits/edge_set_extender.h
@@ -523,13 +523,13 @@
     //
     // Returns the base node of the iterator
     Node baseNode(const IncEdgeIt &e) const {
-      return e.direction ? u(e) : v(e);
+      return e.direction ? this->u(e) : this->v(e);
     }
     // Running node of the iterator
     //
     // Returns the running node of the iterator
     Node runningNode(const IncEdgeIt &e) const {
-      return e.direction ? v(e) : u(e);
+      return e.direction ? this->v(e) : this->u(e);
     }
 
 
diff --git a/lemon/bits/graph_extender.h b/lemon/bits/graph_extender.h
--- a/lemon/bits/graph_extender.h
+++ b/lemon/bits/graph_extender.h
@@ -587,13 +587,13 @@
     //
     // Returns the base node of the iterator
     Node baseNode(const IncEdgeIt &edge) const {
-      return edge._direction ? u(edge) : v(edge);
+      return edge._direction ? this->u(edge) : this->v(edge);
     }
     // Running node of the iterator
     //
     // Returns the running node of the iterator
     Node runningNode(const IncEdgeIt &edge) const {
-      return edge._direction ? v(edge) : u(edge);
+      return edge._direction ? this->v(edge) : this->u(edge);
     }
 
     // Mappable extension
diff --git a/lemon/circulation.h b/lemon/circulation.h
--- a/lemon/circulation.h
+++ b/lemon/circulation.h
@@ -558,8 +558,6 @@
     {
 
       Node act;
-      Node bact=INVALID;
-      Node last_activated=INVALID;
       while((act=_level->highestActive())!=INVALID) {
         int actlevel=(*_level)[act];
         int mlevel=_node_num;
diff --git a/lemon/concept_check.h b/lemon/concept_check.h
--- a/lemon/concept_check.h
+++ b/lemon/concept_check.h
@@ -35,6 +35,22 @@
   */
 
   template <class T> inline void ignore_unused_variable_warning(const T&) { }
+  template <class T1, class T2>
+  inline void ignore_unused_variable_warning(const T1&, const T2&) { }
+  template <class T1, class T2, class T3>
+  inline void ignore_unused_variable_warning(const T1&, const T2&,
+                                             const T3&) { }
+  template <class T1, class T2, class T3, class T4>
+  inline void ignore_unused_variable_warning(const T1&, const T2&,
+                                             const T3&, const T4&) { }
+  template <class T1, class T2, class T3, class T4, class T5>
+  inline void ignore_unused_variable_warning(const T1&, const T2&,
+                                             const T3&, const T4&,
+                                             const T5&) { }
+  template <class T1, class T2, class T3, class T4, class T5, class T6>
+  inline void ignore_unused_variable_warning(const T1&, const T2&,
+                                             const T3&, const T4&,
+                                             const T5&, const T6&) { }
 
   ///\e
   template <class Concept>
diff --git a/lemon/concepts/graph_components.h b/lemon/concepts/graph_components.h
--- a/lemon/concepts/graph_components.h
+++ b/lemon/concepts/graph_components.h
@@ -494,6 +494,8 @@
           _GraphItemIt it2;
           _GraphItemIt it3 = it1;
           _GraphItemIt it4 = INVALID;
+          ignore_unused_variable_warning(it3);
+          ignore_unused_variable_warning(it4);
 
           it2 = ++it1;
           ++it2 = it1;
@@ -583,6 +585,8 @@
           _GraphIncIt it2;
           _GraphIncIt it3 = it1;
           _GraphIncIt it4 = INVALID;
+          ignore_unused_variable_warning(it3);
+          ignore_unused_variable_warning(it4);
 
           it2 = ++it1;
           ++it2 = it1;
diff --git a/lemon/concepts/maps.h b/lemon/concepts/maps.h
--- a/lemon/concepts/maps.h
+++ b/lemon/concepts/maps.h
@@ -49,7 +49,7 @@
 
       /// Returns the value associated with the given key.
       Value operator[](const Key &) const {
-        return *static_cast<Value *>(0);
+        return *(static_cast<Value *>(0)+1);
       }
 
       template<typename _ReadMap>
diff --git a/lemon/graph_to_eps.h b/lemon/graph_to_eps.h
--- a/lemon/graph_to_eps.h
+++ b/lemon/graph_to_eps.h
@@ -222,7 +222,7 @@
   using T::_title;
   using T::_copyright;
 
-  using T::NodeTextColorType;
+  using typename T::NodeTextColorType;
   using T::CUST_COL;
   using T::DIST_COL;
   using T::DIST_BW;
diff --git a/test/adaptors_test.cc b/test/adaptors_test.cc
--- a/test/adaptors_test.cc
+++ b/test/adaptors_test.cc
@@ -65,6 +65,7 @@
   Digraph::Arc a1 = digraph.addArc(n1, n2);
   Digraph::Arc a2 = digraph.addArc(n1, n3);
   Digraph::Arc a3 = digraph.addArc(n2, n3);
+  ignore_unused_variable_warning(a3);
 
   // Check the adaptor
   checkGraphNodeList(adaptor, 3);
@@ -99,6 +100,7 @@
   Adaptor::Arc a6 = adaptor.addArc(n2, n4);
   Adaptor::Arc a7 = adaptor.addArc(n1, n4);
   Adaptor::Arc a8 = adaptor.addArc(n1, n2);
+  ignore_unused_variable_warning(a6,a7,a8);
 
   adaptor.erase(a1);
   adaptor.erase(n3);
@@ -758,6 +760,7 @@
   Digraph::Arc a1 = digraph.addArc(n1, n2);
   Digraph::Arc a2 = digraph.addArc(n1, n3);
   Digraph::Arc a3 = digraph.addArc(n2, n3);
+  ignore_unused_variable_warning(a1,a2,a3);
 
   checkGraphNodeList(adaptor, 6);
   checkGraphArcList(adaptor, 6);
diff --git a/test/connectivity_test.cc b/test/connectivity_test.cc
--- a/test/connectivity_test.cc
+++ b/test/connectivity_test.cc
@@ -68,6 +68,7 @@
     Digraph::NodeMap<int> order(d);
     Graph g(d);
     Digraph::Node n = d.addNode();
+    ignore_unused_variable_warning(n);
 
     check(stronglyConnected(d), "This digraph is strongly connected");
     check(countStronglyConnectedComponents(d) == 1,
@@ -245,6 +246,7 @@
     Digraph::Node shoe = d.addNode();
     Digraph::Node watch = d.addNode();
     Digraph::Node pants = d.addNode();
+    ignore_unused_variable_warning(watch);
 
     d.addArc(socks, shoe);
     d.addArc(pants, shoe);
diff --git a/test/digraph_test.cc b/test/digraph_test.cc
--- a/test/digraph_test.cc
+++ b/test/digraph_test.cc
@@ -60,6 +60,7 @@
   Arc a2 = G.addArc(n2, n1),
       a3 = G.addArc(n2, n3),
       a4 = G.addArc(n2, n3);
+  ignore_unused_variable_warning(a2,a3,a4);
 
   checkGraphNodeList(G, 3);
   checkGraphArcList(G, 4);
@@ -88,6 +89,7 @@
   Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode();
   Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
       a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
+  ignore_unused_variable_warning(a1,a2,a3,a4);
 
   Node n4 = G.split(n2);
 
@@ -121,6 +123,7 @@
   Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n4, n1),
       a3 = G.addArc(n4, n3), a4 = G.addArc(n4, n3),
       a5 = G.addArc(n2, n4);
+  ignore_unused_variable_warning(a1,a2,a3,a5);
 
   checkGraphNodeList(G, 4);
   checkGraphArcList(G, 5);
@@ -200,6 +203,7 @@
   Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n4, n1),
       a3 = G.addArc(n4, n3), a4 = G.addArc(n3, n1),
       a5 = G.addArc(n2, n4);
+  ignore_unused_variable_warning(a2,a3,a4,a5);
 
   // Check arc deletion
   G.erase(a1);
@@ -247,6 +251,7 @@
   Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode();
   Arc a1 = G.addArc(n1, n2), a2 = G.addArc(n2, n1),
       a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3);
+  ignore_unused_variable_warning(a1,a2,a3,a4);
 
   typename Digraph::Snapshot snapshot(G);
 
@@ -335,6 +340,7 @@
   Arc
     e1 = g.addArc(n1, n2),
     e2 = g.addArc(n2, n3);
+  ignore_unused_variable_warning(e2);
 
   check(g.valid(n1), "Wrong validity check");
   check(g.valid(e1), "Wrong validity check");
diff --git a/test/edge_set_test.cc b/test/edge_set_test.cc
--- a/test/edge_set_test.cc
+++ b/test/edge_set_test.cc
@@ -44,10 +44,12 @@
     n2 = digraph.addNode();
 
   Digraph::Arc ga1 = digraph.addArc(n1, n2);
+  ignore_unused_variable_warning(ga1);
 
   ArcSet arc_set(digraph);
 
   Digraph::Arc ga2 = digraph.addArc(n2, n1);
+  ignore_unused_variable_warning(ga2);
 
   checkGraphNodeList(arc_set, 2);
   checkGraphArcList(arc_set, 0);
@@ -75,6 +77,8 @@
   ArcSet::Arc a2 = arc_set.addArc(n2, n1),
     a3 = arc_set.addArc(n2, n3),
     a4 = arc_set.addArc(n2, n3);
+  ignore_unused_variable_warning(a2,a3,a4);
+
   checkGraphNodeList(arc_set, 3);
   checkGraphArcList(arc_set, 4);
 
@@ -110,10 +114,12 @@
     n2 = digraph.addNode();
 
   Digraph::Arc ga1 = digraph.addArc(n1, n2);
+  ignore_unused_variable_warning(ga1);
 
   ArcSet arc_set(digraph);
 
   Digraph::Arc ga2 = digraph.addArc(n2, n1);
+  ignore_unused_variable_warning(ga2);
 
   checkGraphNodeList(arc_set, 2);
   checkGraphArcList(arc_set, 0);
@@ -141,6 +147,8 @@
   ArcSet::Arc a2 = arc_set.addArc(n2, n1),
     a3 = arc_set.addArc(n2, n3),
     a4 = arc_set.addArc(n2, n3);
+  ignore_unused_variable_warning(a2,a3,a4);
+
   checkGraphNodeList(arc_set, 3);
   checkGraphArcList(arc_set, 4);
 
@@ -190,10 +198,12 @@
     n2 = digraph.addNode();



More information about the Lemon-commits mailing list