Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic JuliaFormatter.jl run #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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