Changes in / [1334:ee96cd1cad8a:1335:39b6e65574c6] in lemon
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
CMakeLists.txt
r1334 r1335 1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8) 2 3 IF(POLICY CMP0048) 4 CMAKE_POLICY(SET CMP0048 OLD) 5 ENDIF(POLICY CMP0048) 2 6 3 7 IF(POLICY CMP0043) … … 126 130 SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING 127 131 "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)" FORCE) 132 ELSE() 133 SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING 134 "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)") 128 135 ENDIF() 129 136 IF(NOT LEMON_DEFAULT_MIP OR … … 133 140 SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING 134 141 "Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE) 142 ELSE() 143 SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING 144 "Default MIP solver backend (GLPK, CPLEX or CBC)") 135 145 ENDIF() 136 146 … … 145 155 ELSEIF(MSVC) 146 156 # This part is unnecessary 'casue the same is set by the lemon/core.h. 147 # Still keep it as an example. 148 SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996") 157 # Still kept as an example. 158 159 # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996") 160 149 161 # Suppressed warnings: 150 162 # C4250: 'class1' : inherits 'class2::member' via dominance 163 # C4267: conversion from 'size_t' to 'type', possible loss of data 151 164 # C4355: 'this' : used in base member initializer list 152 165 # C4503: 'function' : decorated name length exceeded, name was truncated … … 163 176 164 177 IF(MSVC) 178 SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}") 165 179 SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING 166 180 "Flags used by the C++ compiler during maintainer builds." … … 185 199 ) 186 200 SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER 187 " -Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING201 "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING 188 202 "Flags used for linking binaries during maintainer builds." 189 203 ) 190 204 SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER 191 " -Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING205 "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING 192 206 "Flags used by the shared libraries linker during maintainer builds." 193 207 ) -
cmake/FindILOG.cmake
r1232 r1331 63 63 ${ILOG_CPLEX_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic 64 64 ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic 65 ${ILOG_CPLEX_ROOT_DIR}/lib/x86_linux/static_pic 66 ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_linux/static_pic 65 67 ${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda 66 68 NO_DEFAULT_PATH … … 73 75 ${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic 74 76 ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic 77 ${ILOG_CONCERT_ROOT_DIR}/lib/x86_linux/static_pic 78 ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_linux/static_pic 75 79 ${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda 76 80 NO_DEFAULT_PATH -
lemon/CMakeLists.txt
r1264 r1315 56 56 57 57 ADD_LIBRARY(lemon ${LEMON_SOURCES}) 58 59 TARGET_LINK_LIBRARIES(lemon 60 ${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES} 61 ) 62 58 63 IF(UNIX) 59 SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon )64 SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION}) 60 65 ENDIF() 61 66 -
lemon/arg_parser.h
r959 r1327 27 27 #include <sstream> 28 28 #include <algorithm> 29 #include <lemon/core.h> 29 30 #include <lemon/assert.h> 30 31 -
lemon/capacity_scaling.h
r1270 r1298 164 164 165 165 // Parameters of the problem 166 bool _ha ve_lower;166 bool _has_lower; 167 167 Value _sum_supply; 168 168 … … 357 357 template <typename LowerMap> 358 358 CapacityScaling& lowerMap(const LowerMap& map) { 359 _ha ve_lower = true;359 _has_lower = true; 360 360 for (ArcIt a(_graph); a != INVALID; ++a) { 361 361 _lower[_arc_idf[a]] = map[a]; 362 _lower[_arc_idb[a]] = map[a];363 362 } 364 363 return *this; … … 544 543 _cost[j] = _forward[j] ? 1 : -1; 545 544 } 546 _ha ve_lower = false;545 _has_lower = false; 547 546 return *this; 548 547 } … … 755 754 const Value MAX = std::numeric_limits<Value>::max(); 756 755 int last_out; 757 if (_ha ve_lower) {756 if (_has_lower) { 758 757 for (int i = 0; i != _root; ++i) { 759 758 last_out = _first_out[i+1]; … … 840 839 } 841 840 842 // Check if the upper bound is greater or equal to the lower bound843 // on each arc.841 // Check if the upper bound is greater than or equal to the lower bound 842 // on each forward arc. 844 843 bool checkBoundMaps() { 845 844 for (int j = 0; j != _res_arc_num; ++j) { 846 if (_ upper[j] < _lower[j]) return false;845 if (_forward[j] && _upper[j] < _lower[j]) return false; 847 846 } 848 847 return true; … … 858 857 859 858 // Handle non-zero lower bounds 860 if (_ha ve_lower) {859 if (_has_lower) { 861 860 int limit = _first_out[_root]; 862 861 for (int j = 0; j != limit; ++j) { 863 if ( !_forward[j]) _res_cap[j] += _lower[j];862 if (_forward[j]) _res_cap[_reverse[j]] += _lower[j]; 864 863 } 865 864 } -
lemon/config.h.in
r1264 r1306 1 1 #define LEMON_VERSION "@PROJECT_VERSION@" 2 2 #cmakedefine LEMON_HAVE_LONG_LONG 1 3 3 4 #cmakedefine LEMON_HAVE_LP 1 4 5 #cmakedefine LEMON_HAVE_MIP 1 … … 8 9 #cmakedefine LEMON_HAVE_CLP 1 9 10 #cmakedefine LEMON_HAVE_CBC 1 10 #cmakedefine LEMON_DEFAULT_LP @LEMON_DEFAULT_LP@ 11 #cmakedefine LEMON_DEFAULT_MIP @LEMON_DEFAULT_MIP@ 11 12 #define _LEMON_CPLEX 1 13 #define _LEMON_CLP 2 14 #define _LEMON_GLPK 3 15 #define _LEMON_SOPLEX 4 16 #define _LEMON_CBC 5 17 18 #cmakedefine LEMON_DEFAULT_LP _LEMON_@LEMON_DEFAULT_LP@ 19 #cmakedefine LEMON_DEFAULT_MIP _LEMON_@LEMON_DEFAULT_MIP@ 20 12 21 #cmakedefine LEMON_USE_PTHREAD 1 13 22 #cmakedefine LEMON_USE_WIN32_THREADS 1 -
lemon/core.h
r1270 r1327 30 30 // Disable the following warnings when compiling with MSVC: 31 31 // C4250: 'class1' : inherits 'class2::member' via dominance 32 // C4267: conversion from 'size_t' to 'type', possible loss of data 32 33 // C4355: 'this' : used in base member initializer list 33 34 // C4503: 'function' : decorated name length exceeded, name was truncated … … 35 36 // C4996: 'function': was declared deprecated 36 37 #ifdef _MSC_VER 37 #pragma warning( disable : 4250 4 355 4503 4800 4996 )38 #pragma warning( disable : 4250 4267 4355 4503 4800 4996 ) 38 39 #endif 39 40 40 #ifdef __GNUC__ 41 #define GCC_VERSION (__GNUC__ * 10000 \ 42 + __GNUC_MINOR__ * 100 \ 43 + __GNUC_PATCHLEVEL__) 44 #endif 45 46 #if GCC_VERSION >= 40800 41 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) 47 42 // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8 48 43 #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -
lemon/cost_scaling.h
r1271 r1298 257 257 258 258 // Parameters of the problem 259 bool _ha ve_lower;259 bool _has_lower; 260 260 Value _sum_supply; 261 261 int _sup_node_num; … … 373 373 template <typename LowerMap> 374 374 CostScaling& lowerMap(const LowerMap& map) { 375 _ha ve_lower = true;375 _has_lower = true; 376 376 for (ArcIt a(_graph); a != INVALID; ++a) { 377 377 _lower[_arc_idf[a]] = map[a]; 378 _lower[_arc_idb[a]] = map[a];379 378 } 380 379 return *this; … … 569 568 _scost[_reverse[j]] = 0; 570 569 } 571 _ha ve_lower = false;570 _has_lower = false; 572 571 return *this; 573 572 } … … 781 780 const Value MAX = std::numeric_limits<Value>::max(); 782 781 int last_out; 783 if (_ha ve_lower) {782 if (_has_lower) { 784 783 for (int i = 0; i != _root; ++i) { 785 784 last_out = _first_out[i+1]; … … 838 837 sup[n] = _supply[_node_id[n]]; 839 838 } 840 if (_ha ve_lower) {839 if (_has_lower) { 841 840 for (ArcIt a(_graph); a != INVALID; ++a) { 842 841 int j = _arc_idf[a]; … … 908 907 } 909 908 910 // Check if the upper bound is greater or equal to the lower bound911 // on each arc.909 // Check if the upper bound is greater than or equal to the lower bound 910 // on each forward arc. 912 911 bool checkBoundMaps() { 913 912 for (int j = 0; j != _res_arc_num; ++j) { 914 if (_ upper[j] < _lower[j]) return false;913 if (_forward[j] && _upper[j] < _lower[j]) return false; 915 914 } 916 915 return true; … … 992 991 993 992 // Handle non-zero lower bounds 994 if (_ha ve_lower) {993 if (_has_lower) { 995 994 int limit = _first_out[_root]; 996 995 for (int j = 0; j != limit; ++j) { 997 if ( !_forward[j]) _res_cap[j] += _lower[j];996 if (_forward[j]) _res_cap[_reverse[j]] += _lower[j]; 998 997 } 999 998 } -
lemon/counter.h
r833 r1327 22 22 #include <string> 23 23 #include <iostream> 24 25 #include <lemon/core.h> 24 26 25 27 ///\ingroup timecount -
lemon/cplex.cc
r1270 r1330 116 116 ExprIterator e, Value ub) { 117 117 int i = CPXgetnumrows(cplexEnv(), _prob); 118 119 int rmatbeg = 0; 120 121 std::vector<int> indices; 122 std::vector<Value> values; 123 124 for(ExprIterator it=b; it!=e; ++it) { 125 indices.push_back(it->first); 126 values.push_back(it->second); 127 } 128 118 129 if (lb == -INF) { 119 130 const char s = 'L'; 120 CPXnewrows(cplexEnv(), _prob, 1, &ub, &s, 0, 0); 131 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s, 132 &rmatbeg, &indices.front(), &values.front(), 0, 0); 121 133 } else if (ub == INF) { 122 134 const char s = 'G'; 123 CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0); 135 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s, 136 &rmatbeg, &indices.front(), &values.front(), 0, 0); 124 137 } else if (lb == ub){ 125 138 const char s = 'E'; 126 CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0); 139 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s, 140 &rmatbeg, &indices.front(), &values.front(), 0, 0); 127 141 } else { 128 142 const char s = 'R'; 129 143 double len = ub - lb; 130 CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, &len, 0); 131 } 132 133 std::vector<int> indices; 134 std::vector<int> rowlist; 135 std::vector<Value> values; 136 137 for(ExprIterator it=b; it!=e; ++it) { 138 indices.push_back(it->first); 139 values.push_back(it->second); 140 rowlist.push_back(i); 141 } 142 143 CPXchgcoeflist(cplexEnv(), _prob, values.size(), 144 &rowlist.front(), &indices.front(), &values.front()); 145 144 CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s, 145 &rmatbeg, &indices.front(), &values.front(), 0, 0); 146 CPXchgrngval(cplexEnv(), _prob, 1, &i, &len); 147 } 148 146 149 return i; 147 150 } -
lemon/cycle_canceling.h
r1270 r1298 196 196 197 197 // Parameters of the problem 198 bool _ha ve_lower;198 bool _has_lower; 199 199 Value _sum_supply; 200 200 … … 279 279 template <typename LowerMap> 280 280 CycleCanceling& lowerMap(const LowerMap& map) { 281 _ha ve_lower = true;281 _has_lower = true; 282 282 for (ArcIt a(_graph); a != INVALID; ++a) { 283 283 _lower[_arc_idf[a]] = map[a]; 284 _lower[_arc_idb[a]] = map[a];285 284 } 286 285 return *this; … … 472 471 _cost[_reverse[j]] = 0; 473 472 } 474 _ha ve_lower = false;473 _has_lower = false; 475 474 return *this; 476 475 } … … 685 684 const Value MAX = std::numeric_limits<Value>::max(); 686 685 int last_out; 687 if (_ha ve_lower) {686 if (_has_lower) { 688 687 for (int i = 0; i != _root; ++i) { 689 688 last_out = _first_out[i+1]; … … 728 727 sup[n] = _supply[_node_id[n]]; 729 728 } 730 if (_ha ve_lower) {729 if (_has_lower) { 731 730 for (ArcIt a(_graph); a != INVALID; ++a) { 732 731 int j = _arc_idf[a]; … … 785 784 } 786 785 787 // Check if the upper bound is greater or equal to the lower bound788 // on each arc.786 // Check if the upper bound is greater than or equal to the lower bound 787 // on each forward arc. 789 788 bool checkBoundMaps() { 790 789 for (int j = 0; j != _res_arc_num; ++j) { 791 if (_ upper[j] < _lower[j]) return false;790 if (_forward[j] && _upper[j] < _lower[j]) return false; 792 791 } 793 792 return true; … … 836 835 837 836 // Handle non-zero lower bounds 838 if (_ha ve_lower) {837 if (_has_lower) { 839 838 int limit = _first_out[_root]; 840 839 for (int j = 0; j != limit; ++j) { 841 if ( !_forward[j]) _res_cap[j] += _lower[j];840 if (_forward[j]) _res_cap[_reverse[j]] += _lower[j]; 842 841 } 843 842 } -
lemon/dim2.h
r761 r1311 21 21 22 22 #include <iostream> 23 #include <algorithm> 23 24 24 25 ///\ingroup geomdat -
lemon/elevator.h
r628 r1328 168 168 int onLevel(int l) const 169 169 { 170 return _first[l+1]-_first[l];170 return static_cast<int>(_first[l+1]-_first[l]); 171 171 } 172 172 ///Return true if level \c l is empty. … … 178 178 int aboveLevel(int l) const 179 179 { 180 return _first[_max_level+1]-_first[l+1];180 return static_cast<int>(_first[_max_level+1]-_first[l+1]); 181 181 } 182 182 ///Return the number of active items on level \c l. 183 183 int activesOnLevel(int l) const 184 184 { 185 return _last_active[l]-_first[l]+1;185 return static_cast<int>(_last_active[l]-_first[l]+1); 186 186 } 187 187 ///Return true if there is no active item on level \c l. -
lemon/lp.h
r1270 r1323 23 23 24 24 25 #if def LEMON_HAVE_GLPK25 #if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK 26 26 #include <lemon/glpk.h> 27 #elif LEMON_HAVE_CPLEX 27 #endif 28 #if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX 28 29 #include <lemon/cplex.h> 29 #elif LEMON_HAVE_SOPLEX 30 #endif 31 #if LEMON_DEFAULT_LP == _LEMON_SOPLEX 30 32 #include <lemon/soplex.h> 31 #elif LEMON_HAVE_CLP 33 #endif 34 #if LEMON_DEFAULT_LP == _LEMON_CLP 32 35 #include <lemon/clp.h> 36 #endif 37 #if LEMON_DEFAULT_MIP == _LEMON_CBC 38 #include <lemon/cbc.h> 33 39 #endif 34 40 … … 44 50 ///\ingroup lp_group 45 51 /// 46 ///Currently, the possible values are \c GLPK, \cCPLEX,47 ///\c SOPLEX or \cCLP52 ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX, 53 ///\c _LEMON_SOPLEX or \c LEMON__CLP 48 54 #define LEMON_DEFAULT_LP SOLVER 49 55 ///The default LP solver … … 60 66 ///\ingroup lp_group 61 67 /// 62 ///Currently, the possible values are \c GLPK, \c CPLEX or \c CBC 68 ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX 69 ///or \c _LEMON_CBC 63 70 #define LEMON_DEFAULT_MIP SOLVER 64 71 ///The default MIP solver. … … 70 77 typedef GlpkMip Mip; 71 78 #else 72 #if LEMON_DEFAULT_LP == GLPK79 #if LEMON_DEFAULT_LP == _LEMON_GLPK 73 80 typedef GlpkLp Lp; 74 #elif LEMON_DEFAULT_LP == CPLEX81 #elif LEMON_DEFAULT_LP == _LEMON_CPLEX 75 82 typedef CplexLp Lp; 76 #elif LEMON_DEFAULT_LP == SOPLEX83 #elif LEMON_DEFAULT_LP == _LEMON_SOPLEX 77 84 typedef SoplexLp Lp; 78 #elif LEMON_DEFAULT_LP == CLP85 #elif LEMON_DEFAULT_LP == _LEMON_CLP 79 86 typedef ClpLp Lp; 80 87 #endif 81 #if LEMON_DEFAULT_MIP == GLPK82 typedef Glpk Lp Mip;83 #elif LEMON_DEFAULT_MIP == CPLEX88 #if LEMON_DEFAULT_MIP == _LEMON_GLPK 89 typedef GlpkMip Mip; 90 #elif LEMON_DEFAULT_MIP == _LEMON_CPLEX 84 91 typedef CplexMip Mip; 85 #elif LEMON_DEFAULT_MIP == CBC92 #elif LEMON_DEFAULT_MIP == _LEMON_CBC 86 93 typedef CbcMip Mip; 87 94 #endif -
lemon/math.h
r1270 r1311 68 68 ///Round a value to its closest integer 69 69 inline double round(double r) { 70 return (r > 0.0) ? floor(r + 0.5) :ceil(r - 0.5);70 return (r > 0.0) ? std::floor(r + 0.5) : std::ceil(r - 0.5); 71 71 } 72 72 -
lemon/network_simplex.h
r1270 r1318 199 199 200 200 // Parameters of the problem 201 bool _ha ve_lower;201 bool _has_lower; 202 202 SupplyType _stype; 203 203 Value _sum_supply; … … 683 683 template <typename LowerMap> 684 684 NetworkSimplex& lowerMap(const LowerMap& map) { 685 _ha ve_lower = true;685 _has_lower = true; 686 686 for (ArcIt a(_graph); a != INVALID; ++a) { 687 687 _lower[_arc_id[a]] = map[a]; … … 880 880 _cost[i] = 1; 881 881 } 882 _ha ve_lower = false;882 _has_lower = false; 883 883 _stype = GEQ; 884 884 return *this; … … 937 937 _node_id[n] = i; 938 938 } 939 if (_arc_mixing ) {939 if (_arc_mixing && _node_num > 1) { 940 940 // Store the arcs in a mixed order 941 941 const int skip = std::max(_arc_num / _node_num, 3); … … 1073 1073 1074 1074 // Remove non-zero lower bounds 1075 if (_ha ve_lower) {1075 if (_has_lower) { 1076 1076 for (int i = 0; i != _arc_num; ++i) { 1077 1077 Value c = _lower[i]; … … 1236 1236 } 1237 1237 1238 // Check if the upper bound is greater or equal to the lower bound1238 // Check if the upper bound is greater than or equal to the lower bound 1239 1239 // on each arc. 1240 1240 bool checkBoundMaps() { … … 1613 1613 1614 1614 // Transform the solution and the supply map to the original form 1615 if (_ha ve_lower) {1615 if (_has_lower) { 1616 1616 for (int i = 0; i != _arc_num; ++i) { 1617 1617 Value c = _lower[i]; -
lemon/radix_sort.h
r1270 r1328 329 329 Allocator allocator; 330 330 331 int length = st d::distance(first, last);331 int length = static_cast<int>(std::distance(first, last)); 332 332 Key* buffer = allocator.allocate(2 * length); 333 333 try { -
lemon/random.h
r631 r1328 200 200 initState(init); 201 201 202 num = length > end - begin ? length : end - begin;202 num = static_cast<int>(length > end - begin ? length : end - begin); 203 203 while (num--) { 204 204 curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1)) … … 214 214 } 215 215 216 num = length - 1; cnt = length - (curr - state) - 1;216 num = length - 1; cnt = static_cast<int>(length - (curr - state) - 1); 217 217 while (num--) { 218 218 curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2)) -
lemon/static_graph.h
r956 r1328 204 204 205 205 node_num = n; 206 arc_num = st d::distance(first, last);206 arc_num = static_cast<int>(std::distance(first, last)); 207 207 208 208 node_first_out = new int[node_num + 1]; -
test/arc_look_up_test.cc
r1270 r1312 25 25 using namespace lemon; 26 26 27 const int lgfn = 4;28 27 const std::string lgf = 29 28 "@nodes\n" -
test/lp_test.cc
r1270 r1300 40 40 #endif 41 41 42 #ifdef LEMON_HAVE_LP 43 #include <lemon/lp.h> 44 #endif 42 45 using namespace lemon; 43 46 … … 417 420 lpTest(lp_skel); 418 421 422 #ifdef LEMON_HAVE_LP 423 { 424 Lp lp,lp2; 425 lpTest(lp); 426 aTest(lp2); 427 cloneTest<Lp>(); 428 } 429 #endif 430 419 431 #ifdef LEMON_HAVE_GLPK 420 432 { -
test/min_cost_flow_test.cc
r1270 r1318 396 396 checkMcf(mcf3, mcf3.run(param), neg2_gr, neg2_l, neg2_u, neg2_c, neg2_s, 397 397 mcf3.OPTIMAL, true, -300, test_str + "-18", GEQ); 398 399 // Tests for empty graph 400 Digraph gr0; 401 MCF mcf0(gr0); 402 mcf0.run(param); 403 check(mcf0.totalCost() == 0, "Wrong total cost"); 398 404 } 399 405 -
test/mip_test.cc
r795 r1300 31 31 #ifdef LEMON_HAVE_CBC 32 32 #include <lemon/cbc.h> 33 #endif 34 35 #ifdef LEMON_HAVE_MIP 36 #include <lemon/lp.h> 33 37 #endif 34 38 … … 129 133 { 130 134 135 #ifdef LEMON_HAVE_MIP 136 { 137 Mip mip1; 138 aTest(mip1); 139 cloneTest<Mip>(); 140 } 141 #endif 142 131 143 #ifdef LEMON_HAVE_GLPK 132 144 { -
test/tsp_test.cc
r1271 r1303 133 133 int esize = n <= 1 ? 0 : n; 134 134 135 TSP alg(g, constMap<Edge, int>(1)); 135 ConstMap<Edge, int> cost_map(1); 136 TSP alg(g, cost_map); 136 137 137 138 check(alg.run() == esize, alg_name + ": Wrong total cost"); -
tools/lgf-gen.cc
r701 r1308 247 247 struct BeachIt; 248 248 249 typedef std::multimap<double, BeachIt > SpikeHeap;249 typedef std::multimap<double, BeachIt*> SpikeHeap; 250 250 251 251 typedef std::multimap<Part, SpikeHeap::iterator, YLess> Beach; … … 330 330 331 331 if (bit->second != spikeheap.end()) { 332 delete bit->second->second; 332 333 spikeheap.erase(bit->second); 333 334 } … … 343 344 circle_form(points[prev], points[curr], points[site])) { 344 345 double x = circle_point(points[prev], points[curr], points[site]); 345 pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));346 pit->second .it =346 pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); 347 pit->second->it = 347 348 beach.insert(std::make_pair(Part(prev, curr, site), pit)); 348 349 } else { … … 356 357 circle_form(points[site], points[curr],points[next])) { 357 358 double x = circle_point(points[site], points[curr], points[next]); 358 nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));359 nit->second .it =359 nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); 360 nit->second->it = 360 361 beach.insert(std::make_pair(Part(site, curr, next), nit)); 361 362 } else { … … 367 368 sweep = spit->first; 368 369 369 Beach::iterator bit = spit->second .it;370 Beach::iterator bit = spit->second->it; 370 371 371 372 int prev = bit->first.prev; … … 400 401 int nnt = nbit->first.next; 401 402 402 if (bit->second != spikeheap.end()) spikeheap.erase(bit->second); 403 if (pbit->second != spikeheap.end()) spikeheap.erase(pbit->second); 404 if (nbit->second != spikeheap.end()) spikeheap.erase(nbit->second); 405 403 if (bit->second != spikeheap.end()) 404 { 405 delete bit->second->second; 406 spikeheap.erase(bit->second); 407 } 408 if (pbit->second != spikeheap.end()) 409 { 410 delete pbit->second->second; 411 spikeheap.erase(pbit->second); 412 } 413 if (nbit->second != spikeheap.end()) 414 { 415 delete nbit->second->second; 416 spikeheap.erase(nbit->second); 417 } 418 406 419 beach.erase(nbit); 407 420 beach.erase(bit); … … 413 426 double x = circle_point(points[ppv], points[prev], points[next]); 414 427 if (x < sweep) x = sweep; 415 pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));416 pit->second .it =428 pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); 429 pit->second->it = 417 430 beach.insert(std::make_pair(Part(ppv, prev, next), pit)); 418 431 } else { … … 425 438 double x = circle_point(points[prev], points[next], points[nnt]); 426 439 if (x < sweep) x = sweep; 427 nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));428 nit->second .it =440 nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end()))); 441 nit->second->it = 429 442 beach.insert(std::make_pair(Part(prev, next, nnt), nit)); 430 443 } else {
Note: See TracChangeset
for help on using the changeset viewer.