Skip to content

Commit

Permalink
compute Newton step as opposed to Gauss-Newton step when J is square …
Browse files Browse the repository at this point in the history
…and full rank
  • Loading branch information
FHoltorf committed Nov 22, 2023
1 parent 000f4db commit 0cc84ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/SimpleNonlinearSolve/src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/SimpleNonlinearSolve/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0cc84ab

Please sign in to comment.