COIN-OR::LEMON - Graph Library

Changeset 1064:fc3854d936f7 in lemon-main


Ignore:
Timestamp:
05/25/13 06:59:31 (12 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Rebase:
35363163616338666530346638653436663533323465616535386135353130313663633232326462
Message:

Enable/disable options for LP/MIP backends (#465)

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r1062 r1064  
    6262FIND_PACKAGE(Doxygen)
    6363FIND_PACKAGE(Ghostscript)
    64 FIND_PACKAGE(GLPK 4.33)
    65 FIND_PACKAGE(ILOG)
    66 FIND_PACKAGE(COIN)
     64
     65SET(LEMON_ENABLE_GLPK YES CACHE STRING "Enable GLPK solver backend.")
     66SET(LEMON_ENABLE_ILOG YES CACHE STRING "Enable ILOG (CPLEX) solver backend.")
     67SET(LEMON_ENABLE_COIN YES CACHE STRING "Enable COIN solver backend.")
     68
     69IF(LEMON_ENABLE_GLPK)
     70  FIND_PACKAGE(GLPK 4.33)
     71ENDIF(LEMON_ENABLE_GLPK)
     72IF(LEMON_ENABLE_ILOG)
     73  FIND_PACKAGE(ILOG)
     74ENDIF(LEMON_ENABLE_ILOG)
     75IF(LEMON_ENABLE_COIN)
     76  FIND_PACKAGE(COIN)
     77ENDIF(LEMON_ENABLE_COIN)
     78
     79IF(GLPK_FOUND)
     80  SET(LEMON_HAVE_LP TRUE)
     81  SET(LEMON_HAVE_MIP TRUE)
     82  SET(LEMON_HAVE_GLPK TRUE)
     83ENDIF(GLPK_FOUND)
     84IF(ILOG_FOUND)
     85  SET(LEMON_HAVE_LP TRUE)
     86  SET(LEMON_HAVE_MIP TRUE)
     87  SET(LEMON_HAVE_ILOG TRUE)
     88ENDIF(ILOG_FOUND)
     89IF(COIN_FOUND)
     90  SET(LEMON_HAVE_LP TRUE)
     91  SET(LEMON_HAVE_MIP TRUE)
     92  SET(LEMON_HAVE_CLP TRUE)
     93  SET(LEMON_HAVE_CBC TRUE)
     94ENDIF(COIN_FOUND)
     95
     96IF(ILOG_FOUND)
     97  SET(DEFAULT_LP "CPLEX")
     98  SET(DEFAULT_MIP "CPLEX")
     99ELSEIF(COIN_FOUND)
     100  SET(DEFAULT_LP "CLP")
     101  SET(DEFAULT_MIP "CBC")
     102ELSEIF(GLPK_FOUND)
     103  SET(DEFAULT_LP "GLPK")
     104  SET(DEFAULT_MIP "GLPK")
     105ENDIF()
     106
     107IF(NOT LEMON_DEFAULT_LP OR
     108    (NOT ILOG_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CPLEX")) OR
     109    (NOT COIN_FOUND AND (LEMON_DEFAULT_LP STREQUAL "CLP")) OR
     110    (NOT GLPK_FOUND AND (LEMON_DEFAULT_LP STREQUAL "GLPK")))
     111  SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
     112    "Default LP solver backend (GLPK, CPLEX or CLP)" FORCE)
     113ENDIF()
     114IF(NOT LEMON_DEFAULT_MIP OR
     115    (NOT ILOG_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CPLEX")) OR
     116    (NOT COIN_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "CBC")) OR
     117    (NOT GLPK_FOUND AND (LEMON_DEFAULT_MIP STREQUAL "GLPK")))
     118  SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
     119    "Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE)
     120ENDIF()
     121
    67122
    68123IF(DEFINED ENV{LEMON_CXX_WARNING})
  • INSTALL

    r1062 r1064  
    107107  really want to use this option.
    108108
     109-DLEMON_DOC_SOURCE_BROWSER=YES
     110
     111  Include the browsable cross referenced LEMON source code into the
     112  doc. It makes the doc quite bloated, but may be useful for
     113  developing LEMON itself.
     114
     115-DLEMON_DOC_USE_MATHJAX=YES
     116
     117  Use MathJax (http://mathjax.org) for rendering the math formulae in
     118  the doc.  It of much higher quality compared to the default LaTeX
     119  generated static images and it allows copy&paste of the formulae to
     120  LaTeX, Open Office, MS Word etc. documents.
     121
     122  On the other hand, it needs either Internet access or a locally
     123  installed version of MathJax to properly render the doc.
     124
     125-DLEMON_DOC_MATHJAX_RELPATH=DIRECTORY
     126 
     127  The location of the MathJax library. It defaults to
     128  http://www.mathjax.org/mathjax, which necessitates Internet access
     129  for proper rendering. The easiest way to make it usable offline is
     130  to set this parameter to 'mathjax' and copy all files of the MathJax
     131  library into the 'doc/html/mathjax' subdirectory of the build
     132  location.
     133
     134  See http://docs.mathjax.org/en/latest/installation.html for more details.
     135
     136 
     137-DLEMON_ENABLE_GLPK=NO
     138-DLEMON_ENABLE_COIN=NO
     139-DLEMON_ENABLE_ILOG=NO
     140
     141  Enable optional third party libraries. They are all enabled by default.
     142
     143-DLEMON_DEFAULT_LP=GLPK
     144
     145  Sets the default LP solver backend. The supported values are
     146  CPLEX, CLP and GLPK. By default, it is set to the first one which
     147  is enabled and succesfully discovered.
     148
     149-DLEMON_DEFAULT_MIP=GLPK
     150
     151  Sets the default MIP solver backend. The supported values are
     152  CPLEX, CBC and GLPK. By default, it is set to the first one which
     153  is enabled and succesfully discovered.
     154
    109155-DGLPK_ROOT_DIR=DIRECTORY
    110156-DCOIN_ROOT_DIR=DIRECTORY
    111157-DILOG_ROOT_DIR=DIRECTORY
    112158
    113   Install root directory prefixes of optional third party libraries.
     159  Root directory prefixes of optional third party libraries.
    114160
    115161Makefile Variables
  • cmake/FindCOIN.cmake

    r973 r1064  
    109109  COIN_BZ2_LIBRARY
    110110)
    111 
    112 IF(COIN_FOUND)
    113   SET(LEMON_HAVE_LP TRUE)
    114   SET(LEMON_HAVE_MIP TRUE)
    115   SET(LEMON_HAVE_CLP TRUE)
    116   SET(LEMON_HAVE_CBC TRUE)
    117 ENDIF(COIN_FOUND)
  • cmake/FindGLPK.cmake

    r1062 r1064  
    5454
    5555MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
    56 
    57 IF(GLPK_FOUND)
    58   SET(LEMON_HAVE_LP TRUE)
    59   SET(LEMON_HAVE_MIP TRUE)
    60   SET(LEMON_HAVE_GLPK TRUE)
    61 ENDIF(GLPK_FOUND)
    62 
  • cmake/FindILOG.cmake

    r1062 r1064  
    101101  ILOG_CONCERT_LIBRARY ILOG_CONCERT_INCLUDE_DIR ILOG_CONCERT_DLL
    102102  )
    103 
    104 IF(ILOG_FOUND)
    105   SET(LEMON_HAVE_LP TRUE)
    106   SET(LEMON_HAVE_MIP TRUE)
    107   SET(LEMON_HAVE_CPLEX TRUE)
    108 ENDIF(ILOG_FOUND)
  • lemon/cbc.h

    r877 r1064  
    1717 */
    1818
    19 // -*- C++ -*-
    2019#ifndef LEMON_CBC_H
    2120#define LEMON_CBC_H
  • lemon/config.h.in

    r981 r1064  
    77#cmakedefine LEMON_HAVE_CLP 1
    88#cmakedefine LEMON_HAVE_CBC 1
     9#cmakedefine LEMON_DEFAULT_LP @LEMON_DEFAULT_LP@
     10#cmakedefine LEMON_DEFAULT_MIP @LEMON_DEFAULT_MIP@
    911#cmakedefine LEMON_USE_PTHREAD 1
    1012#cmakedefine LEMON_USE_WIN32_THREADS 1
  • lemon/lp.h

    r877 r1064  
    6060  ///\ingroup lp_group
    6161  ///
    62   ///Currently, the possible values are \c GLPK or \c CPLEX
     62  ///Currently, the possible values are \c GLPK, \c CPLEX or \c CBC
    6363#define LEMON_DEFAULT_MIP SOLVER
    6464  ///The default MIP solver.
     
    6767  ///\ingroup lp_group
    6868  ///
    69   ///Currently, it is either \c GlpkMip or \c CplexMip
     69  ///Currently, it is either \c GlpkMip, \c CplexMip , \c CbcMip
    7070  typedef GlpkMip Mip;
    7171#else
    72 #ifdef LEMON_HAVE_GLPK
    73 # define LEMON_DEFAULT_LP GLPK
     72#if LEMON_DEFAULT_LP == GLPK
    7473  typedef GlpkLp Lp;
    75 # define LEMON_DEFAULT_MIP GLPK
    76   typedef GlpkMip Mip;
    77 #elif LEMON_HAVE_CPLEX
    78 # define LEMON_DEFAULT_LP CPLEX
     74#elif LEMON_DEFAULT_LP == CPLEX
    7975  typedef CplexLp Lp;
    80 # define LEMON_DEFAULT_MIP CPLEX
     76#elif LEMON_DEFAULT_LP == SOPLEX
     77  typedef SoplexLp Lp;
     78#elif LEMON_DEFAULT_LP == CLP
     79  typedef ClpLp Lp;
     80#endif
     81#if LEMON_DEFAULT_MIP == GLPK
     82  typedef GlpkLp Mip;
     83#elif LEMON_DEFAULT_MIP == CPLEX
    8184  typedef CplexMip Mip;
    82 #elif LEMON_HAVE_SOPLEX
    83 # define DEFAULT_LP SOPLEX
    84   typedef SoplexLp Lp;
    85 #elif LEMON_HAVE_CLP
    86 # define DEFAULT_LP CLP
    87   typedef ClpLp Lp;
     85#elif LEMON_DEFAULT_MIP == CBC
     86  typedef CbcMip Mip;
    8887#endif
    8988#endif
  • test/lp_test.cc

    r988 r1064  
    241241  {
    242242    LP::DualExpr e,f,g;
    243     LP::Row p1 = INVALID, p2 = INVALID, p3 = INVALID,
    244       p4 = INVALID, p5 = INVALID;
     243    LP::Row p1 = INVALID, p2 = INVALID;
    245244
    246245    e[p1]=2;
Note: See TracChangeset for help on using the changeset viewer.