Modern Fortran Edition of the SLSQP Optimizer
This is an updated version of the SLSQP nonlinear constrained optimization code. It can be used to solve nonlinear programming problems that seek to minimize a scalar performance index subject to nonlinear equality and inequality constraints as well as bounds on the variables.
Updates to the original code include:
slsqp_class
is used for all interactions with the solver. Methods include initialize()
, optimize()
, and destroy()
.alpha
to use during the line search.The library can be built with the Fortran Package Manager using the provided fpm.toml
file like so:
fpm build --release
By default, the library is built with double precision (real64
) real values. Explicitly specifying the real kind can be done using the following processor flags:
Preprocessor flag | Kind | Number of bytes |
---|---|---|
REAL32 |
real(kind=real32) |
4 |
REAL64 |
real(kind=real64) |
8 |
REAL128 |
real(kind=real128) |
16 |
For example, to build a single precision version of the library, use:
fpm build --profile release --flag "-DREAL32"
To use SLSQP within your fpm project, add the following to your fpm.toml
file:
[dependencies]
slsqp = { git="https://github.com/jacobwilliams/slsqp.git" }
or, to use a specific version:
[dependencies]
slsqp = { git="https://github.com/jacobwilliams/slsqp.git", tag = "1.3.0" }
The library requires some BLAS routines, which are included. However, the user may also choose to link to an external BLAS library. This can be done by using the HAS_BLAS
compiler directive. For example:
fpm build --compiler gfortran --flag "-DHAS_BLAS -lblas"
However, note that an external BLAS can only be used if the library is compiled with double precision (real64
) reals.
The latest API documentation can be found here. This was generated from the source code using FORD.