Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
FastClosures = "0.3.0"
LinearAlgebra = "1.10"
LinearOperators = "^2.7"
NLPModels = "0.21.6"
NLPModels = "0.21"
Printf = "1.10"
SparseArrays = "1.10"
julia = "1.10"
Expand Down
6 changes: 3 additions & 3 deletions src/quasi-newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function get_op(nlp::QuasiNewtonModel)
error("get_op is not implemented for $(typeof(nlp)).")
end

# Redefine neval_hprod for all QuasiNewtonModels.
NLPModels.neval_hprod(nlp::QuasiNewtonModel) = get_op(nlp).nprod

mutable struct LBFGSModel{
T,
S,
Expand All @@ -45,7 +48,6 @@ end
get_model(nlp::LBFGSModel) = nlp.model
get_op(nlp::LBFGSModel) = nlp.op
@default_counters LBFGSModel model (neval_hprod,)
NLPModels.neval_hprod(nlp::LBFGSModel) = get_op(nlp).nprod

mutable struct LSR1Model{
T,
Expand All @@ -63,7 +65,6 @@ end
get_model(nlp::LSR1Model) = nlp.model
get_op(nlp::LSR1Model) = nlp.op
@default_counters LSR1Model model (neval_hprod,)
NLPModels.neval_hprod(nlp::LSR1Model) = get_op(nlp).nprod

mutable struct DiagonalQNModel{
T,
Expand All @@ -80,7 +81,6 @@ end
get_model(nlp::DiagonalQNModel) = nlp.model
get_op(nlp::DiagonalQNModel) = nlp.op
@default_counters DiagonalQNModel model (neval_hprod,)
NLPModels.neval_hprod(nlp::DiagonalQNModel) = get_op(nlp).nprod

"Construct a `LBFGSModel` from another type of model."
function LBFGSModel(nlp::AbstractNLPModel{T, S}; kwargs...) where {T, S}
Expand Down
Loading