Skip to content

Commit

Permalink
fixed gradient and GN Hessian approximation
Browse files Browse the repository at this point in the history
  • Loading branch information
FHoltorf committed Nov 18, 2023
1 parent 2ad0b37 commit 9387e5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/SimpleNonlinearSolve/src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ function SciMLBase.__solve(prob::NonlinearProblem,
end

fₖ = 0.5 * norm(F)^2
H = ∇f * ∇f
g = ∇f * F
H = ∇f' * ∇f
g = ∇f' * F
shrink_counter = 0

for k in 1:maxiters
Expand Down Expand Up @@ -188,8 +188,8 @@ function SciMLBase.__solve(prob::NonlinearProblem,
Δ = min(t₂ * Δ, Δₘₐₓ)
end
fₖ = fₖ₊₁
H = ∇f * ∇f
g = ∇f * F
H = ∇f' * ∇f
g = ∇f' * F
end
end
return SciMLBase.build_solution(prob, alg, x, F; retcode = ReturnCode.MaxIters)
Expand Down

0 comments on commit 9387e5f

Please sign in to comment.