# HG changeset patch # User Alpar Juttner # Date 1347530734 -7200 # Node ID 08712a8c3afecd618014042cfb0c4c2677f24e7c # Parent 2da3de1c0ebe070a465bc9c05e32eda1d97353ff# Parent 00f8d9f9920dc88cb0b570a6bb2a7fcfeebee715 Merge #449 to branch 1.2 diff -r 2da3de1c0ebe -r 08712a8c3afe lemon/adaptors.h --- a/lemon/adaptors.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/adaptors.h Thu Sep 13 12:05:34 2012 +0200 @@ -1371,7 +1371,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 @@ -2277,7 +2277,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 -r 2da3de1c0ebe -r 08712a8c3afe lemon/bits/bezier.h --- a/lemon/bits/bezier.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/bits/bezier.h Thu Sep 13 12:05:34 2012 +0200 @@ -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 -r 2da3de1c0ebe -r 08712a8c3afe lemon/bits/edge_set_extender.h --- a/lemon/bits/edge_set_extender.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/bits/edge_set_extender.h Thu Sep 13 12:05:34 2012 +0200 @@ -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 -r 2da3de1c0ebe -r 08712a8c3afe lemon/bits/graph_extender.h --- a/lemon/bits/graph_extender.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/bits/graph_extender.h Thu Sep 13 12:05:34 2012 +0200 @@ -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 -r 2da3de1c0ebe -r 08712a8c3afe lemon/circulation.h --- a/lemon/circulation.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/circulation.h Thu Sep 13 12:05:34 2012 +0200 @@ -572,8 +572,6 @@ { Node act; - Node bact=INVALID; - Node last_activated=INVALID; while((act=_level->highestActive())!=INVALID) { int actlevel=(*_level)[act]; int mlevel=_node_num; diff -r 2da3de1c0ebe -r 08712a8c3afe lemon/concept_check.h --- a/lemon/concept_check.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/concept_check.h Thu Sep 13 12:05:34 2012 +0200 @@ -35,6 +35,22 @@ */ template inline void ignore_unused_variable_warning(const T&) { } + template + inline void ignore_unused_variable_warning(const T1&, const T2&) { } + template + inline void ignore_unused_variable_warning(const T1&, const T2&, + const T3&) { } + template + inline void ignore_unused_variable_warning(const T1&, const T2&, + const T3&, const T4&) { } + template + inline void ignore_unused_variable_warning(const T1&, const T2&, + const T3&, const T4&, + const T5&) { } + template + inline void ignore_unused_variable_warning(const T1&, const T2&, + const T3&, const T4&, + const T5&, const T6&) { } ///\e template diff -r 2da3de1c0ebe -r 08712a8c3afe lemon/concepts/graph_components.h --- a/lemon/concepts/graph_components.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/concepts/graph_components.h Thu Sep 13 12:05:34 2012 +0200 @@ -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 -r 2da3de1c0ebe -r 08712a8c3afe lemon/concepts/maps.h --- a/lemon/concepts/maps.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/concepts/maps.h Thu Sep 13 12:05:34 2012 +0200 @@ -49,7 +49,7 @@ /// Returns the value associated with the given key. Value operator[](const Key &) const { - return *static_cast(0); + return *(static_cast(0)+1); } template diff -r 2da3de1c0ebe -r 08712a8c3afe lemon/graph_to_eps.h --- a/lemon/graph_to_eps.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/graph_to_eps.h Thu Sep 13 12:05:34 2012 +0200 @@ -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 -r 2da3de1c0ebe -r 08712a8c3afe lemon/planarity.h --- a/lemon/planarity.h Wed Sep 12 17:29:50 2012 +0200 +++ b/lemon/planarity.h Thu Sep 13 12:05:34 2012 +0200 @@ -72,7 +72,6 @@ } void discover(const Arc& arc) { - Node source = _graph.source(arc); Node target = _graph.target(arc); _tree_map[arc] = true; diff -r 2da3de1c0ebe -r 08712a8c3afe test/adaptors_test.cc --- a/test/adaptors_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/adaptors_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -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 -r 2da3de1c0ebe -r 08712a8c3afe test/bellman_ford_test.cc --- a/test/bellman_ford_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/bellman_ford_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -190,7 +190,7 @@ check(pathTarget(gr, p) == t, "path() found a wrong path."); ListPath path; - Value dist; + Value dist = 0; bool reached = bellmanFord(gr,length).path(path).dist(dist).run(s,t); check(reached && dist == -1, "Bellman-Ford found a wrong path."); diff -r 2da3de1c0ebe -r 08712a8c3afe test/connectivity_test.cc --- a/test/connectivity_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/connectivity_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -68,6 +68,7 @@ Digraph::NodeMap 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 -r 2da3de1c0ebe -r 08712a8c3afe test/digraph_test.cc --- a/test/digraph_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/digraph_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -64,6 +64,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); @@ -92,6 +93,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); @@ -125,6 +127,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); @@ -204,6 +207,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); @@ -251,6 +255,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); @@ -351,6 +356,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"); @@ -436,6 +442,7 @@ a2 = g.addArc(n2, n1), a3 = g.addArc(n2, n3), a4 = g.addArc(n2, n3); + ignore_unused_variable_warning(a2,a3,a4); digraphCopy(g, G).nodeRef(nref).run(); diff -r 2da3de1c0ebe -r 08712a8c3afe test/edge_set_test.cc --- a/test/edge_set_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/edge_set_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -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(); Digraph::Arc ga1 = digraph.addArc(n1, n2); + ignore_unused_variable_warning(ga1); EdgeSet edge_set(digraph); Digraph::Arc ga2 = digraph.addArc(n2, n1); + ignore_unused_variable_warning(ga2); checkGraphNodeList(edge_set, 2); checkGraphArcList(edge_set, 0); @@ -230,6 +240,8 @@ EdgeSet::Edge e2 = edge_set.addEdge(n2, n1), e3 = edge_set.addEdge(n2, n3), e4 = edge_set.addEdge(n2, n3); + ignore_unused_variable_warning(e2,e3,e4); + checkGraphNodeList(edge_set, 3); checkGraphEdgeList(edge_set, 4); @@ -274,10 +286,12 @@ n2 = digraph.addNode(); Digraph::Arc ga1 = digraph.addArc(n1, n2); + ignore_unused_variable_warning(ga1); EdgeSet edge_set(digraph); Digraph::Arc ga2 = digraph.addArc(n2, n1); + ignore_unused_variable_warning(ga2); checkGraphNodeList(edge_set, 2); checkGraphArcList(edge_set, 0); @@ -314,6 +328,8 @@ EdgeSet::Edge e2 = edge_set.addEdge(n2, n1), e3 = edge_set.addEdge(n2, n3), e4 = edge_set.addEdge(n2, n3); + ignore_unused_variable_warning(e2,e3,e4); + checkGraphNodeList(edge_set, 3); checkGraphEdgeList(edge_set, 4); diff -r 2da3de1c0ebe -r 08712a8c3afe test/euler_test.cc --- a/test/euler_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/euler_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -101,7 +101,8 @@ Digraph d; Graph g(d); Digraph::Node n = d.addNode(); - + ignore_unused_variable_warning(n); + checkDiEulerIt(d); checkDiEulerIt(g); checkEulerIt(g); @@ -189,6 +190,7 @@ Digraph::Node n3 = d.addNode(); Digraph::Node n4 = d.addNode(); Digraph::Node n5 = d.addNode(); + ignore_unused_variable_warning(n0,n4,n5); d.addArc(n1, n2); d.addArc(n2, n3); diff -r 2da3de1c0ebe -r 08712a8c3afe test/fractional_matching_test.cc --- a/test/fractional_matching_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/fractional_matching_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -342,6 +342,7 @@ check(indeg == 1, "Invalid matching"); pv += weight[mwfm.matching(n)]; SmartGraph::Node o = graph.target(mwfm.matching(n)); + ignore_unused_variable_warning(o); } else { check(mwfm.nodeValue(n) == 0, "Invalid matching"); check(indeg == 0, "Invalid matching"); @@ -406,6 +407,7 @@ check(indeg == 1, "Invalid perfect matching"); pv += weight[mwpfm.matching(n)]; SmartGraph::Node o = graph.target(mwpfm.matching(n)); + ignore_unused_variable_warning(o); } for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) { diff -r 2da3de1c0ebe -r 08712a8c3afe test/graph_test.cc --- a/test/graph_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/graph_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -66,6 +66,7 @@ Edge e2 = G.addEdge(n2, n1), e3 = G.addEdge(n2, n3); + ignore_unused_variable_warning(e2,e3); checkGraphNodeList(G, 3); checkGraphEdgeList(G, 3); @@ -98,6 +99,7 @@ Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1), e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4), e5 = G.addEdge(n4, n3); + ignore_unused_variable_warning(e1,e3,e4,e5); checkGraphNodeList(G, 4); checkGraphEdgeList(G, 5); @@ -177,6 +179,7 @@ Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1), e3 = G.addEdge(n2, n3), e4 = G.addEdge(n1, n4), e5 = G.addEdge(n4, n3); + ignore_unused_variable_warning(e1,e3,e4,e5); // Check edge deletion G.erase(e2); @@ -217,6 +220,7 @@ Node n1 = G.addNode(), n2 = G.addNode(), n3 = G.addNode(); Edge e1 = G.addEdge(n1, n2), e2 = G.addEdge(n2, n1), e3 = G.addEdge(n2, n3); + ignore_unused_variable_warning(e1,e2,e3); checkGraphNodeList(G, 3); checkGraphEdgeList(G, 3); @@ -381,6 +385,7 @@ Edge e1 = g.addEdge(n1, n2), e2 = g.addEdge(n2, n3); + ignore_unused_variable_warning(e2); check(g.valid(n1), "Wrong validity check"); check(g.valid(e1), "Wrong validity check"); @@ -519,6 +524,7 @@ checkGraphArcList(G, dim * (1 << dim)); Node n = G.nodeFromId(dim); + ignore_unused_variable_warning(n); for (NodeIt n(G); n != INVALID; ++n) { checkGraphIncEdgeList(G, n, dim); diff -r 2da3de1c0ebe -r 08712a8c3afe test/maps_test.cc --- a/test/maps_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/maps_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -103,6 +103,7 @@ checkConcept, NullMap >(); NullMap map1; NullMap map2 = map1; + ignore_unused_variable_warning(map2); map1 = nullMap(); } @@ -113,11 +114,15 @@ ConstMap map1; ConstMap map2 = B(); ConstMap map3 = map1; + ignore_unused_variable_warning(map2,map3); + map1 = constMap(B()); map1 = constMap(); map1.setAll(B()); ConstMap map4(C(1)); ConstMap map5 = map4; + ignore_unused_variable_warning(map5); + map4 = constMap(C(2)); map4.setAll(C(3)); @@ -138,6 +143,8 @@ checkConcept, IdentityMap >(); IdentityMap map1; IdentityMap map2 = map1; + ignore_unused_variable_warning(map2); + map1 = identityMap(); checkConcept, IdentityMap >(); @@ -197,7 +204,9 @@ typedef ComposeMap > CompMap; checkConcept, CompMap>(); CompMap map1 = CompMap(DoubleMap(),ReadMap()); + ignore_unused_variable_warning(map1); CompMap map2 = composeMap(DoubleMap(), ReadMap()); + ignore_unused_variable_warning(map2); SparseMap m1(false); m1[3.14] = true; RangeMap m2(2); m2[0] = 3.0; m2[1] = 3.14; @@ -210,7 +219,9 @@ typedef CombineMap > CombMap; checkConcept, CombMap>(); CombMap map1 = CombMap(DoubleMap(), DoubleMap()); + ignore_unused_variable_warning(map1); CombMap map2 = combineMap(DoubleMap(), DoubleMap(), std::plus()); + ignore_unused_variable_warning(map2); check(combineMap(constMap(), identityMap(), &binc)[B()] == 3, "Something is wrong with CombineMap"); @@ -222,11 +233,15 @@ checkConcept, FunctorToMap >(); FunctorToMap map1; FunctorToMap map2 = FunctorToMap(F()); + ignore_unused_variable_warning(map2); + B b = functorToMap(F())[A()]; + ignore_unused_variable_warning(b); checkConcept, MapToFunctor > >(); MapToFunctor > map = MapToFunctor >(ReadMap()); + ignore_unused_variable_warning(map); check(functorToMap(&func)[A()] == 3, "Something is wrong with FunctorToMap"); @@ -244,7 +259,10 @@ checkConcept, ConvertMap, double> >(); ConvertMap, int> map1(rangeMap(1, true)); + ignore_unused_variable_warning(map1); ConvertMap, int> map2 = convertMap(rangeMap(2, false)); + ignore_unused_variable_warning(map2); + } // ForkMap diff -r 2da3de1c0ebe -r 08712a8c3afe test/time_measure_test.cc --- a/test/time_measure_test.cc Wed Sep 12 17:29:50 2012 +0200 +++ b/test/time_measure_test.cc Thu Sep 13 12:05:34 2012 +0200 @@ -17,6 +17,7 @@ */ #include +#include using namespace lemon; @@ -32,7 +33,10 @@ static Timer T; for(int i=0;i<1000;i++) - TimeStamp x(T); + { + TimeStamp x(T); + ignore_unused_variable_warning(x); + } } int main()