This library includes:
- CMake wrappers for mathematical optimization solvers
- A mathematical programming modeler that supports:
- Coninous and integer variables
- Linear structures
- Quadratic structures
- Nonlinear structures
- Black-box functions
The goal of the modeler are:
- Minimize the modeler's overhead
- Run multiple solvers while writing the model's code once and ensuring that the model passed to each solver is the same
- Keep access to all the direct API features of the solvers
- Minimize the quantity of code to integrate a new solver
- Provide some features to help model debugging
They are not designed to be as user-friendly as possible. And switching solver requires a bit more lines of code than changing a string.
Supported solvers:
- HiGHS (MILP) https://highs.dev/
- Cbc (MILP) https://github.com/coin-or/Cbc
- FICO Xpress (MILP) https://www.fico.com/en/products/fico-xpress-optimization
- Artelys Knitro (all) https://www.artelys.com/solvers/knitro/
- Dlib (box-constrained) https://dlib.net/
- ConicBundle (box-constrained) https://www-user.tu-chemnitz.de/~helmberg/ConicBundle/
Examples:
- MILP:
- Box-constrained (Lagrangian relaxations):
CMake integration example:
# Fetch fontanf/mathoptsolverscmake.
set(MATHOPTSOLVERSCMAKE_USE_CLP ON)
FetchContent_Declare(
mathoptsolverscmake
GIT_REPOSITORY https://github.com/fontanf/mathoptsolverscmake.git
GIT_TAG ...)
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../mathoptsolverscmake/")
FetchContent_MakeAvailable(mathoptsolverscmake)
...
target_link_libraries(MyProject_my_target PUBLIC
MathOptSolversCMake::clp)