COIN-OR::LEMON - Graph Library

Changeset 973:ee581a0ecfbf in lemon-main


Ignore:
Timestamp:
01/06/12 16:27:06 (13 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Children:
974:b1744d7bdb47, 975:b873350e6258
Phase:
public
Message:

Make CBC interface compatible with latest CBC releases

CBC now uses the CLP backend unconditionally

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cmake/FindCOIN.cmake

    r947 r973  
    5555)
    5656
     57FIND_LIBRARY(COIN_ZLIB_LIBRARY
     58  NAMES z libz
     59  HINTS ${COIN_ROOT_DIR}/lib/coin
     60  HINTS ${COIN_ROOT_DIR}/lib
     61)
     62FIND_LIBRARY(COIN_BZ2_LIBRARY
     63  NAMES bz2 libbz2
     64  HINTS ${COIN_ROOT_DIR}/lib/coin
     65  HINTS ${COIN_ROOT_DIR}/lib
     66)
     67
    5768INCLUDE(FindPackageHandleStandardArgs)
    5869FIND_PACKAGE_HANDLE_STANDARD_ARGS(COIN DEFAULT_MSG
     
    7283IF(COIN_FOUND)
    7384  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})
    7794ENDIF(COIN_FOUND)
    7895
     
    89106  COIN_OSI_VOL_LIBRARY
    90107  COIN_VOL_LIBRARY
     108  COIN_ZLIB_LIBRARY
     109  COIN_BZ2_LIBRARY
    91110)
    92111
  • lemon/cbc.cc

    r576 r973  
    2626#include <coin/OsiSolverInterface.hpp>
    2727
    28 #ifdef COIN_HAS_CLP
    2928#include "coin/OsiClpSolverInterface.hpp"
    30 #endif
    31 #ifdef COIN_HAS_OSL
    32 #include "coin/OsiOslSolverInterface.hpp"
    33 #endif
    3429
    3530#include "coin/CbcCutGenerator.hpp"
     
    259254      delete _osi_solver;
    260255    }
    261 #ifdef COIN_HAS_CLP
    262256    _osi_solver = new OsiClpSolverInterface();
    263 #elif COIN_HAS_OSL
    264     _osi_solver = new OsiOslSolverInterface();
    265 #else
    266 #error Cannot instantiate Osi solver
    267 #endif
    268257
    269258    _osi_solver->loadFromCoinModel(*_prob);
     
    317306      _cbc_model->addCutGenerator(&flowGen, -1, "FlowCover");
    318307
    319 #ifdef COIN_HAS_CLP
    320308      OsiClpSolverInterface* osiclp =
    321309        dynamic_cast<OsiClpSolverInterface*>(_cbc_model->solver());
     
    323311        osiclp->setupForRepeatedUse(2, 0);
    324312      }
    325 #endif
    326313
    327314      CbcRounding heuristic1(*_cbc_model);
Note: See TracChangeset for help on using the changeset viewer.