Reference
Contents
Index
NLPModels.AbstractNLPModelNLPModels.AbstractNLPModelMetaNLPModels.AbstractNLSModelNLPModels.CountersNLPModels.DimensionErrorNLPModels.NLPModelMetaNLPModels.NLSCountersNLPModels.NLSMetaBase.eltypeLinearOperators.reset!LinearOperators.reset!NLPModels.bound_constrainedNLPModels.consNLPModels.cons!NLPModels.cons_linNLPModels.cons_lin!NLPModels.cons_nlnNLPModels.cons_nln!NLPModels.conscaleNLPModels.coo_prod!NLPModels.coo_sym_prod!NLPModels.decrement!NLPModels.equality_constrainedNLPModels.get_ifixNLPModels.get_ifreeNLPModels.get_iinfNLPModels.get_ilowNLPModels.get_irngNLPModels.get_islpNLPModels.get_iuppNLPModels.get_jfixNLPModels.get_jfreeNLPModels.get_jinfNLPModels.get_jlowNLPModels.get_jrngNLPModels.get_juppNLPModels.get_lconNLPModels.get_linNLPModels.get_linNLPModels.get_lin_nnzjNLPModels.get_lvarNLPModels.get_minimizeNLPModels.get_nameNLPModels.get_nconNLPModels.get_nequNLPModels.get_nlinNLPModels.get_nlinNLPModels.get_nlnNLPModels.get_nlnNLPModels.get_nln_nnzjNLPModels.get_nlvbNLPModels.get_nlvcNLPModels.get_nlvoNLPModels.get_nnlnNLPModels.get_nnlnNLPModels.get_nnzhNLPModels.get_nnzhNLPModels.get_nnzjNLPModels.get_nnzjNLPModels.get_nnzoNLPModels.get_nvarNLPModels.get_nvarNLPModels.get_uconNLPModels.get_uvarNLPModels.get_x0NLPModels.get_x0NLPModels.get_y0NLPModels.ghjvprodNLPModels.ghjvprod!NLPModels.gradNLPModels.grad!NLPModels.grad!NLPModels.has_boundsNLPModels.has_equalitiesNLPModels.has_inequalitiesNLPModels.hessNLPModels.hessNLPModels.hess_coordNLPModels.hess_coordNLPModels.hess_coord!NLPModels.hess_coord!NLPModels.hess_coord_residualNLPModels.hess_coord_residual!NLPModels.hess_opNLPModels.hess_opNLPModels.hess_op!NLPModels.hess_op!NLPModels.hess_op!NLPModels.hess_op_residualNLPModels.hess_op_residual!NLPModels.hess_residualNLPModels.hess_structureNLPModels.hess_structure!NLPModels.hess_structure_residualNLPModels.hess_structure_residual!NLPModels.histlineNLPModels.hprodNLPModels.hprodNLPModels.hprod!NLPModels.hprod!NLPModels.hprod!NLPModels.hprod_residualNLPModels.hprod_residual!NLPModels.increment!NLPModels.increment!NLPModels.inequality_constrainedNLPModels.jacNLPModels.jac_coordNLPModels.jac_coord!NLPModels.jac_coord_residualNLPModels.jac_coord_residual!NLPModels.jac_linNLPModels.jac_lin_coordNLPModels.jac_lin_coord!NLPModels.jac_lin_opNLPModels.jac_lin_op!NLPModels.jac_lin_op!NLPModels.jac_lin_structureNLPModels.jac_lin_structure!NLPModels.jac_nlnNLPModels.jac_nln_coordNLPModels.jac_nln_coord!NLPModels.jac_nln_opNLPModels.jac_nln_op!NLPModels.jac_nln_op!NLPModels.jac_nln_structureNLPModels.jac_nln_structure!NLPModels.jac_opNLPModels.jac_op!NLPModels.jac_op!NLPModels.jac_op_residualNLPModels.jac_op_residual!NLPModels.jac_op_residual!NLPModels.jac_residualNLPModels.jac_structureNLPModels.jac_structure!NLPModels.jac_structure_residualNLPModels.jac_structure_residual!NLPModels.jprodNLPModels.jprod!NLPModels.jprod!NLPModels.jprod_linNLPModels.jprod_lin!NLPModels.jprod_lin!NLPModels.jprod_nlnNLPModels.jprod_nln!NLPModels.jprod_nln!NLPModels.jprod_residualNLPModels.jprod_residual!NLPModels.jprod_residual!NLPModels.jth_hessNLPModels.jth_hess_coordNLPModels.jth_hess_coord!NLPModels.jth_hess_residualNLPModels.jth_hess_residual_coordNLPModels.jth_hess_residual_coord!NLPModels.jth_hprodNLPModels.jth_hprod!NLPModels.jtprodNLPModels.jtprod!NLPModels.jtprod!NLPModels.jtprod_linNLPModels.jtprod_lin!NLPModels.jtprod_lin!NLPModels.jtprod_nlnNLPModels.jtprod_nln!NLPModels.jtprod_nln!NLPModels.jtprod_residualNLPModels.jtprod_residual!NLPModels.jtprod_residual!NLPModels.lagscaleNLPModels.linearly_constrainedNLPModels.lines_of_descriptionNLPModels.lines_of_descriptionNLPModels.lines_of_histNLPModels.neval_consNLPModels.neval_cons_linNLPModels.neval_cons_nlnNLPModels.neval_gradNLPModels.neval_hessNLPModels.neval_hess_residualNLPModels.neval_hprodNLPModels.neval_hprod_residualNLPModels.neval_jacNLPModels.neval_jac_linNLPModels.neval_jac_nlnNLPModels.neval_jac_residualNLPModels.neval_jconNLPModels.neval_jgradNLPModels.neval_jhessNLPModels.neval_jhess_residualNLPModels.neval_jhprodNLPModels.neval_jprodNLPModels.neval_jprod_linNLPModels.neval_jprod_nlnNLPModels.neval_jprod_residualNLPModels.neval_jtprodNLPModels.neval_jtprod_linNLPModels.neval_jtprod_nlnNLPModels.neval_jtprod_residualNLPModels.neval_objNLPModels.neval_residualNLPModels.nls_metaNLPModels.objNLPModels.objNLPModels.objconsNLPModels.objcons!NLPModels.objcons!NLPModels.objgradNLPModels.objgrad!NLPModels.objgrad!NLPModels.reset_data!NLPModels.residualNLPModels.residual!NLPModels.show_countersNLPModels.show_headerNLPModels.sparsitylineNLPModels.sum_countersNLPModels.sum_countersNLPModels.unconstrainedNLPModels.varscaleNLPModels.@default_countersNLPModels.@default_nlscountersNLPModels.@lencheckNLPModels.@rangecheck
NLPModels.AbstractNLPModel — Type
AbstractNLPModelBase type for an optimization model.
NLPModels.AbstractNLPModelMeta — Type
AbstractNLPModelMetaBase type for metadata related to an optimization model.
NLPModels.AbstractNLSModel — Type
AbstractNLSModel <: AbstractNLPModelBase type for a nonlinear least-squares model.
NLPModels.Counters — Type
CountersStruct for storing the number of function evaluations.
Counters()Creates an empty Counters struct.
NLPModels.DimensionError — Type
DimensionError <: Exception
DimensionError(name, dim_expected, dim_found)Error for unexpected dimension. Output: "DimensionError: Input name should have length dim_expected not dim_found"
NLPModels.NLPModelMeta — Type
NLPModelMeta <: AbstractNLPModelMetaA composite type that represents the main features of the optimization problem
optimize obj(x)
subject to lvar ≤ x ≤ uvar
lcon ≤ cons(x) ≤ uconwhere 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::Integer; kwargs...)
NLPModelMeta(meta::AbstractNLPModelMeta; kwargs...)Create an NLPModelMeta with nvar variables. Alternatively, create an NLPModelMeta copy from another AbstractNLPModelMeta. 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, which are computed from the variables above:
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.NLSCounters — Type
NLSCountersStruct for storing the number of functions evaluations for nonlinear least-squares models. NLSCounters also stores a Counters instance named counters.
NLSCounters()Creates an empty NLSCounters struct.
NLPModels.NLSMeta — Type
NLSMetaBase 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, which are computed from the variables above:
nequ: size of the residualnvar: number of variablesnln: indices of nonlinear residualsnnln: number of nonlinear general residualsnlin: number of linear residuals
Base.eltype — Method
eltype(nlp::AbstractNLPModel{T, S})Element type of nlp.meta.x0.
LinearOperators.reset! — Method
reset!(nlp)Reset evaluation count and model data (if appropriate) in nlp.
LinearOperators.reset! — Method
reset!(counters)Reset evaluation counters
NLPModels.bound_constrained — Method
bound_constrained(nlp)
bound_constrained(meta)Returns whether the problem has bounds on the variables and no other constraints.
NLPModels.cons! — Method
c = cons!(nlp, x, c)Evaluate $c(x)$, the constraints at x in place.
NLPModels.cons — Method
c = cons(nlp, x)Evaluate $c(x)$, the constraints at x.
NLPModels.cons_lin! — Function
c = cons_lin!(nlp, x, c)Evaluate the linear constraints at x in place.
NLPModels.cons_lin — Method
c = cons_lin(nlp, x)Evaluate the linear constraints at x.
NLPModels.cons_nln! — Function
c = cons_nln!(nlp, x, c)Evaluate the nonlinear constraints at x in place.
NLPModels.cons_nln — Method
c = cons_nln(nlp, x)Evaluate the nonlinear constraints at x.
NLPModels.conscale — Function
conscale(model::AbstractNLPModel)Return a vector of constraint scaling factors for the model. These are typically used to normalize constraints to have similar magnitudes and improve convergence behavior in nonlinear solvers.
NLPModels.coo_prod! — Method
coo_prod!(rows, cols, vals, v, Av)Compute the product of a matrix A given by (rows, cols, vals) and the vector v. The result is stored in Av, which should have length equals to the number of rows of A.
NLPModels.coo_sym_prod! — Method
coo_sym_prod!(rows, cols, vals, v, Av)Compute the product of a symmetric matrix A given by (rows, cols, vals) and the vector v. The result is stored in Av, which should have length equals to the number of rows of A. Only one triangle of A should be passed.
NLPModels.decrement! — Method
decrement!(nlp, s)Decrement counter s of problem nlp.
NLPModels.equality_constrained — Method
equality_constrained(nlp)
equality_constrained(meta)Returns whether the problem's constraints are all equalities. Unconstrained problems return false.
NLPModels.get_ifix — Method
get_ifix(nlp)
get_ifix(meta)Return the value ifix from meta or nlp.meta.
NLPModels.get_ifree — Method
get_ifree(nlp)
get_ifree(meta)Return the value ifree from meta or nlp.meta.
NLPModels.get_iinf — Method
get_iinf(nlp)
get_iinf(meta)Return the value iinf from meta or nlp.meta.
NLPModels.get_ilow — Method
get_ilow(nlp)
get_ilow(meta)Return the value ilow from meta or nlp.meta.
NLPModels.get_irng — Method
get_irng(nlp)
get_irng(meta)Return the value irng from meta or nlp.meta.
NLPModels.get_islp — Method
get_islp(nlp)
get_islp(meta)Return the value islp from meta or nlp.meta.
NLPModels.get_iupp — Method
get_iupp(nlp)
get_iupp(meta)Return the value iupp from meta or nlp.meta.
NLPModels.get_jfix — Method
get_jfix(nlp)
get_jfix(meta)Return the value jfix from meta or nlp.meta.
NLPModels.get_jfree — Method
get_jfree(nlp)
get_jfree(meta)Return the value jfree from meta or nlp.meta.
NLPModels.get_jinf — Method
get_jinf(nlp)
get_jinf(meta)Return the value jinf from meta or nlp.meta.
NLPModels.get_jlow — Method
get_jlow(nlp)
get_jlow(meta)Return the value jlow from meta or nlp.meta.
NLPModels.get_jrng — Method
get_jrng(nlp)
get_jrng(meta)Return the value jrng from meta or nlp.meta.
NLPModels.get_jupp — Method
get_jupp(nlp)
get_jupp(meta)Return the value jupp from meta or nlp.meta.
NLPModels.get_lcon — Method
get_lcon(nlp)
get_lcon(meta)Return the value lcon from meta or nlp.meta.
NLPModels.get_lin — Method
get_lin(nlp)
get_lin(meta)Return the value lin from meta or nlp.meta.
NLPModels.get_lin — Method
get_lin(nls)
get_lin(nls_meta)Return the value lin from nls_meta or nls.nls_meta.
NLPModels.get_lin_nnzj — Method
get_lin_nnzj(nlp)
get_lin_nnzj(meta)Return the value lin_nnzj from meta or nlp.meta.
NLPModels.get_lvar — Method
get_lvar(nlp)
get_lvar(meta)Return the value lvar from meta or nlp.meta.
NLPModels.get_minimize — Method
get_minimize(nlp)
get_minimize(meta)Return the value minimize from meta or nlp.meta.
NLPModels.get_name — Method
get_name(nlp)
get_name(meta)Return the value name from meta or nlp.meta.
NLPModels.get_ncon — Method
get_ncon(nlp)
get_ncon(meta)Return the value ncon from meta or nlp.meta.
NLPModels.get_nequ — Method
get_nequ(nls)
get_nequ(nls_meta)Return the value nequ from nls_meta or nls.nls_meta.
NLPModels.get_nlin — Method
get_nlin(nlp)
get_nlin(meta)Return the value nlin from meta or nlp.meta.
NLPModels.get_nlin — Method
get_nlin(nls)
get_nlin(nls_meta)Return the value nlin from nls_meta or nls.nls_meta.
NLPModels.get_nln — Method
get_nln(nlp)
get_nln(meta)Return the value nln from meta or nlp.meta.
NLPModels.get_nln — Method
get_nln(nls)
get_nln(nls_meta)Return the value nln from nls_meta or nls.nls_meta.
NLPModels.get_nln_nnzj — Method
get_nln_nnzj(nlp)
get_nln_nnzj(meta)Return the value nln_nnzj from meta or nlp.meta.
NLPModels.get_nlvb — Method
get_nlvb(nlp)
get_nlvb(meta)Return the value nlvb from meta or nlp.meta.
NLPModels.get_nlvc — Method
get_nlvc(nlp)
get_nlvc(meta)Return the value nlvc from meta or nlp.meta.
NLPModels.get_nlvo — Method
get_nlvo(nlp)
get_nlvo(meta)Return the value nlvo from meta or nlp.meta.
NLPModels.get_nnln — Method
get_nnln(nlp)
get_nnln(meta)Return the value nnln from meta or nlp.meta.
NLPModels.get_nnln — Method
get_nnln(nls)
get_nnln(nls_meta)Return the value nnln from nls_meta or nls.nls_meta.
NLPModels.get_nnzh — Method
get_nnzh(nlp)
get_nnzh(meta)Return the value nnzh from meta or nlp.meta.
NLPModels.get_nnzh — Method
get_nnzh(nls)
get_nnzh(nls_meta)Return the value nnzh from nls_meta or nls.nls_meta.
NLPModels.get_nnzj — Method
get_nnzj(nlp)
get_nnzj(meta)Return the value nnzj from meta or nlp.meta.
NLPModels.get_nnzj — Method
get_nnzj(nls)
get_nnzj(nls_meta)Return the value nnzj from nls_meta or nls.nls_meta.
NLPModels.get_nnzo — Method
get_nnzo(nlp)
get_nnzo(meta)Return the value nnzo from meta or nlp.meta.
NLPModels.get_nvar — Method
get_nvar(nlp)
get_nvar(meta)Return the value nvar from meta or nlp.meta.
NLPModels.get_nvar — Method
get_nvar(nls)
get_nvar(nls_meta)Return the value nvar from nls_meta or nls.nls_meta.
NLPModels.get_ucon — Method
get_ucon(nlp)
get_ucon(meta)Return the value ucon from meta or nlp.meta.
NLPModels.get_uvar — Method
get_uvar(nlp)
get_uvar(meta)Return the value uvar from meta or nlp.meta.
NLPModels.get_x0 — Method
get_x0(nlp)
get_x0(meta)Return the value x0 from meta or nlp.meta.
NLPModels.get_x0 — Method
get_x0(nls)
get_x0(nls_meta)Return the value x0 from nls_meta or nls.nls_meta.
NLPModels.get_y0 — Method
get_y0(nlp)
get_y0(meta)Return the value y0 from meta or nlp.meta.
NLPModels.ghjvprod! — Function
ghjvprod!(nlp, x, g, v, gHv)Return the vector whose i-th component is gᵀ ∇²cᵢ(x) v in place.
NLPModels.ghjvprod — Method
gHv = ghjvprod(nlp, x, g, v)Return the vector whose i-th component is gᵀ ∇²cᵢ(x) v.
NLPModels.grad! — Function
g = grad!(nlp, x, g)Evaluate $∇f(x)$, the gradient of the objective function at x in place.
NLPModels.grad! — Method
g = grad!(nls, x, g)
g = grad!(nls, x, g, Fx; recompute::Bool=true)Evaluate ∇f(x), the gradient of the objective function of nls::AbstractNLSModel at x in place. Fx is overwritten with the value of the residual F(x). If recompute is true, then Fx is updated with the residual at x.
NLPModels.grad — Method
g = grad(nlp, x)Evaluate $∇f(x)$, the gradient of the objective function at x.
NLPModels.has_bounds — Method
has_bounds(nlp)
has_bounds(meta)Returns whether the problem has bounds on the variables.
NLPModels.has_equalities — Method
has_equalities(nlp)Returns whether the problem has constraints and at least one of them is an equality. Unconstrained problems return false.
NLPModels.has_inequalities — Method
has_inequalities(nlp)Returns whether the problem has constraints and at least one of them is an inequality. Unconstrained problems return false.
NLPModels.hess — Method
Hx = hess(nlp, x, y; obj_weight=1.0)Evaluate the Lagrangian Hessian at (x,y) as a sparse matrix, with objective function scaled by obj_weight, i.e.,
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight . A Symmetric object wrapping the lower triangle is returned.
NLPModels.hess — Method
Hx = hess(nlp, x; obj_weight=1.0)Evaluate the objective Hessian at x as a sparse matrix, with objective function scaled by obj_weight, i.e.,
\[σ ∇²f(x),\]
with σ = obj_weight . A Symmetric object wrapping the lower triangle is returned.
NLPModels.hess_coord! — Function
vals = hess_coord!(nlp, x, y, vals; obj_weight=1.0)Evaluate the Lagrangian Hessian at (x,y) in sparse coordinate format, with objective function scaled by obj_weight, i.e.,
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight , overwriting vals. Only the lower triangle is returned.
NLPModels.hess_coord! — Method
vals = hess_coord!(nlp, x, vals; obj_weight=1.0)Evaluate the objective Hessian at x in sparse coordinate format, with objective function scaled by obj_weight, i.e.,
\[σ ∇²f(x),\]
with σ = obj_weight , overwriting vals. Only the lower triangle is returned.
NLPModels.hess_coord — Method
vals = hess_coord(nlp, x, y; obj_weight=1.0)Evaluate the Lagrangian Hessian at (x,y) in sparse coordinate format, with objective function scaled by obj_weight, i.e.,
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight . Only the lower triangle is returned.
NLPModels.hess_coord — Method
vals = hess_coord(nlp, x; obj_weight=1.0)Evaluate the objective Hessian at x in sparse coordinate format, with objective function scaled by obj_weight, i.e.,
\[σ ∇²f(x),\]
with σ = obj_weight . Only the lower triangle is returned.
NLPModels.hess_coord_residual! — Function
vals = hess_coord_residual!(nls, x, v, vals)Computes the linear combination of the Hessians of the residuals at x with coefficients v in sparse coordinate format, rewriting vals.
NLPModels.hess_coord_residual — Method
vals = hess_coord_residual(nls, x, v)Computes the linear combination of the Hessians of the residuals at x with coefficients v in sparse coordinate format.
NLPModels.hess_op! — Method
H = hess_op!(nlp, x, y, Hv; obj_weight=1.0)Return the Lagrangian Hessian at (x,y) with objective function scaled by obj_weight as a linear operator, and storing the result on Hv. The resulting object may be used as if it were a matrix, e.g., w = H * v. The vector Hv is used as preallocated storage for the operation. The linear operator H represents
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight .
NLPModels.hess_op! — Method
H = hess_op!(nlp, x, Hv; obj_weight=1.0)Return the objective Hessian at x with objective function scaled by obj_weight as a linear operator, and storing the result on Hv. The resulting object may be used as if it were a matrix, e.g., w = H * v. The vector Hv is used as preallocated storage for the operation. The linear operator H represents
\[σ ∇²f(x),\]
with σ = obj_weight .
NLPModels.hess_op! — Method
H = hess_op!(nlp, rows, cols, vals, Hv)Return the Hessian given by (rows, cols, vals) as a linear operator, and storing the result on Hv. The resulting object may be used as if it were a matrix, e.g., w = H * v. The vector Hv is used as preallocated storage for the operation. The linear operator H represents
\[σ ∇²f(x),\]
with σ = obj_weight .
NLPModels.hess_op — Method
H = hess_op(nlp, x, y; obj_weight=1.0)Return the Lagrangian Hessian at (x,y) with objective function scaled by obj_weight as a linear operator. The resulting object may be used as if it were a matrix, e.g., H * v. The linear operator H represents
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight .
NLPModels.hess_op — Method
H = hess_op(nlp, x; obj_weight=1.0)Return the objective Hessian at x with objective function scaled by obj_weight as a linear operator. The resulting object may be used as if it were a matrix, e.g., H * v. The linear operator H represents
\[σ ∇²f(x),\]
with σ = obj_weight .
NLPModels.hess_op_residual! — Method
Hop = hess_op_residual!(nls, x, i, Hiv)Computes the Hessian of the i-th residual at x, in linear operator form. The vector Hiv is used as preallocated storage for the operation.
NLPModels.hess_op_residual — Method
Hop = hess_op_residual(nls, x, i)Computes the Hessian of the i-th residual at x, in linear operator form.
NLPModels.hess_residual — Method
H = hess_residual(nls, x, v)Computes the linear combination of the Hessians of the residuals at x with coefficients v. A Symmetric object wrapping the lower triangle is returned.
NLPModels.hess_structure! — Function
hess_structure!(nlp, rows, cols)Return the structure of the Lagrangian Hessian in sparse coordinate format in place.
NLPModels.hess_structure — Method
(rows,cols) = hess_structure(nlp)Return the structure of the Lagrangian Hessian in sparse coordinate format.
NLPModels.hess_structure_residual! — Function
hess_structure_residual!(nls, rows, cols)Returns the structure of the residual Hessian in place.
NLPModels.hess_structure_residual — Method
(rows,cols) = hess_structure_residual(nls)Returns the structure of the residual Hessian.
NLPModels.histline — Method
histline(s, v, maxv)Return a string of the form
______NAME______: ████⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 5where:
______NAME______isswith padding to the left and length 16.- And the symbols █ and ⋅ fill 20 characters in the proportion of
v / maxvto █ and the rest to ⋅. - The number
5is v.
NLPModels.hprod! — Function
Hv = hprod!(nlp, x, y, v, Hv; obj_weight=1.0)Evaluate the product of the Lagrangian Hessian at (x,y) with the vector v in place, with objective function scaled by obj_weight, where the Lagrangian Hessian is
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight .
NLPModels.hprod! — Method
Hv = hprod!(nlp, rows, cols, vals, v, Hv)Evaluate the product of the objective or Lagrangian Hessian given by (rows, cols, vals) in triplet format with the vector v in place. Only one triangle of the Hessian should be given.
NLPModels.hprod! — Method
Hv = hprod!(nlp, x, v, Hv; obj_weight=1.0)Evaluate the product of the objective Hessian at x with the vector v in place, with objective function scaled by obj_weight, where the objective Hessian is
\[σ ∇²f(x),\]
with σ = obj_weight .
NLPModels.hprod — Method
Hv = hprod(nlp, x, y, v; obj_weight=1.0)Evaluate the product of the Lagrangian Hessian at (x,y) with the vector v, with objective function scaled by obj_weight, where the Lagrangian Hessian is
\[∇²L(x,y) = σ ∇²f(x) + \sum_i yᵢ ∇²cᵢ(x),\]
with σ = obj_weight .
NLPModels.hprod — Method
Hv = hprod(nlp, x, v; obj_weight=1.0)Evaluate the product of the objective Hessian at x with the vector v, with objective function scaled by obj_weight, where the objective Hessian is
\[σ ∇²f(x),\]
with σ = obj_weight .
NLPModels.hprod_residual! — Function
Hiv = hprod_residual!(nls, x, i, v, Hiv)Computes the product of the Hessian of the i-th residual at x, times the vector v, and stores it in vector Hiv.
NLPModels.hprod_residual — Method
Hiv = hprod_residual(nls, x, i, v)Computes the product of the Hessian of the i-th residual at x, times the vector v.
NLPModels.increment! — Method
increment!(nlp, s)Increment counter s of problem nlp.
NLPModels.increment! — Method
increment!(nls, s)Increment counter s of problem nls.
NLPModels.inequality_constrained — Method
inequality_constrained(nlp)
inequality_constrained(meta)Returns whether the problem's constraints are all inequalities. Unconstrained problems return true.
NLPModels.jac — Method
Jx = jac(nlp, x)Evaluate $J(x)$, the constraints Jacobian at x as a sparse matrix.
NLPModels.jac_coord! — Method
vals = jac_coord!(nlp, x, vals)Evaluate $J(x)$, the constraints Jacobian at x in sparse coordinate format, rewriting vals.
NLPModels.jac_coord — Method
vals = jac_coord(nlp, x)Evaluate $J(x)$, the constraints Jacobian at x in sparse coordinate format.
NLPModels.jac_coord_residual! — Function
vals = jac_coord_residual!(nls, x, vals)Computes the Jacobian of the residual at x in sparse coordinate format, rewriting vals. rows and cols are not rewritten.
NLPModels.jac_coord_residual — Method
(rows,cols,vals) = jac_coord_residual(nls, x)Computes the Jacobian of the residual at x in sparse coordinate format.
NLPModels.jac_lin — Method
Jx = jac_lin(nlp)Evaluate the linear constraints Jacobian as a sparse matrix.
NLPModels.jac_lin_coord! — Function
vals = jac_lin_coord!(nlp, vals)Evaluate the linear constraints Jacobian in sparse coordinate format, overwriting vals.
NLPModels.jac_lin_coord — Method
vals = jac_lin_coord(nlp)Evaluate the linear constraints Jacobian in sparse coordinate format.
NLPModels.jac_lin_op! — Method
J = jac_lin_op!(nlp, Jv, Jtv)Return the linear Jacobian as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v. The values Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_lin_op! — Method
J = jac_lin_op!(nlp, rows, cols, vals, Jv, Jtv)Return the linear Jacobian given by (rows, cols, vals) as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v. The values Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_lin_op — Method
J = jac_lin_op(nlp)Return the linear Jacobian as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v.
NLPModels.jac_lin_structure! — Function
jac_lin_structure!(nlp, rows, cols)Return the structure of the linear constraints Jacobian in sparse coordinate format in place.
NLPModels.jac_lin_structure — Method
(rows,cols) = jac_lin_structure(nlp)Return the structure of the linear constraints Jacobian in sparse coordinate format.
NLPModels.jac_nln — Method
Jx = jac_nln(nlp, x)Evaluate $J(x)$, the nonlinear constraints Jacobian at x as a sparse matrix.
NLPModels.jac_nln_coord! — Function
vals = jac_nln_coord!(nlp, x, vals)Evaluate $J(x)$, the nonlinear constraints Jacobian at x in sparse coordinate format, overwriting vals.
NLPModels.jac_nln_coord — Method
vals = jac_nln_coord(nlp, x)Evaluate $J(x)$, the nonlinear constraints Jacobian at x in sparse coordinate format.
NLPModels.jac_nln_op! — Method
J = jac_nln_op!(nlp, rows, cols, vals, Jv, Jtv)Return the nonlinear Jacobian given by (rows, cols, vals) as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v. The values Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_nln_op! — Method
J = jac_nln_op!(nlp, x, Jv, Jtv)Return the nonlinear Jacobian at x as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v. The values Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_nln_op — Method
J = jac_nln_op(nlp, x)Return the nonlinear Jacobian at x as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v.
NLPModels.jac_nln_structure! — Function
jac_nln_structure!(nlp, rows, cols)Return the structure of the nonlinear constraints Jacobian in sparse coordinate format in place.
NLPModels.jac_nln_structure — Method
(rows,cols) = jac_nln_structure(nlp)Return the structure of the nonlinear constraints Jacobian in sparse coordinate format.
NLPModels.jac_op! — Method
J = jac_op!(nlp, rows, cols, vals, Jv, Jtv)Return the Jacobian given by (rows, cols, vals) as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v. The values Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_op! — Method
J = jac_op!(nlp, x, Jv, Jtv)Return the Jacobian at x as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v. The values Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_op — Method
J = jac_op(nlp, x)Return the Jacobian at x as a linear operator. The resulting object may be used as if it were a matrix, e.g., J * v or J' * v.
NLPModels.jac_op_residual! — Method
Jx = jac_op_residual!(nls, x, Jv, Jtv)Computes $J(x)$, the Jacobian of the residual at x, in linear operator form. The vectors Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_op_residual! — Method
Jx = jac_op_residual!(nls, rows, cols, vals, Jv, Jtv)Computes $J(x)$, the Jacobian of the residual given by (rows, cols, vals), in linear operator form. The vectors Jv and Jtv are used as preallocated storage for the operations.
NLPModels.jac_op_residual — Method
Jx = jac_op_residual(nls, x)Computes $J(x)$, the Jacobian of the residual at x, in linear operator form.
NLPModels.jac_residual — Method
Jx = jac_residual(nls, x)Computes $J(x)$, the Jacobian of the residual at x.
NLPModels.jac_structure! — Method
jac_structure!(nlp, rows, cols)Return the structure of the constraints Jacobian in sparse coordinate format in place.
NLPModels.jac_structure — Method
(rows,cols) = jac_structure(nlp)Return the structure of the constraints Jacobian in sparse coordinate format.
NLPModels.jac_structure_residual! — Function
(rows,cols) = jac_structure_residual!(nls, rows, cols)Returns the structure of the constraint's Jacobian in sparse coordinate format in place.
NLPModels.jac_structure_residual — Method
(rows,cols) = jac_structure_residual(nls)Returns the structure of the constraint's Jacobian in sparse coordinate format.
NLPModels.jprod! — Method
Jv = jprod!(nlp, x, v, Jv)Evaluate $J(x)v$, the Jacobian-vector product at x in place.
NLPModels.jprod! — Method
Jv = jprod!(nlp, rows, cols, vals, v, Jv)Evaluate $J(x)v$, the Jacobian-vector product, where the Jacobian is given by (rows, cols, vals) in triplet format.
NLPModels.jprod — Method
Jv = jprod(nlp, x, v)Evaluate $J(x)v$, the Jacobian-vector product at x.
NLPModels.jprod_lin! — Function
Jv = jprod_lin!(nlp, v, Jv)Evaluate $J(x)v$, the linear Jacobian-vector product at x in place.
NLPModels.jprod_lin! — Method
Jv = jprod_lin!(nlp, rows, cols, vals, v, Jv)Evaluate $J(x)v$, the linear Jacobian-vector product, where the Jacobian is given by (rows, cols, vals) in triplet format.
NLPModels.jprod_lin — Method
Jv = jprod_lin(nlp, v)Evaluate $J(x)v$, the linear Jacobian-vector product at x.
NLPModels.jprod_nln! — Function
Jv = jprod_nln!(nlp, x, v, Jv)Evaluate $J(x)v$, the nonlinear Jacobian-vector product at x in place.
NLPModels.jprod_nln! — Method
Jv = jprod_nln!(nlp, rows, cols, vals, v, Jv)Evaluate $J(x)v$, the nonlinear Jacobian-vector product, where the Jacobian is given by (rows, cols, vals) in triplet format.
NLPModels.jprod_nln — Method
Jv = jprod_nln(nlp, x, v)Evaluate $J(x)v$, the nonlinear Jacobian-vector product at x.
NLPModels.jprod_residual! — Function
Jv = jprod_residual!(nls, x, v, Jv)Computes the product of the Jacobian of the residual at x and a vector, i.e., $J(x)v$, storing it in Jv.
NLPModels.jprod_residual! — Method
Jv = jprod_residual!(nls, rows, cols, vals, v, Jv)Computes the product of the Jacobian of the residual given by (rows, cols, vals) and a vector, i.e., $J(x)v$, storing it in Jv.
NLPModels.jprod_residual — Method
Jv = jprod_residual(nls, x, v)Computes the product of the Jacobian of the residual at x and a vector, i.e., $J(x)v$.
NLPModels.jth_hess — Method
Hx = jth_hess(nlp, x, j)Evaluate the Hessian of j-th constraint at x as a sparse matrix with the same sparsity pattern as the Lagrangian Hessian. A Symmetric object wrapping the lower triangle is returned.
NLPModels.jth_hess_coord! — Function
vals = jth_hess_coord!(nlp, x, j, vals)Evaluate the Hessian of j-th constraint at x in sparse coordinate format, with vals of length nlp.meta.nnzh, in place. Only the lower triangle is returned.
NLPModels.jth_hess_coord — Method
vals = jth_hess_coord(nlp, x, j)Evaluate the Hessian of j-th constraint at x in sparse coordinate format. Only the lower triangle is returned.
NLPModels.jth_hess_residual — Method
Hj = jth_hess_residual(nls, x, j)Computes the Hessian of the j-th residual at x.
NLPModels.jth_hess_residual_coord! — Method
vals = jth_hess_residual_coord!(nls, x, j, vals)Evaluate the Hessian of j-th residual at x in sparse coordinate format, with vals of length nls.nls_meta.nnzh, in place. Only the lower triangle is returned.
NLPModels.jth_hess_residual_coord — Method
vals = jth_hess_residual_coord(nls, x, j)Evaluate the Hessian of j-th residual at x in sparse coordinate format. Only the lower triangle is returned.
NLPModels.jth_hprod! — Function
Hv = jth_hprod!(nlp, x, v, j, Hv)Evaluate the product of the Hessian of j-th constraint at x with the vector v in place.
NLPModels.jth_hprod — Method
Hv = jth_hprod(nlp, x, v, j)Evaluate the product of the Hessian of j-th constraint at x with the vector v.
NLPModels.jtprod! — Method
Jtv = jtprod!(nlp, x, v, Jtv)Evaluate $J(x)^Tv$, the transposed-Jacobian-vector product at x in place. If the problem has linear and nonlinear constraints, this function allocates.
NLPModels.jtprod! — Method
Jtv = jtprod!(nlp, rows, cols, vals, v, Jtv)Evaluate $J(x)^Tv$, the transposed-Jacobian-vector product, where the Jacobian is given by (rows, cols, vals) in triplet format.
NLPModels.jtprod — Method
Jtv = jtprod(nlp, x, v)Evaluate $J(x)^Tv$, the transposed-Jacobian-vector product at x.
NLPModels.jtprod_lin! — Function
Jtv = jtprod_lin!(nlp, v, Jtv)Evaluate $J(x)^Tv$, the linear transposed-Jacobian-vector product at x in place.
NLPModels.jtprod_lin! — Method
Jtv = jtprod_lin!(nlp, rows, cols, vals, v, Jtv)Evaluate $J(x)^Tv$, the linear transposed-Jacobian-vector product, where the Jacobian is given by (rows, cols, vals) in triplet format.
NLPModels.jtprod_lin — Method
Jtv = jtprod_lin(nlp, v)Evaluate $J(x)^Tv$, the linear transposed-Jacobian-vector product at x.
NLPModels.jtprod_nln! — Function
Jtv = jtprod_nln!(nlp, x, v, Jtv)Evaluate $J(x)^Tv$, the nonlinear transposed-Jacobian-vector product at x in place.
NLPModels.jtprod_nln! — Method
Jtv = jtprod_nln!(nlp, rows, cols, vals, v, Jtv)Evaluate $J(x)^Tv$, the nonlinear transposed-Jacobian-vector product, where the Jacobian is given by (rows, cols, vals) in triplet format.
NLPModels.jtprod_nln — Method
Jtv = jtprod_nln(nlp, x, v)Evaluate $J(x)^Tv$, the nonlinear transposed-Jacobian-vector product at x.
NLPModels.jtprod_residual! — Function
Jtv = jtprod_residual!(nls, x, v, Jtv)Computes the product of the transpose of the Jacobian of the residual at x and a vector, i.e., $J(x)^Tv$, storing it in Jtv.
NLPModels.jtprod_residual! — Method
Jtv = jtprod_residual!(nls, rows, cols, vals, v, Jtv)Computes the product of the transpose of the Jacobian of the residual given by (rows, cols, vals) and a vector, i.e., $J(x)^Tv$, storing it in Jv.
NLPModels.jtprod_residual — Method
Jtv = jtprod_residual(nls, x, v)Computes the product of the transpose of the Jacobian of the residual at x and a vector, i.e., $J(x)^Tv$.
NLPModels.lagscale — Function
lagscale(model::AbstractNLPModel)Return a vector of scaling factors for the Lagrange multipliers associated with constraints. This can be used to improve numerical stability or condition number when solving KKT systems.
NLPModels.linearly_constrained — Method
linearly_constrained(nlp)
linearly_constrained(meta)Returns whether the problem's constraints are known to be all linear.
NLPModels.lines_of_description — Method
lines_of_description(meta)Describe meta for the show function.
NLPModels.lines_of_description — Method
lines_of_description(nls_meta)Describe nls_meta for the show function.
NLPModels.lines_of_hist — Method
lines_of_hist(S, V)Return a vector of histline(s, v, maxv)s using pairs of s in S and v in V. maxv is given by the maximum of V.
NLPModels.neval_cons — Method
neval_cons(nlp)Get the number of cons evaluations.
NLPModels.neval_cons_lin — Method
neval_cons_lin(nlp)Get the number of cons evaluations.
NLPModels.neval_cons_nln — Method
neval_cons_nln(nlp)Get the number of cons evaluations.
NLPModels.neval_grad — Method
neval_grad(nlp)Get the number of grad evaluations.
NLPModels.neval_hess — Method
neval_hess(nlp)Get the number of hess evaluations.
NLPModels.neval_hess_residual — Method
neval_hess_residual(nlp)Get the number of hess evaluations.
NLPModels.neval_hprod — Method
neval_hprod(nlp)Get the number of hprod evaluations.
NLPModels.neval_hprod_residual — Method
neval_hprod_residual(nlp)Get the number of hprod evaluations.
NLPModels.neval_jac — Method
neval_jac(nlp)Get the number of jac evaluations.
NLPModels.neval_jac_lin — Method
neval_jac_lin(nlp)Get the number of jac evaluations.
NLPModels.neval_jac_nln — Method
neval_jac_nln(nlp)Get the number of jac evaluations.
NLPModels.neval_jac_residual — Method
neval_jac_residual(nlp)Get the number of jac evaluations.
NLPModels.neval_jcon — Method
neval_jcon(nlp)Get the number of jcon evaluations.
NLPModels.neval_jgrad — Method
neval_jgrad(nlp)Get the number of jgrad evaluations.
NLPModels.neval_jhess — Method
neval_jhess(nlp)Get the number of jhess evaluations.
NLPModels.neval_jhess_residual — Method
neval_jhess_residual(nlp)Get the number of jhess evaluations.
NLPModels.neval_jhprod — Method
neval_jhprod(nlp)Get the number of jhprod evaluations.
NLPModels.neval_jprod — Method
neval_jprod(nlp)Get the number of jprod evaluations.
NLPModels.neval_jprod_lin — Method
neval_jprod_lin(nlp)Get the number of jprod evaluations.
NLPModels.neval_jprod_nln — Method
neval_jprod_nln(nlp)Get the number of jprod evaluations.
NLPModels.neval_jprod_residual — Method
neval_jprod_residual(nlp)Get the number of jprod evaluations.
NLPModels.neval_jtprod — Method
neval_jtprod(nlp)Get the number of jtprod evaluations.
NLPModels.neval_jtprod_lin — Method
neval_jtprod_lin(nlp)Get the number of jtprod evaluations.
NLPModels.neval_jtprod_nln — Method
neval_jtprod_nln(nlp)Get the number of jtprod evaluations.
NLPModels.neval_jtprod_residual — Method
neval_jtprod_residual(nlp)Get the number of jtprod evaluations.
NLPModels.neval_obj — Method
neval_obj(nlp)Get the number of obj evaluations.
NLPModels.neval_residual — Method
neval_residual(nlp)Get the number of residual evaluations.
NLPModels.nls_meta — Method
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.
NLPModels.obj — Function
f = obj(nlp, x)Evaluate $f(x)$, the objective function of nlp at x.
NLPModels.obj — Method
f = obj(nls, x)
f = obj(nls, x, Fx; recompute::Bool=true)Evaluate f(x), the objective function of nls::AbstractNLSModel. Fx is overwritten with the value of the residual F(x). If recompute is true, then Fx is updated with the residual at x.
NLPModels.objcons! — Method
f, c = objcons!(nlp, x, c)Evaluate $f(x)$ and $c(x)$ at x. c is overwritten with the value of $c(x)$.
NLPModels.objcons! — Method
f, c = objcons!(nls, x, c)
f, c = objcons!(nls, x, c, Fx; recompute::Bool=true)In-place evaluation of constraints and objective for AbstractNLSModel. Fx is overwritten with the value of the residual F(x). If recompute is true, then Fx is updated with the residual at x.
NLPModels.objcons — Method
f, c = objcons(nlp, x)Evaluate $f(x)$ and $c(x)$ at x.
NLPModels.objgrad! — Method
f, g = objgrad!(nlp, x, g)Evaluate $f(x)$ and $∇f(x)$ at x. g is overwritten with the value of $∇f(x)$.
NLPModels.objgrad! — Method
f, g = objgrad!(nls, x, g)
f, g = objgrad!(nls, x, g, Fx; recompute::Bool=true)Evaluate f(x) and ∇f(x) of nls::AbstractNLSModel at x. Fx is overwritten with the value of the residual F(x). If recompute is true, then Fx is updated with the residual at x.
NLPModels.objgrad — Method
f, g = objgrad(nlp, x)Evaluate $f(x)$ and $∇f(x)$ at x.
NLPModels.reset_data! — Method
reset_data!(nlp)Reset model data if appropriate. This method should be overloaded if a subtype of AbstractNLPModel contains data that should be reset, such as a quasi-Newton linear operator.
NLPModels.residual! — Function
Fx = residual!(nls, x, Fx)Computes $F(x)$, the residual at x.
NLPModels.residual — Method
Fx = residual(nls, x)Computes $F(x)$, the residual at x.
NLPModels.show_counters — Method
show_counters(io, counters, fields)Show the fields of the struct counters.
NLPModels.show_header — Method
show_header(io, nlp)Show a header for the specific nlp type. Should be imported and defined for every model implementing the NLPModels API.
NLPModels.sparsityline — Method
sparsityline(s, v, maxv)Return a string of the form
______NAME______: ( 80.00% sparsity) 5where:
______NAME______isswith padding to the left and length 16.- The sparsity value is given by
v / maxv. - The number
5is v.
NLPModels.sum_counters — Method
sum_counters(nlp)Sum all counters of problem nlp except cons, jac, jprod and jtprod.
NLPModels.sum_counters — Method
sum_counters(counters)Sum all counters of counters except cons, jac, jprod and jtprod.
NLPModels.unconstrained — Method
unconstrained(nlp)
unconstrained(meta)Returns whether the problem in unconstrained.
NLPModels.varscale — Function
varscale(model::AbstractNLPModel)Return a vector containing the scaling factors for each variable in the model. This is typically used to normalize variables for numerical stability in solvers.
By default, the scaling is model-dependent. If not overridden by the model, a vector of ones is returned. Inspired by the AMPL scaling conventions.
NLPModels.@default_counters — Macro
@default_counters Model innerDefine functions relating counters of Model to counters of Model.inner.
NLPModels.@default_nlscounters — Macro
@default_nlscounters Model innerDefine functions relating NLS counters of Model to NLS counters of Model.inner.
NLPModels.@lencheck — Macro
@lencheck n x y z …Check that arrays x, y, z, etc. have a prescribed length n.
NLPModels.@rangecheck — Macro
@rangecheck ℓ u i j k …Check that values i, j, k, etc. are in the range [ℓ,u].