Skip to content

Commit 34e2289

Browse files
default sample error depends on error_estimate
1 parent 62c6828 commit 34e2289

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/benchmark.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ type WorkPrecisionSet
134134
setups
135135
names
136136
sample_error
137+
error_estimate
137138
end
138139

139140
function WorkPrecision(prob,alg,abstols,reltols,dts=nothing;
@@ -199,6 +200,7 @@ end
199200

200201
function WorkPrecisionSet(prob::AbstractODEProblem,abstols,reltols,setups;numruns=20,
201202
print_names=false,names=nothing,appxsol=nothing,
203+
error_estimate=:final,
202204
test_dt=nothing,kwargs...)
203205
N = length(setups)
204206
wps = Vector{WorkPrecision}(N)
@@ -210,14 +212,16 @@ function WorkPrecisionSet(prob::AbstractODEProblem,abstols,reltols,setups;numrun
210212
if haskey(setups[i],:dts)
211213
wps[i] = WorkPrecision(prob,setups[i][:alg],abstols,reltols,setups[i][:dts];
212214
numruns=numruns,appxsol=appxsol,
215+
error_estimate=error_estimate,
213216
name=names[i],kwargs...,setups[i]...)
214217
else
215218
wps[i] = WorkPrecision(prob,setups[i][:alg],abstols,reltols;
216219
numruns=numruns,appxsol=appxsol,
220+
error_estimate=error_estimate,
217221
name=names[i],kwargs...,setups[i]...)
218222
end
219223
end
220-
return WorkPrecisionSet(wps,N,abstols,reltols,prob,setups,names,nothing)
224+
return WorkPrecisionSet(wps,N,abstols,reltols,prob,setups,names,nothing,error_estimate)
221225
end
222226

223227
@def error_calculation begin
@@ -349,7 +353,7 @@ function WorkPrecisionSet(prob::AbstractRODEProblem,abstols,reltols,setups,test_
349353
end
350354

351355
wps = [WorkPrecision(prob,abstols,reltols,errors[i],times[:,i],names[i],N) for i in 1:N]
352-
WorkPrecisionSet(wps,N,abstols,reltols,prob,setups,names,sample_error)
356+
WorkPrecisionSet(wps,N,abstols,reltols,prob,setups,names,sample_error,error_estimate)
353357
end
354358

355359
@def sample_errors begin

src/plotrecipes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ end
3434
end
3535

3636
@recipe function f(wp_set::WorkPrecisionSet;
37-
plot_sample_error = wp_set.sample_error != nothing)
37+
plot_sample_error = wp_set.error_estimate WEAK_ERRORS)
3838
seriestype --> :path
3939
linewidth --> 3
4040
yguide --> "Time (s)"

0 commit comments

Comments
 (0)