# HG changeset patch # User Alpar Juttner # Date 1242204614 -3600 # Node ID 06f816565bef381024acd7c15beb74ba407e3546 # Parent c01a98ce01fd88fb40ab5e4b1e2c0c5be2ad93b5# Parent 926c47568a563c11643a5ba30f4dc2c28624b361 Merge various fixes diff -r c01a98ce01fd -r 06f816565bef CMakeLists.txt --- a/CMakeLists.txt Tue May 12 12:09:55 2009 +0100 +++ b/CMakeLists.txt Wed May 13 09:50:14 2009 +0100 @@ -18,10 +18,11 @@ FIND_PACKAGE(COIN) IF(MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996") # Suppressed warnings: # C4250: 'class1' : inherits 'class2::member' via dominance # C4355: 'this' : used in base member initializer list +# C4503: 'function' : decorated name length exceeded, name was truncated # C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning) # C4996: 'function': was declared deprecated ENDIF(MSVC) diff -r c01a98ce01fd -r 06f816565bef lemon/Makefile.am --- a/lemon/Makefile.am Tue May 12 12:09:55 2009 +0100 +++ b/lemon/Makefile.am Wed May 13 09:50:14 2009 +0100 @@ -1,6 +1,7 @@ EXTRA_DIST += \ lemon/lemon.pc.in \ - lemon/CMakeLists.txt + lemon/CMakeLists.txt \ + lemon/config.h.cmake pkgconfig_DATA += lemon/lemon.pc @@ -16,7 +17,7 @@ lemon/bits/windows.cc nodist_lemon_HEADERS = lemon/config.h - + lemon_libemon_la_CXXFLAGS = \ $(AM_CXXFLAGS) \ $(GLPK_CFLAGS) \ diff -r c01a98ce01fd -r 06f816565bef lemon/concepts/graph_components.h --- a/lemon/concepts/graph_components.h Tue May 12 12:09:55 2009 +0100 +++ b/lemon/concepts/graph_components.h Wed May 13 09:50:14 2009 +0100 @@ -71,6 +71,11 @@ /// Assignment operator for the item. GraphItem& operator=(const GraphItem&) { return *this; } + /// \brief Assignment operator for INVALID. + /// + /// This operator makes the item invalid. + GraphItem& operator=(Invalid) { return *this; } + /// \brief Equality operator. /// /// Equality operator. @@ -96,6 +101,7 @@ struct Constraints { void constraints() { _GraphItem i1; + i1=INVALID; _GraphItem i2 = i1; _GraphItem i3 = INVALID; @@ -221,14 +227,7 @@ /// Besides the core graph item functionality each arc should /// be convertible to the represented edge. Edge(const Arc&) {} - - /// \brief Assign an arc to an edge. - /// - /// This function assigns an arc to an edge. - /// Besides the core graph item functionality each arc should - /// be convertible to the represented edge. - Edge& operator=(const Arc&) { return *this; } - }; + }; /// \brief Return one end node of an edge. /// @@ -353,10 +352,12 @@ void constraints() { checkConcept(); typename _Digraph::Node node; + node=INVALID; int nid = digraph.id(node); nid = digraph.id(node); node = digraph.nodeFromId(nid); typename _Digraph::Arc arc; + arc=INVALID; int eid = digraph.id(arc); eid = digraph.id(arc); arc = digraph.arcFromId(eid); diff -r c01a98ce01fd -r 06f816565bef lemon/edge_set.h --- a/lemon/edge_set.h Tue May 12 12:09:55 2009 +0100 +++ b/lemon/edge_set.h Wed May 13 09:50:14 2009 +0100 @@ -84,6 +84,12 @@ ListArcSetBase() : first_arc(-1), first_free_arc(-1) {} + Node addNode() { + LEMON_ASSERT(false, + "This graph structure does not support node insertion"); + return INVALID; // avoid warning + } + Arc addArc(const Node& u, const Node& v) { int n; if (first_free_arc == -1) { @@ -416,6 +422,12 @@ ListEdgeSetBase() : first_arc(-1), first_free_arc(-1) {} + Node addNode() { + LEMON_ASSERT(false, + "This graph structure does not support node insertion"); + return INVALID; // avoid warning + } + Edge addEdge(const Node& u, const Node& v) { int n; @@ -816,6 +828,12 @@ SmartArcSetBase() {} + Node addNode() { + LEMON_ASSERT(false, + "This graph structure does not support node insertion"); + return INVALID; // avoid warning + } + Arc addArc(const Node& u, const Node& v) { int n = arcs.size(); arcs.push_back(ArcT()); @@ -1112,6 +1130,12 @@ SmartEdgeSetBase() {} + Node addNode() { + LEMON_ASSERT(false, + "This graph structure does not support node insertion"); + return INVALID; // avoid warning + } + Edge addEdge(const Node& u, const Node& v) { int n = arcs.size(); arcs.push_back(ArcT()); diff -r c01a98ce01fd -r 06f816565bef test/min_cost_flow_test.cc --- a/test/min_cost_flow_test.cc Tue May 12 12:09:55 2009 +0100 +++ b/test/min_cost_flow_test.cc Wed May 13 09:50:14 2009 +0100 @@ -93,22 +93,24 @@ struct Constraints { void constraints() { checkConcept(); + + const Constraints& me = *this; - MCF mcf(g); + MCF mcf(me.g); const MCF& const_mcf = mcf; b = mcf.reset() - .lowerMap(lower) - .upperMap(upper) - .costMap(cost) - .supplyMap(sup) - .stSupply(n, n, k) + .lowerMap(me.lower) + .upperMap(me.upper) + .costMap(me.cost) + .supplyMap(me.sup) + .stSupply(me.n, me.n, me.k) .run(); c = const_mcf.totalCost(); x = const_mcf.template totalCost(); - v = const_mcf.flow(a); - c = const_mcf.potential(n); + v = const_mcf.flow(me.a); + c = const_mcf.potential(me.n); const_mcf.flowMap(fm); const_mcf.potentialMap(pm); } @@ -120,15 +122,16 @@ typedef concepts::ReadMap CAM; typedef concepts::WriteMap FlowMap; typedef concepts::WriteMap PotMap; + + GR g; + VAM lower; + VAM upper; + CAM cost; + NM sup; + Node n; + Arc a; + Value k; - const GR &g; - const VAM &lower; - const VAM &upper; - const CAM &cost; - const NM ⊃ - const Node &n; - const Arc &a; - const Value &k; FlowMap fm; PotMap pm; bool b;