gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge LP interface updates to branch 1.1
0 4 0
merge 1.1
0 files changed with 33 insertions and 25 deletions:
↑ Collapse diff ↑
Ignore white space 6 line context
... ...
@@ -51,12 +51,23 @@
51 51
FIND_LIBRARY(COIN_VOL_LIBRARY
52 52
  NAMES Vol libVol
53 53
  HINTS ${COIN_ROOT_DIR}/lib/coin
54 54
  HINTS ${COIN_ROOT_DIR}/lib
55 55
)
56 56

	
57
FIND_LIBRARY(COIN_ZLIB_LIBRARY
58
  NAMES z libz
59
  HINTS ${COIN_ROOT_DIR}/lib/coin
60
  HINTS ${COIN_ROOT_DIR}/lib
61
)
62
FIND_LIBRARY(COIN_BZ2_LIBRARY
63
  NAMES bz2 libbz2
64
  HINTS ${COIN_ROOT_DIR}/lib/coin
65
  HINTS ${COIN_ROOT_DIR}/lib
66
)
67

	
57 68
INCLUDE(FindPackageHandleStandardArgs)
58 69
FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
59 70
  COIN_INCLUDE_DIR
60 71
  COIN_CBC_LIBRARY
61 72
  COIN_CBC_SOLVER_LIBRARY
62 73
  COIN_CGL_LIBRARY
... ...
@@ -68,15 +79,21 @@
68 79
  # COIN_OSI_VOL_LIBRARY
69 80
  # COIN_VOL_LIBRARY
70 81
)
71 82

	
72 83
IF(COIN_FOUND)
73 84
  SET(COIN_INCLUDE_DIRS ${COIN_INCLUDE_DIR})
74
  SET(COIN_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY}")
75
  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY}")
76
  SET(COIN_CBC_LIBRARIES ${COIN_LIBRARIES})
85
  SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARY};${COIN_COIN_UTILS_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY}")
86
  IF(COIN_ZLIB_LIBRARY)
87
    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_ZLIB_LIBRARY}")
88
  ENDIF(COIN_ZLIB_LIBRARY)
89
   IF(COIN_BZ2_LIBRARY)
90
    SET(COIN_CLP_LIBRARIES "${COIN_CLP_LIBRARIES};${COIN_BZ2_LIBRARY}")
91
  ENDIF(COIN_BZ2_LIBRARY)
92
  SET(COIN_CBC_LIBRARIES "${COIN_CBC_LIBRARY};${COIN_CBC_SOLVER_LIBRARY};${COIN_CGL_LIBRARY};${COIN_OSI_LIBRARY};${COIN_OSI_CBC_LIBRARY};${COIN_OSI_CLP_LIBRARY};${COIN_ZLIB_LIBRARY};${COIN_BZ2_LIBRARY};${COIN_CLP_LIBRARIES}")
93
  SET(COIN_LIBRARIES ${COIN_CBC_LIBRARIES})
77 94
ENDIF(COIN_FOUND)
78 95

	
79 96
MARK_AS_ADVANCED(
80 97
  COIN_INCLUDE_DIR
81 98
  COIN_CBC_LIBRARY
82 99
  COIN_CBC_SOLVER_LIBRARY
... ...
@@ -85,12 +102,14 @@
85 102
  COIN_COIN_UTILS_LIBRARY
86 103
  COIN_OSI_LIBRARY
87 104
  COIN_OSI_CBC_LIBRARY
88 105
  COIN_OSI_CLP_LIBRARY
89 106
  COIN_OSI_VOL_LIBRARY
90 107
  COIN_VOL_LIBRARY
108
  COIN_ZLIB_LIBRARY
109
  COIN_BZ2_LIBRARY
91 110
)
92 111

	
93 112
IF(COIN_FOUND)
94 113
  SET(LEMON_HAVE_LP TRUE)
95 114
  SET(LEMON_HAVE_MIP TRUE)
96 115
  SET(LEMON_HAVE_CLP TRUE)
Ignore white space 6 line context
1 1
SET(CPLEX_ROOT_DIR "" CACHE PATH "CPLEX root directory")
2 2

	
3 3
FIND_PATH(CPLEX_INCLUDE_DIR
4 4
  ilcplex/cplex.h
5
  PATHS "C:/ILOG/CPLEX91/include"
6
  PATHS "/opt/ilog/cplex91/include"
5
  PATHS "C:/ILOG/CPLEX/include"
6
  PATHS "/opt/ilog/cplex/include"
7 7
  HINTS ${CPLEX_ROOT_DIR}/include
8 8
)
9 9
FIND_LIBRARY(CPLEX_LIBRARY
10
  cplex91
11
  PATHS "C:/ILOG/CPLEX91/lib/msvc7/stat_mda"
12
  PATHS "/opt/ilog/cplex91/bin"
10
  cplex
11
  PATHS "C:/ILOG/CPLEX/lib/msvc7/stat_mda"
12
  PATHS "/opt/ilog/cplex/bin"
13 13
  HINTS ${CPLEX_ROOT_DIR}/bin
14
  HINTS ${CPLEX_ROOT_DIR}/lib
14 15
)
15 16

	
16 17
INCLUDE(FindPackageHandleStandardArgs)
17 18
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPLEX DEFAULT_MSG CPLEX_LIBRARY CPLEX_INCLUDE_DIR)
18 19

	
19 20
FIND_PATH(CPLEX_BIN_DIR
20
  cplex91.dll
21
  PATHS "C:/ILOG/CPLEX91/bin/x86_win32"
21
  cplex.dll
22
  PATHS "C:/ILOG/CPLEX/bin/x86_win32"
23
  HINTS ${CPLEX_ROOT_DIR}/bin
22 24
)
23 25

	
24 26
IF(CPLEX_FOUND)
25 27
  SET(CPLEX_INCLUDE_DIRS ${CPLEX_INCLUDE_DIR})
26 28
  SET(CPLEX_LIBRARIES ${CPLEX_LIBRARY})
27 29
  IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
Ignore white space 6 line context
... ...
@@ -22,18 +22,13 @@
22 22
#include "cbc.h"
23 23

	
24 24
#include <coin/CoinModel.hpp>
25 25
#include <coin/CbcModel.hpp>
26 26
#include <coin/OsiSolverInterface.hpp>
27 27

	
28
#ifdef COIN_HAS_CLP
29 28
#include "coin/OsiClpSolverInterface.hpp"
30
#endif
31
#ifdef COIN_HAS_OSL
32
#include "coin/OsiOslSolverInterface.hpp"
33
#endif
34 29

	
35 30
#include "coin/CbcCutGenerator.hpp"
36 31
#include "coin/CbcHeuristicLocal.hpp"
37 32
#include "coin/CbcHeuristicGreedy.hpp"
38 33
#include "coin/CbcHeuristicFPump.hpp"
39 34
#include "coin/CbcHeuristicRINS.hpp"
... ...
@@ -255,19 +250,13 @@
255 250

	
256 251
  CbcMip::SolveExitStatus CbcMip::_solve() {
257 252

	
258 253
    if (_osi_solver) {
259 254
      delete _osi_solver;
260 255
    }
261
#ifdef COIN_HAS_CLP
262 256
    _osi_solver = new OsiClpSolverInterface();
263
#elif COIN_HAS_OSL
264
    _osi_solver = new OsiOslSolverInterface();
265
#else
266
#error Cannot instantiate Osi solver
267
#endif
268 257

	
269 258
    _osi_solver->loadFromCoinModel(*_prob);
270 259

	
271 260
    if (_cbc_model) {
272 261
      delete _cbc_model;
273 262
    }
... ...
@@ -313,19 +302,17 @@
313 302
      CglMixedIntegerRounding mixedGen;
314 303
      _cbc_model->addCutGenerator(&mixedGen, -1, "MixedIntegerRounding");
315 304

	
316 305
      CglFlowCover flowGen;
317 306
      _cbc_model->addCutGenerator(&flowGen, -1, "FlowCover");
318 307

	
319
#ifdef COIN_HAS_CLP
320 308
      OsiClpSolverInterface* osiclp =
321 309
        dynamic_cast<OsiClpSolverInterface*>(_cbc_model->solver());
322 310
      if (osiclp->getNumRows() < 300 && osiclp->getNumCols() < 500) {
323 311
        osiclp->setupForRepeatedUse(2, 0);
324 312
      }
325
#endif
326 313

	
327 314
      CbcRounding heuristic1(*_cbc_model);
328 315
      heuristic1.setWhen(3);
329 316
      _cbc_model->addHeuristic(&heuristic1);
330 317

	
331 318
      CbcHeuristicLocal heuristic2(*_cbc_model);
Ignore white space 12 line context
... ...
@@ -79,13 +79,13 @@
79 79
  ENDIF()
80 80

	
81 81
  IF(WIN32 AND LEMON_HAVE_CPLEX)
82 82
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
83 83
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
84 84
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
85
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
85
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
86 86
    )
87 87
  ENDIF()
88 88
ENDIF()
89 89

	
90 90
IF(LEMON_HAVE_MIP)
91 91
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
... ...
@@ -121,13 +121,13 @@
121 121
  ENDIF()
122 122

	
123 123
  IF(WIN32 AND LEMON_HAVE_CPLEX)
124 124
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
125 125
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
126 126
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
127
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
127
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
128 128
    )
129 129
  ENDIF()
130 130
ENDIF()
131 131

	
132 132
FOREACH(TEST_NAME ${TESTS})
133 133
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
0 comments (0 inline)