gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge various fixes
0 5 0
merge r1.1 1.1
0 files changed with 57 insertions and 27 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -18,10 +18,11 @@
18 18
FIND_PACKAGE(COIN)
19 19

	
20 20
IF(MSVC)
21
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4800 /wd4996")
21
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
22 22
# Suppressed warnings:
23 23
# C4250: 'class1' : inherits 'class2::member' via dominance
24 24
# C4355: 'this' : used in base member initializer list
25
# C4503: 'function' : decorated name length exceeded, name was truncated
25 26
# C4800: 'type' : forcing value to bool 'true' or 'false' (performance warning)
26 27
# C4996: 'function': was declared deprecated
27 28
ENDIF(MSVC)
Ignore white space 6 line context
1 1
EXTRA_DIST += \
2 2
	lemon/lemon.pc.in \
3
	lemon/CMakeLists.txt
3
	lemon/CMakeLists.txt \
4
	lemon/config.h.cmake
4 5

	
5 6
pkgconfig_DATA += lemon/lemon.pc
6 7

	
... ...
@@ -16,7 +17,7 @@
16 17
	lemon/bits/windows.cc
17 18

	
18 19
nodist_lemon_HEADERS = lemon/config.h	
19
	
20

	
20 21
lemon_libemon_la_CXXFLAGS = \
21 22
	$(AM_CXXFLAGS) \
22 23
	$(GLPK_CFLAGS) \
Ignore white space 6 line context
... ...
@@ -71,6 +71,11 @@
71 71
      /// Assignment operator for the item.
72 72
      GraphItem& operator=(const GraphItem&) { return *this; }
73 73

	
74
      /// \brief Assignment operator for INVALID.
75
      ///
76
      /// This operator makes the item invalid.
77
      GraphItem& operator=(Invalid) { return *this; }
78

	
74 79
      /// \brief Equality operator.
75 80
      ///
76 81
      /// Equality operator.
... ...
@@ -96,6 +101,7 @@
96 101
      struct Constraints {
97 102
        void constraints() {
98 103
          _GraphItem i1;
104
          i1=INVALID;
99 105
          _GraphItem i2 = i1;
100 106
          _GraphItem i3 = INVALID;
101 107

	
... ...
@@ -221,14 +227,7 @@
221 227
        /// Besides the core graph item functionality each arc should
222 228
        /// be convertible to the represented edge.
223 229
        Edge(const Arc&) {}
224

	
225
        /// \brief Assign an arc to an edge.
226
        ///
227
        /// This function assigns an arc to an edge.
228
        /// Besides the core graph item functionality each arc should
229
        /// be convertible to the represented edge.
230
        Edge& operator=(const Arc&) { return *this; }
231
      };
230
     };
232 231

	
233 232
      /// \brief Return one end node of an edge.
234 233
      ///
... ...
@@ -353,10 +352,12 @@
353 352
        void constraints() {
354 353
          checkConcept<Base, _Digraph >();
355 354
          typename _Digraph::Node node;
355
          node=INVALID;
356 356
          int nid = digraph.id(node);
357 357
          nid = digraph.id(node);
358 358
          node = digraph.nodeFromId(nid);
359 359
          typename _Digraph::Arc arc;
360
          arc=INVALID;
360 361
          int eid = digraph.id(arc);
361 362
          eid = digraph.id(arc);
362 363
          arc = digraph.arcFromId(eid);
Ignore white space 6 line context
... ...
@@ -84,6 +84,12 @@
84 84

	
85 85
    ListArcSetBase() : first_arc(-1), first_free_arc(-1) {}
86 86

	
87
    Node addNode() {
88
      LEMON_ASSERT(false,
89
        "This graph structure does not support node insertion");
90
      return INVALID; // avoid warning
91
    }
92

	
87 93
    Arc addArc(const Node& u, const Node& v) {
88 94
      int n;
89 95
      if (first_free_arc == -1) {
... ...
@@ -416,6 +422,12 @@
416 422

	
417 423
    ListEdgeSetBase() : first_arc(-1), first_free_arc(-1) {}
418 424

	
425
    Node addNode() {
426
      LEMON_ASSERT(false,
427
        "This graph structure does not support node insertion");
428
      return INVALID; // avoid warning
429
    }
430

	
419 431
    Edge addEdge(const Node& u, const Node& v) {
420 432
      int n;
421 433

	
... ...
@@ -816,6 +828,12 @@
816 828

	
817 829
    SmartArcSetBase() {}
818 830

	
831
    Node addNode() {
832
      LEMON_ASSERT(false,
833
        "This graph structure does not support node insertion");
834
      return INVALID; // avoid warning
835
    }
836

	
819 837
    Arc addArc(const Node& u, const Node& v) {
820 838
      int n = arcs.size();
821 839
      arcs.push_back(ArcT());
... ...
@@ -1112,6 +1130,12 @@
1112 1130

	
1113 1131
    SmartEdgeSetBase() {}
1114 1132

	
1133
    Node addNode() {
1134
      LEMON_ASSERT(false,
1135
        "This graph structure does not support node insertion");
1136
      return INVALID; // avoid warning
1137
    }
1138

	
1115 1139
    Edge addEdge(const Node& u, const Node& v) {
1116 1140
      int n = arcs.size();
1117 1141
      arcs.push_back(ArcT());
Ignore white space 6 line context
... ...
@@ -93,22 +93,24 @@
93 93
  struct Constraints {
94 94
    void constraints() {
95 95
      checkConcept<concepts::Digraph, GR>();
96
      
97
      const Constraints& me = *this;
96 98

	
97
      MCF mcf(g);
99
      MCF mcf(me.g);
98 100
      const MCF& const_mcf = mcf;
99 101

	
100 102
      b = mcf.reset()
101
             .lowerMap(lower)
102
             .upperMap(upper)
103
             .costMap(cost)
104
             .supplyMap(sup)
105
             .stSupply(n, n, k)
103
             .lowerMap(me.lower)
104
             .upperMap(me.upper)
105
             .costMap(me.cost)
106
             .supplyMap(me.sup)
107
             .stSupply(me.n, me.n, me.k)
106 108
             .run();
107 109

	
108 110
      c = const_mcf.totalCost();
109 111
      x = const_mcf.template totalCost<double>();
110
      v = const_mcf.flow(a);
111
      c = const_mcf.potential(n);
112
      v = const_mcf.flow(me.a);
113
      c = const_mcf.potential(me.n);
112 114
      const_mcf.flowMap(fm);
113 115
      const_mcf.potentialMap(pm);
114 116
    }
... ...
@@ -120,15 +122,16 @@
120 122
    typedef concepts::ReadMap<Arc, Cost> CAM;
121 123
    typedef concepts::WriteMap<Arc, Value> FlowMap;
122 124
    typedef concepts::WriteMap<Node, Cost> PotMap;
125
  
126
    GR g;
127
    VAM lower;
128
    VAM upper;
129
    CAM cost;
130
    NM sup;
131
    Node n;
132
    Arc a;
133
    Value k;
123 134

	
124
    const GR &g;
125
    const VAM &lower;
126
    const VAM &upper;
127
    const CAM &cost;
128
    const NM &sup;
129
    const Node &n;
130
    const Arc &a;
131
    const Value &k;
132 135
    FlowMap fm;
133 136
    PotMap pm;
134 137
    bool b;
0 comments (0 inline)