Skip to content

Commit dc3c080

Browse files
Format .jl files [skip ci] (#466)
Co-authored-by: jverzani <[email protected]>
1 parent 6b2d132 commit dc3c080

File tree

8 files changed

+14
-18
lines changed

8 files changed

+14
-18
lines changed

src/Derivative/lith.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,7 @@ function lmm(::LithBoonkkampIJzerman{3,0}, xs, fs)
715715
(
716716
f0^2 * f1 * x2 - f0^2 * f2 * x1 - f0 * f1^2 * x2 + f0 * f2^2 * x1 + f1^2 * f2 * x0 -
717717
f1 * f2^2 * x0
718-
) / (
719-
f0^2 * f1 - f0^2 * f2 - f0 * f1^2 + f0 * f2^2 + f1^2 * f2 - f1 * f2^2
720-
) |> float
718+
) / (f0^2 * f1 - f0^2 * f2 - f0 * f1^2 + f0 * f2^2 + f1^2 * f2 - f1 * f2^2) |> float
721719
end
722720

723721
function lmm(::LithBoonkkampIJzerman{4,0}, xs, fs)

src/convergence.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ function is_small_Δx(
235235
return δ Δₓ
236236
end
237237

238-
239238
isnan_x(M::AbstractBracketingMethod, state) = isnan(state.xn1) || isnan(state.xn0)
240239
isnan_x(M::AbstractNonBracketingMethod, state) = isnan(state.xn1)
241240

@@ -357,7 +356,7 @@ function decide_convergence(
357356

358357
# else
359358
return nan(T) * xn1
360-
# return xn1
359+
# return xn1
361360
end
362361
val == :inf_nan && return xn1
363362

src/find_zeros.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Base.show(io::IO, alpha::Interval) = print(io, "($(alpha.a), $(alpha.b))")
6969
# check if f(a) is non zero using tolerances max(atol, eps()), rtol
7070
function _non_zero(fa, a::T, atol, rtol) where {T}
7171
a, r = atol, abs(a) * rtol * oneunit(fa) / oneunit(a), oneunit(fa) * eps(T)
72-
return abs(fa) >= max(promote(a,r)...)
72+
return abs(fa) >= max(promote(a, r)...)
7373
end
7474

7575
# After splitting by zeros we have intervals (zm, zn) this is used to shrink

src/simple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function a42(f, ab; atol=nothing, rtol=nothing, λ=0.7, μ=0.5)
113113
assert_bracket(fa, fb)
114114

115115
tols = (
116-
λ = λ,
116+
λ = λ,
117117
atol = isnothing(atol) ? zero(one(a)) : atol,
118118
rtol = isnothing(rtol) ? eps(one(a)) : rtol,
119119
)

src/trace.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ end
143143
log_fncall(l::Tracks, i=1) = (l.fncalls += i; nothing)
144144
log_iteration(l::Tracks, n=1) = (l.steps += n; nothing)
145145
log_message(l::Tracks, msg) = (l.message *= msg; nothing)
146-
log_convergence(l::Tracks, msg) = (l.convergence_flag = msg; nothing)
147-
log_last(l::Tracks, α) = (l.alpha = α; nothing)
148-
log_method(l::Tracks, method) = (l.method = method; nothing)
149-
log_nmethod(l::Tracks, method) = (l.nmethod = method; nothing)
146+
log_convergence(l::Tracks, msg) = (l.convergence_flag=msg; nothing)
147+
log_last(l::Tracks, α) = (l.alpha=α; nothing)
148+
log_method(l::Tracks, method) = (l.method=method; nothing)
149+
log_nmethod(l::Tracks, method) = (l.nmethod=method; nothing)
150150

151151
# copy some API from ValueHistories
152152
Base.first(l::AbstractTracks) = (@warn "No tracking information was kept"; nothing)

test/test_allocations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ import BenchmarkTools
9494
p = 2.0
9595
for M in Ms
9696
@test BenchmarkTools.@ballocated(solve(ZeroProblem($f, $x0), $M, $p)) == 0
97-
@test BenchmarkTools.@ballocated(solve(ZeroProblem($f, $x0), $M; p=$p)) == 0
97+
@test BenchmarkTools.@ballocated(solve(ZeroProblem($f, $x0), $M; p=($p))) == 0
9898
end
9999

100100
# issue #423 type instability

test/test_find_zero.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ struct Order3_Test <: Roots.AbstractSecantMethod end
4141
@test isnan(solve(ZeroProblem(x -> x^2 + 2, 0.5f0)))
4242
end
4343

44-
4544
## defaults for method argument
4645
@test find_zero(sin, 3.0) pi # order0()
4746
@test @inferred(find_zero(sin, (3, 4))) π # Bisection()

test/test_newton.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ end
8989

9090
@testset "Lith Boonkkamp IJzerman methods" begin
9191
x₀, x̃₀, α = 1.0, 1.1, 1.1673039782614187
92-
f(x, p=1) = x^5 - x - p
93-
fp(x) = 5x^4 - 1
94-
fpp(x) = 20x^3
95-
fppp(x) = 60x
96-
fpppp(x) = 60
92+
f(x, p=1) = x^5 - x - p
93+
fp(x) = 5x^4 - 1
94+
fpp(x) = 20x^3
95+
fppp(x) = 60x
96+
fpppp(x) = 60
9797

9898
function fdf1(x, p=1)
9999
fx = f(x, p)

0 commit comments

Comments
 (0)