diff --git a/lib/SimpleNonlinearSolve/src/trustRegion.jl b/lib/SimpleNonlinearSolve/src/trustRegion.jl index 72d8efa88..011ececd8 100644 --- a/lib/SimpleNonlinearSolve/src/trustRegion.jl +++ b/lib/SimpleNonlinearSolve/src/trustRegion.jl @@ -140,7 +140,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, for k in 1:maxiters # Solve the trust region subproblem. - δ = dogleg_method(H, g, Δ) + δ = dogleg_method(∇f, F, g, Δ) xₖ₊₁ = x + δ Fₖ₊₁ = f(xₖ₊₁) fₖ₊₁ = 0.5 * norm(Fₖ₊₁)^2 diff --git a/lib/SimpleNonlinearSolve/src/utils.jl b/lib/SimpleNonlinearSolve/src/utils.jl index 45df96410..af66f63f8 100644 --- a/lib/SimpleNonlinearSolve/src/utils.jl +++ b/lib/SimpleNonlinearSolve/src/utils.jl @@ -58,9 +58,9 @@ function init_J(x) return J end -function dogleg_method(H, g, Δ) +function dogleg_method(J, f, g, Δ) # Compute the Newton step. - δN = -H \ g + δN = J \ (-f) # Test if the full step is within the trust region. if norm(δN) ≤ Δ return δN