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

Commit 2b775f2

Browse files
committed
fixed gradient and GN Hessian approximation
1 parent a65354a commit 2b775f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/trustRegion.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ function SciMLBase.__solve(prob::NonlinearProblem,
134134
end
135135

136136
fₖ = 0.5 * norm(F)^2
137-
H = ∇f * ∇f
138-
g = ∇f * F
137+
H = ∇f' * ∇f
138+
g = ∇f' * F
139139
shrink_counter = 0
140140

141141
for k in 1:maxiters
@@ -188,8 +188,8 @@ function SciMLBase.__solve(prob::NonlinearProblem,
188188
Δ = min(t₂ * Δ, Δₘₐₓ)
189189
end
190190
fₖ = fₖ₊₁
191-
H = ∇f * ∇f
192-
g = ∇f * F
191+
H = ∇f' * ∇f
192+
g = ∇f' * F
193193
end
194194
end
195195
return SciMLBase.build_solution(prob, alg, x, F; retcode = ReturnCode.MaxIters)

0 commit comments

Comments
 (0)