Skip to content

Commit b68d1ce

Browse files
weak errors in wp work
1 parent 8de789c commit b68d1ce

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/DiffEqDevTools.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import Base: length
99

1010
const TIMESERIES_ERRORS = Set([:l2,:l∞,:L2,:L∞])
1111
const DENSE_ERRORS = Set([:L2,:L∞])
12-
const WEAK_TIMESERIES_ERRORS = Set([:weak_final])
13-
const WEAK_DENSE_ERRORS = Set([:weak_L2])
12+
const WEAK_TIMESERIES_ERRORS = Set([:weak_l2,:weak_l∞])
13+
const WEAK_DENSE_ERRORS = Set([:weak_L2,:weak_L∞])
14+
const WEAK_ERRORS = union(Set([:weak_final]),WEAK_TIMESERIES_ERRORS,WEAK_DENSE_ERRORS)
15+
1416

1517
parameterless_type(T::Type) = Base.typename(T).wrapper
1618
parameterless_type(x) = parameterless_type(typeof(x))

src/benchmark.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,11 @@ function WorkPrecisionSet(prob,abstols,reltols,setups,test_dt=nothing;
287287
tmp_solutions
288288
_solutions_k = [[MonteCarloSolution(tmp_solutions[:,j,k],0.0,true) for j in 1:M] for k in 1:N]
289289
solutions = [[calculate_monte_errors(sim;weak_timeseries_errors=weak_timeseries_errors,weak_dense_errors=weak_dense_errors) for sim in sol_k] for sol_k in _solutions_k]
290-
errors = [[solutions[j][i].error_means[error_estimate] for i in 1:M] for j in 1:N]
290+
if error_estimate WEAK_ERRORS
291+
errors = [[solutions[j][i].weak_errors[error_estimate] for i in 1:M] for j in 1:N]
292+
else
293+
errors = [[solutions[j][i].error_means[error_estimate] for i in 1:M] for j in 1:N]
294+
end
291295

292296
# Now time it
293297
for k in 1:N

test/analyticless_stochastic_wp.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ test_dt = 2/10^5
2222
appxsol_setup = Dict(:alg=>SRIW1(),:abstol=>1e-7,:reltol=>1e-7)
2323
wp = WorkPrecisionSet(prob,abstols,reltols,setups,test_dt;
2424
appxsol_setup = appxsol_setup,
25-
numruns=5,names=names,error_estimate=:l2)
25+
numruns=5,names=names,error_estimate=:weak_final)

0 commit comments

Comments
 (0)