Skip to content

Commit

Permalink
Format .jl files [skip ci] (#440)
Browse files Browse the repository at this point in the history
Co-authored-by: jverzani <[email protected]>
  • Loading branch information
github-actions[bot] and jverzani authored Dec 1, 2024
1 parent a70e206 commit 18354b0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/Bracketing/alefeld_potra_shi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function init_options(
Roots.FExactOptions(δₐ, δᵣ, maxiters, strict)
end


# fn calls w/in calculateΔ
# 1 is default, but this should be adjusted for different methods
fncalls_per_step(::AbstractAlefeldPotraShi) = 1
Expand Down
2 changes: 0 additions & 2 deletions src/Bracketing/itp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ function init_options(
state::AbstractUnivariateZeroState{T,S};
kwargs...,
) where {T,S}

d = kwargs
defs = default_tolerances(M, T, S)
δₐ = get(d, :xatol, get(d, :xabstol, defs[1]))
Expand All @@ -85,7 +84,6 @@ function init_options(
return UnivariateZeroOptions(δₐ, δᵣ, ϵₐ, ϵᵣ, maxiters, strict)
end


function update_state(M::ITP, F, o::ITPState{T,S,R}, options, l=NullTracks()) where {T,S,R}
a, b = o.xn0, o.xn1
fa, fb = o.fxn0, o.fxn1
Expand Down
8 changes: 5 additions & 3 deletions src/convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ function init_options(M, T=Float64, S=Float64; kwargs...)
maxiters = get(d, :maxiters, get(d, :maxevals, get(d, :maxsteps, defs[5])))
strict = get(d, :strict, defs[6])

iszero(δₐ) && iszero(δᵣ) && iszero(ϵₐ) && iszero(ϵᵣ) && return ExactOptions(maxiters, strict)
iszero(δₐ) &&
iszero(δᵣ) &&
iszero(ϵₐ) &&
iszero(ϵᵣ) &&
return ExactOptions(maxiters, strict)
iszero(δₐ) && iszero(δᵣ) && return XExactOptions(ϵₐ, ϵᵣ, maxiters, strict)
iszero(ϵₐ) && iszero(ϵᵣ) && return FExactOptions(δₐ, δᵣ, maxiters, strict)

Expand All @@ -61,7 +65,6 @@ function init_options(
state::AbstractUnivariateZeroState{T,S};
kwargs...,
) where {T,S}

d = kwargs
defs = default_tolerances(M, T, S)
δₐ = get(d, :xatol, get(d, :xabstol, defs[1]))
Expand All @@ -74,7 +77,6 @@ function init_options(
return UnivariateZeroOptions(δₐ, δᵣ, ϵₐ, ϵᵣ, maxiters, strict)
end


## --------------------------------------------------

"""
Expand Down
4 changes: 2 additions & 2 deletions test/test_composable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using ForwardDiff
@testset "find zero(s) with Unitful" begin
s = u"s"
m = u"m"
g = (9 + 8//10) * m / s^2
g = (9 + 8 // 10) * m / s^2
v0 = 10m / s
y0 = 16m
y(t) = -g * t^2 + v0 * t + y0
Expand All @@ -47,7 +47,7 @@ using ForwardDiff
xzs1 = find_zeros(x -> cos(x / 1u"m"), -1.6u"m", 2u"m")
@test length(xzs1) == 2 && maximum(xzs1) 1.5707963267948966 * u"m"

FX = ZeroProblem(y, (0f0s, 2f0s))
FX = ZeroProblem(y, (0.0f0s, 2.0f0s))
prob = Roots.init(FX, Roots.AlefeldPotraShi())
@test Roots.is_small_Δx(prob.M, prob.state, prob.options) isa Bool # does not throw
end
Expand Down

0 comments on commit 18354b0

Please sign in to comment.