Skip to content

Nonzero elements in the Hessian that should be zero #1811

@abelsiqueira

Description

@abelsiqueira

The code

using JuMP, MathProgBase
model = Model()
@variable(model, x[1:2])
@NLobjective(model, Min, 0.0)
@NLconstraint(model, x[1] * x[2] == 2)
d = JuMP.NLPEvaluator(model)
MathProgBase.initialize(d, [:Hess])
hx = zeros(3)
MathProgBase.eval_hesslag(d, hx, [0.659; 0.702], 1.0, [1.0])

corresponds to problem

min 0   s.t.  x_1 * x_2 == 2

which has Hessian of Lagrangian

\nabla^2 L(x,y) = [0 y_1; y_1 0]

i.e., only one nonzero is stored. However, a small error appears on the diagonal. Varies with the inputs.

Related to JuliaSmoothOptimizers/NLPModelsJuMP.jl/issues/13.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions