Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tangi Migot <[email protected]>
  • Loading branch information
MaxenceGollier and tmigot authored Jul 26, 2024
1 parent 3bff157 commit 9a220e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/quasi-newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,6 @@ function Base.show(io::IO, nlp::QuasiNewtonModel)
show(io, nlp.model.counters)
end

function Base.getproperty(nlp::QuasiNewtonModel, s::Symbol)
if s == :counters
return nlp.model.counters
else
return getfield(nlp, s)
end
end

@default_counters QuasiNewtonModel model

function NLPModels.reset_data!(nlp::QuasiNewtonModel)
Expand Down
4 changes: 4 additions & 0 deletions test/nlp/quasi-newton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
Hop = hess_op!(nlp, x, Hv)
@test Hop * v H(x) * v
@test nlp.counters == nlp.model.counters
@test neval_obj(nlp) == neval_obj(nlp.model)
@test neval_grad(nlp) == neval_grad(nlp.model)
@test neval_hess(nlp) == neval_hess(nlp.model)
@test neval_hprod(nlp) == neval_hprod(nlp.model)

reset_data!(nlp)
Hop = hess_op!(nlp, x, Hv)
Expand Down

0 comments on commit 9a220e6

Please sign in to comment.