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

Model internals

NLPModels.NLPModelMetaType
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
  • lin_nnzj: number of elements needed to store the nonzeros in the sparse Jacobian of linear constraints
  • nln_nnzj: number of elements needed to store the nonzeros in the sparse Jacobian of nonlinear constraints
  • nnzh: number of elements needed to store the nonzeros in the sparse Hessian
  • lin: indices of linear constraints
  • minimize: true if optimize == minimize
  • islp: true if the problem is a linear program
  • name: problem name

NLPModelMeta also contains the following attributes:

  • nvar: number of variables
  • ifix: indices of fixed variables
  • ilow: indices of variables with lower bound only
  • iupp: indices of variables with upper bound only
  • irng: indices of variables with lower and upper bound (range)
  • ifree: indices of free variables
  • iinf: indices of visibly infeasible bounds
  • jfix: indices of equality constraints
  • jlow: indices of constraints of the form c(x) ≥ cl
  • jupp: indices of constraints of the form c(x) ≤ cu
  • jrng: indices of constraints of the form cl ≤ c(x) ≤ cu
  • jfree: indices of "free" constraints (there shouldn't be any)
  • jinf: indices of the visibly infeasible constraints
  • nlin: number of linear constraints
  • nnln: number of nonlinear general constraints
  • nln: indices of nonlinear constraints
source
NLPModels.NLSMetaType
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 residuals

NLSMeta also contains the following attributes:

  • nequ: size of the residual
  • nvar: number of variables
  • nln: indices of nonlinear residuals
  • nnln: number of nonlinear general residuals
  • nlin: number of linear residuals
source
NLPModels.nls_metaFunction
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.

source