This is a bug in Alpine and MadNLP. When initializing their problem, they should check features_available
to see what callbacks they can access. In this case, :Hess
is not in features_available
, so attempting to initialize it will return an unsupported feature.
using JuMP
model = Model()
my_square(x) = x^2
my_square_prime(x) = 2x
my_square_prime_prime(x) = 2
my_f(x, y) = (x - 1)^2 + (y - 2)^2
function ∇f(g, x, y)
g[1] = 2 * (x - 1)
g[2] = 2 * (y - 2)
end
JuMP.register(model, :my_f, 2, my_f, ∇f)
JuMP.register(model, :my_square, 1, my_square, my_square_prime,
my_square_prime_prime)
@variable(model, x[1:2] >= 0.5)
@NLobjective(model, Min, my_f(x[1], my_square(x[2])))
julia> e = NLPEvaluator(model)
"A JuMP.NLPEvaluator"
julia> MOI.features_available(e)
4-element Vector{Symbol}:
:Grad
:Jac
:JacVec
:ExprGraph