# 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`

— Type`AbstractNLPModel`

Base type for an optimization model.

`NLPModels.AbstractNLSModel`

— Type`AbstractNLSModel <: AbstractNLPModel`

Base type for a nonlinear least-squares model.

`NLPModels.AbstractNLPModelMeta`

— Type`AbstractNLPModelMeta`

Base type for metadata related to an optimization model.

`NLPModels.NLPModelMeta`

— Type`NLPModelMeta <: 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 guess`lvar`

: vector of lower bounds`uvar`

: vector of upper bounds`nlvb`

: number of nonlinear variables in both objectives and constraints`nlvo`

: number of nonlinear variables in objectives (includes nlvb)`nlvc`

: number of nonlinear variables in constraints (includes nlvb)`ncon`

: number of general constraints`y0`

: initial Lagrange multipliers`lcon`

: vector of constraint lower bounds`ucon`

: vector of constraint upper bounds`nnzo`

: number of nonzeros in the gradient`nnzj`

: number of elements needed to store the nonzeros in the sparse Jacobian`nnzh`

: number of elements needed to store the nonzeros in the sparse Hessian`nlin`

: number of linear constraints`nnln`

: number of nonlinear general constraints`lin`

: indices of linear constraints`nln`

: indices of nonlinear constraints`minimize`

: true if optimize == minimize`islp`

: true if the problem is a linear program`name`

: problem name

`NLPModels.NLSMeta`

— Type`NLSMeta`

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 guess`nnzj`

: number of elements needed to store the nonzeros of the Jacobian of the residual`nnzh`

: number of elements needed to store the nonzeros of the sum of Hessians of the residuals`lin`

: indices of linear constraints`nln`

: indices of nonlinear constraints

`NLPModels.nls_meta`

— Function`nls_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`

.