Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ slsqp Public
forked from jacobwilliams/slsqp

Modern Fortran Edition of the SLSQP Optimizer

License

Notifications You must be signed in to change notification settings

yangshuo/slsqp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slsqp

Modern Fortran Edition of the SLSQP Optimizer

Status

GitHub release Build Status codecov last-commit

Description

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:

  • It has been translated into free-form source.
  • It is now thread safe. The original version was not thread safe due to the use of saved variables in one of the subroutines.
  • It no longer uses obsolescent and non-standard Fortran features. It should now be 100% standard compliant (Fortran 2008).
  • It now has an easy-to-use object-oriented interface. The slsqp_class is used for all interactions with the solver. Methods include initialize(), optimize(), and destroy().
  • It includes updated versions of some of the third-party routines used in the original code (BLAS, LINPACK, and NNLS).
  • Some new features were added to support printing error messages and reporting iterations to the user.
  • The user can now specify the max and min alpha to use during the line search.
  • The user can supply a routine to compute the gradients of the objective function and constriants, or allow the code to estimate them using finite differences (backward, forward, or central).
  • The documentation strings in the code have been converted to FORD format, allowing for nicely formatted documentation to be auto-generated.
  • A couple of bug fixes noted elsewhere have been applied.

License

Building SLSQP

Fortran Package Manager

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" }

Development

  • Development continues on GitHub.

Documentation

The latest API documentation can be found here. This was generated from the source code using FORD.

References

About

Modern Fortran Edition of the SLSQP Optimizer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Fortran 100.0%