Skip to content

Failure with Newton linesearch #1234

@KnutAM

Description

@KnutAM

The example in Ferrite.jl's docs here used to work, but after bumping the version it fails with (the released docs work because we haven't updated the version yet). Before digging deeper I just wanted to check if this has an easy fix or if a more deep-dive is required (disclaimer, I didn't write the example code, but would like to keep it working :))

ERROR: LoadError: MethodError: no method matching reset_search_direction!(::Optim.NewtonState{…}, ::Optim.Newton{…})
The function `reset_search_direction!` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  reset_search_direction!(::Any, ::Any, ::Any)
   @ Optim ~/.julia/packages/Optim/DtV5C/src/utilities/perform_linesearch.jl:3
  reset_search_direction!(::Optim.BFGSState, ::Optim.BFGS)
   @ Optim ~/.julia/packages/Optim/DtV5C/src/utilities/perform_linesearch.jl:8
  reset_search_direction!(::Optim.LBFGSState, ::Optim.LBFGS)
   @ Optim ~/.julia/packages/Optim/DtV5C/src/utilities/perform_linesearch.jl:27
  ...

Stacktrace:
 [1] perform_linesearch!(state::Optim.NewtonState{…}, method::Optim.Newton{…}, d::NLSolversBase.TwiceDifferentiable{…})
   @ Optim ~/.julia/packages/Optim/DtV5C/src/utilities/perform_linesearch.jl:42
 [2] update_state!(d::NLSolversBase.TwiceDifferentiable{…}, state::Optim.NewtonState{…}, method::Optim.Newton{…})
   @ Optim ~/.julia/packages/Optim/DtV5C/src/multivariate/solvers/second_order/newton.jl:83
 [3] optimize(d::NLSolversBase.TwiceDifferentiable{…}, initial_x::Vector{…}, method::Optim.Newton{…}, options::Optim.Options{…}, state::Optim.NewtonState{…})
   @ Optim ~/.julia/packages/Optim/DtV5C/src/multivariate/optimize/optimize.jl:79
...

Was there some breaking change leading to this, or is this a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions