Home

Awesome

NLPModels

DocumentationCICoverageReleaseDOI
docs-stable docs-devbuild-gh build-cirruscodecovreleasedoi

This package provides general guidelines to represent non-linear programming (NLP) problems in Julia and a standardized API to evaluate the functions and their derivatives. The main objective is to be able to rely on that API when designing optimization solvers in Julia.

How to Cite

If you use NLPModels.jl in your work, please cite using the format given in CITATION.cff.

Optimization Problems

Optimization problems are represented by an instance of (a subtype of) AbstractNLPModel. Such instances are composed of

See the documentation for details on the models and the API.

Installation

pkg> add NLPModels

Models

This package provides no models, although it allows the definition of manually written models.

Check the list of packages that define models in this page of the docs

Main Methods

If model is an instance of an appropriate subtype of AbstractNLPModel, the following methods are normally defined:

The following methods are defined if first-order derivatives are available:

If Jacobian-vector products can be computed more efficiently than by evaluating the Jacobian explicitly, the following methods may be implemented:

The following method is defined if second-order derivatives are available:

If Hessian-vector products can be computed more efficiently than by evaluating the Hessian explicitly, the following method may be implemented:

Several in-place variants of the methods above may also be implemented.

The complete list of methods that an interface may implement can be found in the documentation.

Attributes

NLPModelMeta objects have the following attributes (with S <: AbstractVector):

AttributeTypeNotes
nvarInt number of variables
x0 Sinitial guess
lvarSvector of lower bounds
uvarSvector of upper bounds
ifixVector{Int}indices of fixed variables
ilowVector{Int}indices of variables with lower bound only
iuppVector{Int}indices of variables with upper bound only
irngVector{Int}indices of variables with lower and upper bound (range)
ifreeVector{Int}indices of free variables
iinfVector{Int}indices of visibly infeasible bounds
nconInt total number of general constraints
nlin Int number of linear constraints
nnlnInt number of nonlinear general constraints
y0 Sinitial Lagrange multipliers
lconSvector of constraint lower bounds
uconSvector of constraint upper bounds
lin Vector{Int}indices of linear constraints
nlnVector{Int}indices of nonlinear constraints
jfixVector{Int}indices of equality constraints
jlowVector{Int}indices of constraints of the form c(x) ≥ cl
juppVector{Int}indices of constraints of the form c(x) ≤ cu
jrngVector{Int}indices of constraints of the form cl ≤ c(x) ≤ cu
jfreeVector{Int}indices of "free" constraints (there shouldn't be any)
jinfVector{Int}indices of the visibly infeasible constraints
nnzoInt number of nonzeros in the gradient
nnzjInt number of nonzeros in the sparse Jacobian
nnzhInt number of nonzeros in the sparse Hessian
minimizeBool true if optimize == minimize
islpBool true if the problem is a linear program
nameStringproblem name

Bug reports and discussions

If you think you found a bug, feel free to open an issue. Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please.

If you want to ask a question not suited for a bug report, feel free to start a discussion here. This forum is for general discussion about this repository and the JuliaSmoothOptimizers, so questions about any of our packages are welcome.