I have defined a bound constrained NLP using ManualNLPModels (with hand coded analytic gradients but no hessian information) + the LBFGSModel
function from NLPModelsModifiers. Is there a way to use such an nlp with this Ipopt interface? When I tried passing my (modified) nlp to ipopt()
I got an error like the following:
ERROR: MethodError: no method matching hess_structure!(::NLPModelsModifiers.LBFGSModel{Float64, Vector{Float64}, ManualNLPModels.NLPModel{Float64, Vector{Float64}}, NLPModels.NLPModelMeta{Float64, Vector{Float64}}, LinearOperators.LBFGSOperator{Float64, Int64, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}}}, ::Vector{Int32}, ::Vector{Int32})
Closest candidates are:
hess_structure!(::ManualNLPModels.NLPModel, ::AbstractVector{<:Integer}, ::AbstractVector{<:Integer}) at ~/.julia/packages/ManualNLPModels/PbScU/src/api.jl:50
hess_structure!(::Union{NLPModelsModifiers.SlackModel, NLPModelsModifiers.SlackNLSModel}, ::AbstractVector{<:Integer}, ::AbstractVector{<:Integer}) at ~/.julia/packages/NLPModelsModifiers/QR0za/src/slack-model.jl:535
hess_structure!(::NLPModelsModifiers.FeasibilityResidual, ::AbstractVector, ::AbstractVector) at ~/.julia/packages/NLPModelsModifiers/QR0za/src/feasibility-residual.jl:217
...
Stacktrace:
[1] (::NLPModelsIpopt.var"#eval_h#5"{NLPModelsModifiers.LBFGSModel{Float64, Vector{Float64}, ManualNLPModels.NLPModel{Float64, Vector{Float64}}, NLPModels.NLPModelMeta{Float64, Vector{Float64}}, LinearOperators.LBFGSOperator{Float64, Int64, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}}}})(x::Vector{Float64}, rows::Vector{Int32}, cols::Vector{Int32}, σ::Float64, λ::Vector{Float64}, values::Nothing)
@ NLPModelsIpopt ~/.julia/packages/NLPModelsIpopt/WBABa/src/NLPModelsIpopt.jl:106
[2] _Eval_H_CB(n::Int32, x_ptr::Ptr{Float64}, #unused#::Int32, obj_factor::Float64, m::Int32, lambda_ptr::Ptr{Float64}, #unused#::Int32, nele_hess::Int32, iRow::Ptr{Int32}, jCol::Ptr{Int32}, values_ptr::Ptr{Float64}, user_data::Ptr{Nothing})
@ Ipopt ~/.julia/packages/Ipopt/Re4kE/src/C_wrapper.jl:124
[3] IpoptSolve(prob::Ipopt.IpoptProblem)
@ Ipopt ~/.julia/packages/Ipopt/Re4kE/src/C_wrapper.jl:442
[4] solve!(solver::NLPModelsIpopt.IpoptSolver, nlp::NLPModelsModifiers.LBFGSModel{Float64, Vector{Float64}, ManualNLPModels.NLPModel{Float64, Vector{Float64}}, NLPModels.NLPModelMeta{Float64, Vector{Float64}}, LinearOperators.LBFGSOperator{Float64, Int64, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}, LinearOperators.var"#67#69"{LinearOperators.var"#lbfgs_multiply#68", LinearOperators.LBFGSData{Float64, Int64}}}}, stats::SolverCore.GenericExecutionStats{Float64, Vector{Float64}, Vector{Float64}, Any}; callback::Function, kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:print_level,), Tuple{Int64}}})
@ NLPModelsIpopt ~/.julia/packages/NLPModelsIpopt/WBABa/src/NLPModelsIpopt.jl:240
[5] #ipopt#6
@ ~/.julia/packages/NLPModelsIpopt/WBABa/src/NLPModelsIpopt.jl:158 [inlined]
[6] optimize_laplace(Y::Vector{Float64}, X::Matrix{Float64}, Z::Matrix{Float64}, D::Vector{Float64}, Sigma0::SparseArrays.SparseMatrixCSC{Float64, Int64}, theta0::Vector{Float64}, lower::Vector{Float64}, upper::Vector{Float64})
@ HeckmanKriging2 ~/github/wellconfidentiality/code/modules/HeckmanKriging2.jl:303
[7] top-level scope
@ REPL[2]:1