Skip to content
This repository was archived by the owner on May 15, 2025. It is now read-only.

Commit 41de368

Browse files
committed
compute Newton step as opposed to Gauss-Newton step when J is square and full rank
1 parent f4e393e commit 41de368

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/trustRegion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function SciMLBase.__solve(prob::NonlinearProblem,
140140

141141
for k in 1:maxiters
142142
# Solve the trust region subproblem.
143-
δ = dogleg_method(H, g, Δ)
143+
δ = dogleg_method(∇f, F, g, Δ)
144144
xₖ₊₁ = x + δ
145145
Fₖ₊₁ = f(xₖ₊₁)
146146
fₖ₊₁ = 0.5 * norm(Fₖ₊₁)^2

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ function init_J(x)
5858
return J
5959
end
6060

61-
function dogleg_method(H, g, Δ)
61+
function dogleg_method(J, f, g, Δ)
6262
# Compute the Newton step.
63-
δN = -H \ g
63+
δN = J \ (-f)
6464
# Test if the full step is within the trust region.
6565
if norm(δN) Δ
6666
return δN

0 commit comments

Comments
 (0)