Models
The following is a list of packages implement the NLPModels API.
If you want your package listed here, open a Pull Request.
If you want to create your own interface, check these Guidelines.
Packages
- NLPModelsModifiers.jl: Models that modify existing models. For instance, creating slack variables, or moving constraints into the objective functions, or using Quasi-Newton LBFSG approximations to the Hessian.
- ADNLPModels.jl: Models with automatic differentiation. It has a very simple interface, although it isn't very efficient for larger problems.
- CUTEst.jl: For problems from CUTEst.
- AmplNLReader.jl: For problems modeled using AMPL
- NLPModelsJuMP.jl: For problems modeled using JuMP.jl.
- QuadraticModels.jl: For problems with quadratic and linear structure.
- LLSModels.jl: Creates a linear least squares model.
- PDENLPModels.jl: For PDE-constrained problems.
Model internals
NLPModels.AbstractNLPModel
— TypeAbstractNLPModel
Base type for an optimization model.
NLPModels.AbstractNLSModel
— TypeAbstractNLSModel <: AbstractNLPModel
Base type for a nonlinear least-squares model.
NLPModels.AbstractNLPModelMeta
— TypeAbstractNLPModelMeta
Base type for metadata related to an optimization model.
NLPModels.NLPModelMeta
— TypeNLPModelMeta <: AbstractNLPModelMeta
A composite type that represents the main features of the optimization problem
optimize obj(x)
subject to lvar ≤ x ≤ uvar
lcon ≤ cons(x) ≤ ucon
where x
is an nvar
-dimensional vector, obj
is the real-valued objective function, cons
is the vector-valued constraint function, optimize
is either "minimize" or "maximize".
Here, lvar
, uvar
, lcon
and ucon
are vectors. Some of their components may be infinite to indicate that the corresponding bound or general constraint is not present.
NLPModelMeta(nvar; kwargs...)
Create an NLPModelMeta
with nvar
variables. The following keyword arguments are accepted:
x0
: initial guesslvar
: vector of lower boundsuvar
: vector of upper boundsnlvb
: number of nonlinear variables in both objectives and constraintsnlvo
: number of nonlinear variables in objectives (includes nlvb)nlvc
: number of nonlinear variables in constraints (includes nlvb)ncon
: number of general constraintsy0
: initial Lagrange multiplierslcon
: vector of constraint lower boundsucon
: vector of constraint upper boundsnnzo
: number of nonzeros in the gradientnnzj
: number of elements needed to store the nonzeros in the sparse Jacobianlin_nnzj
: number of elements needed to store the nonzeros in the sparse Jacobian of linear constraintsnln_nnzj
: number of elements needed to store the nonzeros in the sparse Jacobian of nonlinear constraintsnnzh
: number of elements needed to store the nonzeros in the sparse Hessianlin
: indices of linear constraintsminimize
: true if optimize == minimizeislp
: true if the problem is a linear programname
: problem name
NLPModelMeta
also contains the following attributes:
nvar
: number of variablesifix
: indices of fixed variablesilow
: indices of variables with lower bound onlyiupp
: indices of variables with upper bound onlyirng
: indices of variables with lower and upper bound (range)ifree
: indices of free variablesiinf
: indices of visibly infeasible boundsjfix
: indices of equality constraintsjlow
: indices of constraints of the form c(x) ≥ cljupp
: indices of constraints of the form c(x) ≤ cujrng
: indices of constraints of the form cl ≤ c(x) ≤ cujfree
: indices of "free" constraints (there shouldn't be any)jinf
: indices of the visibly infeasible constraintsnlin
: number of linear constraintsnnln
: number of nonlinear general constraintsnln
: indices of nonlinear constraints
NLPModels.NLSMeta
— TypeNLSMeta
Base type for metadata related to a nonlinear least-squares model.
NLSMeta(nequ, nvar; kwargs...)
Create a NLSMeta
with nequ
equations and nvar
variables. The following keyword arguments are accepted:
x0
: initial guessnnzj
: number of elements needed to store the nonzeros of the Jacobian of the residualnnzh
: number of elements needed to store the nonzeros of the sum of Hessians of the residualslin
: indices of linear residuals
NLSMeta
also contains the following attributes:
nequ
: size of the residualnvar
: number of variablesnln
: indices of nonlinear residualsnnln
: number of nonlinear general residualsnlin
: number of linear residuals
NLPModels.nls_meta
— Functionnls_meta(nls)
Returns the nls_meta
structure of nls
. Use this instead of nls.nls_meta
to handle models that have internal models.
For basic models nls_meta(nls)
is defined as nls.nls_meta
, but composite models might not keep nls_meta
themselves, so they might specialize it to something like nls.internal.nls_meta
.