Reference

Contents

Index

Penelopt.CompactBFGSModel — Type
CompactBFGSModel(nlp; mem = 6, scaling = true, max_skip = 2)

Wrap nlp so that its Hessian of the Lagrangian is replaced by a limited-memory BFGS approximation stored in compact form. The approximation is updated by the solver during the iterations. All other evaluations are forwarded to nlp.

This is what L2Penalty uses with qn_hessian_approximation = :bfgs. Construct it yourself only when using a preallocated L2PenaltySolver, see Preallocation.

Keyword arguments

  • mem::Int = 6: number of pairs $(s, y)$ stored.
  • scaling::Bool = true: whether the initial approximation is $B_0 = \gamma I$ with $\gamma = y^T y / s^T y$.
  • max_skip::Int = 2: an update is skipped unless dot(s, y) > eps(T) * ‖y‖ * max(‖s‖, ‖y‖); the approximation is reset once more than max_skip consecutive updates have been skipped.

These correspond to the qn_mem, qn_scaling and qn_max_skip options, see Options Reference.

source
Penelopt.L2PenaltySolver — Method
solver = L2PenaltySolver(nlp; r2n_m_monotone = 12, linear_solver = :mumps)

Preallocate all the memory needed to solve nlp with the exact ℓ₂-penalty method. The solver can then be passed to solve! any number of times without further allocation, as long as the problem dimensions do not change. See Preallocation.

Unlike L2Penalty, no preprocessing is applied: if nlp has fixed variables or shifted constraints, see Fixed Variables and Shifted Constraints.

Keyword arguments

These options determine the size of the workspace and can only be passed here, not to solve!:

  • r2n_m_monotone::Int = 12: non-monotone memory of the inner (R2N) solver;
  • linear_solver::Symbol = :mumps: linear solver used for step computations.

See Options Reference for details.

source
Penelopt.NullHessianModel — Type
NullHessianModel(nlp)

Wrap nlp so that its Hessian of the Lagrangian is replaced by the zero matrix. All other evaluations (objective, constraints, gradients, Jacobians) are forwarded to nlp.

This is what L2Penalty uses with qn_hessian_approximation = :null. Construct it yourself only when using a preallocated L2PenaltySolver, see Preallocation.

source
Penelopt.L2Penalty — Method
stats = L2Penalty(nlp; kwargs...)

Solve the equality-constrained problem

min f(x)  s.t.  c(x) = 0

described by the AbstractNLPModel nlp (see NLPModels.jl) with an exact ℓ₂-penalty method. At each outer iteration, the nonsmooth subproblem

min f(x) + τₖ‖c(x)‖₂

is solved approximately by a regularized Newton method (R2N), and the penalty parameter τₖ is updated. Variables may not have bounds, except fixed variables (lvar[i] == uvar[i]).

Fixed variables and constraint right-hand sides are handled internally; the returned solution is expressed in terms of the original nlp.

Example

using ADNLPModels, Penelopt
nlp = ADNLPModel(x -> (x[1] - 1)^2 + x[2]^2, [2.0, 2.0], x -> [x[1] + x[2] - 1], [0.0], [0.0])
stats = L2Penalty(nlp; print_level = 1)

Keyword arguments

See Options Reference for the full list of options, Callbacks for the callback keyword, and Outputs for a description of stats. To reuse memory across several solves, see L2PenaltySolver and solve!.

source
SolverCore.solve! — Method
solve!(solver::L2PenaltySolver, nlp, stats; kwargs...)

Solve nlp with the preallocated solver, writing the results in stats (see PeneloptExecutionStats). solver must have been built from a problem with the same dimensions as nlp.

All keyword arguments of L2Penalty are accepted, except r2n_m_monotone, linear_solver and the qn_* options, which must be set when constructing the solver or the model. See Options Reference.

Call SolverCore.reset!(solver) between two solves to discard the state kept from the previous one.

source