Merge various fixes 1.1 r1.1
authorAlpar Juttner <alpar@cs.elte.hu>
Wed, 13 May 2009 09:50:14 +0100
branch1.1
changeset 84506f816565bef
parent 844 c01a98ce01fd
parent 717 926c47568a56
child 846 73ee142260f2
Merge various fixes
     1.1 --- a/CMakeLists.txt	Tue May 12 12:09:55 2009 +0100
     1.2 +++ b/CMakeLists.txt	Wed May 13 09:50:14 2009 +0100
     1.3 @@ -18,10 +18,11 @@
     1.4  FIND_PACKAGE(COIN)
     1.5  
     1.6  IF(MSVC)
     1.7 -  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
     1.8 +  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
     1.9  # Suppressed warnings:
    1.10  # C4250: 'class1' : inherits 'class2::member' via dominance
    1.11  # C4355: 'this' : used in base member initializer list
    1.12 +# C4503: 'function' : decorated name length exceeded, name was truncated
    1.13  # C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
    1.14  # C4996: 'function': was declared deprecated
    1.15  ENDIF(MSVC)
     2.1 --- a/lemon/Makefile.am	Tue May 12 12:09:55 2009 +0100
     2.2 +++ b/lemon/Makefile.am	Wed May 13 09:50:14 2009 +0100
     2.3 @@ -1,6 +1,7 @@
     2.4  EXTRA_DIST += \
     2.5  	lemon/lemon.pc.in \
     2.6 -	lemon/CMakeLists.txt
     2.7 +	lemon/CMakeLists.txt \
     2.8 +	lemon/config.h.cmake
     2.9  
    2.10  pkgconfig_DATA += lemon/lemon.pc
    2.11  
    2.12 @@ -16,7 +17,7 @@
    2.13  	lemon/bits/windows.cc
    2.14  
    2.15  nodist_lemon_HEADERS = lemon/config.h	
    2.16 -	
    2.17 +
    2.18  lemon_libemon_la_CXXFLAGS = \
    2.19  	$(AM_CXXFLAGS) \
    2.20  	$(GLPK_CFLAGS) \
     3.1 --- a/lemon/concepts/graph_components.h	Tue May 12 12:09:55 2009 +0100
     3.2 +++ b/lemon/concepts/graph_components.h	Wed May 13 09:50:14 2009 +0100
     3.3 @@ -71,6 +71,11 @@
     3.4        /// Assignment operator for the item.
     3.5        GraphItem& operator=(const GraphItem&) { return *this; }
     3.6  
     3.7 +      /// \brief Assignment operator for INVALID.
     3.8 +      ///
     3.9 +      /// This operator makes the item invalid.
    3.10 +      GraphItem& operator=(Invalid) { return *this; }
    3.11 +
    3.12        /// \brief Equality operator.
    3.13        ///
    3.14        /// Equality operator.
    3.15 @@ -96,6 +101,7 @@
    3.16        struct Constraints {
    3.17          void constraints() {
    3.18            _GraphItem i1;
    3.19 +          i1=INVALID;
    3.20            _GraphItem i2 = i1;
    3.21            _GraphItem i3 = INVALID;
    3.22  
    3.23 @@ -221,14 +227,7 @@
    3.24          /// Besides the core graph item functionality each arc should
    3.25          /// be convertible to the represented edge.
    3.26          Edge(const Arc&) {}
    3.27 -
    3.28 -        /// \brief Assign an arc to an edge.
    3.29 -        ///
    3.30 -        /// This function assigns an arc to an edge.
    3.31 -        /// Besides the core graph item functionality each arc should
    3.32 -        /// be convertible to the represented edge.
    3.33 -        Edge& operator=(const Arc&) { return *this; }
    3.34 -      };
    3.35 +     };
    3.36  
    3.37        /// \brief Return one end node of an edge.
    3.38        ///
    3.39 @@ -353,10 +352,12 @@
    3.40          void constraints() {
    3.41            checkConcept<Base, _Digraph >();
    3.42            typename _Digraph::Node node;
    3.43 +          node=INVALID;
    3.44            int nid = digraph.id(node);
    3.45            nid = digraph.id(node);
    3.46            node = digraph.nodeFromId(nid);
    3.47            typename _Digraph::Arc arc;
    3.48 +          arc=INVALID;
    3.49            int eid = digraph.id(arc);
    3.50            eid = digraph.id(arc);
    3.51            arc = digraph.arcFromId(eid);
     4.1 --- a/lemon/edge_set.h	Tue May 12 12:09:55 2009 +0100
     4.2 +++ b/lemon/edge_set.h	Wed May 13 09:50:14 2009 +0100
     4.3 @@ -84,6 +84,12 @@
     4.4  
     4.5      ListArcSetBase() : first_arc(-1), first_free_arc(-1) {}
     4.6  
     4.7 +    Node addNode() {
     4.8 +      LEMON_ASSERT(false,
     4.9 +        "This graph structure does not support node insertion");
    4.10 +      return INVALID; // avoid warning
    4.11 +    }
    4.12 +
    4.13      Arc addArc(const Node& u, const Node& v) {
    4.14        int n;
    4.15        if (first_free_arc == -1) {
    4.16 @@ -416,6 +422,12 @@
    4.17  
    4.18      ListEdgeSetBase() : first_arc(-1), first_free_arc(-1) {}
    4.19  
    4.20 +    Node addNode() {
    4.21 +      LEMON_ASSERT(false,
    4.22 +        "This graph structure does not support node insertion");
    4.23 +      return INVALID; // avoid warning
    4.24 +    }
    4.25 +
    4.26      Edge addEdge(const Node& u, const Node& v) {
    4.27        int n;
    4.28  
    4.29 @@ -816,6 +828,12 @@
    4.30  
    4.31      SmartArcSetBase() {}
    4.32  
    4.33 +    Node addNode() {
    4.34 +      LEMON_ASSERT(false,
    4.35 +        "This graph structure does not support node insertion");
    4.36 +      return INVALID; // avoid warning
    4.37 +    }
    4.38 +
    4.39      Arc addArc(const Node& u, const Node& v) {
    4.40        int n = arcs.size();
    4.41        arcs.push_back(ArcT());
    4.42 @@ -1112,6 +1130,12 @@
    4.43  
    4.44      SmartEdgeSetBase() {}
    4.45  
    4.46 +    Node addNode() {
    4.47 +      LEMON_ASSERT(false,
    4.48 +        "This graph structure does not support node insertion");
    4.49 +      return INVALID; // avoid warning
    4.50 +    }
    4.51 +
    4.52      Edge addEdge(const Node& u, const Node& v) {
    4.53        int n = arcs.size();
    4.54        arcs.push_back(ArcT());
     5.1 --- a/test/min_cost_flow_test.cc	Tue May 12 12:09:55 2009 +0100
     5.2 +++ b/test/min_cost_flow_test.cc	Wed May 13 09:50:14 2009 +0100
     5.3 @@ -93,22 +93,24 @@
     5.4    struct Constraints {
     5.5      void constraints() {
     5.6        checkConcept<concepts::Digraph, GR>();
     5.7 +      
     5.8 +      const Constraints& me = *this;
     5.9  
    5.10 -      MCF mcf(g);
    5.11 +      MCF mcf(me.g);
    5.12        const MCF& const_mcf = mcf;
    5.13  
    5.14        b = mcf.reset()
    5.15 -             .lowerMap(lower)
    5.16 -             .upperMap(upper)
    5.17 -             .costMap(cost)
    5.18 -             .supplyMap(sup)
    5.19 -             .stSupply(n, n, k)
    5.20 +             .lowerMap(me.lower)
    5.21 +             .upperMap(me.upper)
    5.22 +             .costMap(me.cost)
    5.23 +             .supplyMap(me.sup)
    5.24 +             .stSupply(me.n, me.n, me.k)
    5.25               .run();
    5.26  
    5.27        c = const_mcf.totalCost();
    5.28        x = const_mcf.template totalCost<double>();
    5.29 -      v = const_mcf.flow(a);
    5.30 -      c = const_mcf.potential(n);
    5.31 +      v = const_mcf.flow(me.a);
    5.32 +      c = const_mcf.potential(me.n);
    5.33        const_mcf.flowMap(fm);
    5.34        const_mcf.potentialMap(pm);
    5.35      }
    5.36 @@ -120,15 +122,16 @@
    5.37      typedef concepts::ReadMap<Arc, Cost> CAM;
    5.38      typedef concepts::WriteMap<Arc, Value> FlowMap;
    5.39      typedef concepts::WriteMap<Node, Cost> PotMap;
    5.40 +  
    5.41 +    GR g;
    5.42 +    VAM lower;
    5.43 +    VAM upper;
    5.44 +    CAM cost;
    5.45 +    NM sup;
    5.46 +    Node n;
    5.47 +    Arc a;
    5.48 +    Value k;
    5.49  
    5.50 -    const GR &g;
    5.51 -    const VAM &lower;
    5.52 -    const VAM &upper;
    5.53 -    const CAM &cost;
    5.54 -    const NM &sup;
    5.55 -    const Node &n;
    5.56 -    const Arc &a;
    5.57 -    const Value &k;
    5.58      FlowMap fm;
    5.59      PotMap pm;
    5.60      bool b;