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

Commit b348809

Browse files
committed
formating
1 parent b435ae5 commit b348809

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/klement.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ function SciMLBase.solve(prob::NonlinearProblem,
3434
if isa(x, Number)
3535
J = 1.0
3636
for _ in 1:maxiters
37-
38-
xₙ = xₙ₋₁ - fₙ₋₁/J
37+
xₙ = xₙ₋₁ - fₙ₋₁ / J
3938
fₙ = f(xₙ)
4039

4140
iszero(fₙ) &&
@@ -51,7 +50,7 @@ function SciMLBase.solve(prob::NonlinearProblem,
5150
Δfₙ = fₙ - fₙ₋₁
5251

5352
# Prevent division by 0
54-
denominator = max(J ^ 2 * Δxₙ ^ 2, 1e-9)
53+
denominator = max(J^2 * Δxₙ^2, 1e-9)
5554

5655
k = (Δfₙ - J * Δxₙ) / denominator
5756
J += (k * Δxₙ * J) * J
@@ -64,7 +63,7 @@ function SciMLBase.solve(prob::NonlinearProblem,
6463
xₙ₋₁ = xₙ
6564
fₙ₋₁ = fₙ
6665
end
67-
# x is a vector
66+
# x is a vector
6867
else
6968
J = init_J(x)
7069
F = lu(J, check = false)

0 commit comments

Comments
 (0)