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

Equality checks with nothing #44

Merged
merged 1 commit into from
Jul 15, 2019
Merged
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
18 changes: 9 additions & 9 deletions src/benchmark.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function Shootout(prob,setups;appxsol=nothing,names=nothing,error_estimate=:fina
effratios = Matrix{Float64}(undef,N,N)
timeseries_errors = error_estimate ∈ TIMESERIES_ERRORS
dense_errors = error_estimate ∈ DENSE_ERRORS
if names == nothing
if names === nothing
names = [string(nameof(typeof(setup[:alg]))) for setup in setups]
end
for i in eachindex(setups)
Expand Down Expand Up @@ -97,10 +97,10 @@ function ShootoutSet(probs,setups;probaux=nothing,
N = length(probs)
shootouts = Vector{Shootout}(undef,N)
winners = Vector{String}(undef,N)
if names == nothing
if names === nothing
names = [string(nameof(typeof(setup[:alg]))) for setup in setups]
end
if probaux == nothing
if probaux === nothing
probaux = Vector{Dict{Symbol,Any}}(undef,N)
for i in 1:N
probaux[i] = Dict{Symbol,Any}()
Expand Down Expand Up @@ -163,7 +163,7 @@ function WorkPrecision(prob,alg,abstols,reltols,dts=nothing;
N = length(abstols)
errors = Vector{Float64}(undef,N)
times = Vector{Float64}(undef,N)
if name == nothing
if name === nothing
name = "WP-Alg"
end

Expand All @@ -177,7 +177,7 @@ function WorkPrecision(prob,alg,abstols,reltols,dts=nothing;
timeseries_errors = error_estimate ∈ TIMESERIES_ERRORS
dense_errors = error_estimate ∈ DENSE_ERRORS
for i in 1:N
if dts == nothing
if dts === nothing
sol = solve(_prob,alg;kwargs...,abstol=abstols[i],
reltol=reltols[i],timeseries_errors=timeseries_errors,
dense_errors = dense_errors)
Expand All @@ -193,15 +193,15 @@ function WorkPrecision(prob,alg,abstols,reltols,dts=nothing;
cur_appxsol = appxsol
end

if cur_appxsol != nothing
if cur_appxsol !== nothing
errsol = appxtrue(sol,cur_appxsol)
errors[i] = mean(errsol.errors[error_estimate])
else
errors[i] = mean(sol.errors[error_estimate])
end

benchmark_f = let dts=dts,_prob=_prob,alg=alg,sol=sol,abstols=abstols,reltols=reltols,kwargs=kwargs
if dts == nothing
if dts === nothing
() -> @elapsed solve(_prob, alg, sol.u, sol.t, sol.k;
abstol = abstols[i],
reltol = reltols[i],
Expand Down Expand Up @@ -236,7 +236,7 @@ function WorkPrecisionSet(prob,
test_dt=nothing,kwargs...)
N = length(setups)
wps = Vector{WorkPrecision}(undef,N)
if names == nothing
if names === nothing
names = [string(nameof(typeof(setup[:alg]))) for setup in setups]
end
for i in 1:N
Expand Down Expand Up @@ -317,7 +317,7 @@ function WorkPrecisionSet(prob::AbstractRODEProblem,abstols,reltols,setups,test_
N = length(setups); M = length(abstols)
times = Array{Float64}(undef,M,N)
tmp_solutions = Array{Any}(undef,numruns_error,M,N)
if names == nothing
if names === nothing
names = [string(nameof(typeof(setup[:alg]))) for setup in setups]
end
time_tmp = Vector{Float64}(undef,numruns)
Expand Down