Skip to content

Commit e058e00

Browse files
Merge pull request #133 from SciML/ap/infnorm
Add norm(_, Inf) to WorkPrecision
2 parents 7c02d75 + 1e7b49f commit e058e00

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DiffEqDevTools"
22
uuid = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "2.43.0"
4+
version = "2.44.0"
55

66
[deps]
77
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"

src/benchmark.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,11 @@ function WorkPrecision(prob::NonlinearProblem, alg, abstols, reltols, dts = noth
415415

416416
stats[i] = sol.stats
417417

418+
err = appxsol === nothing ? sol.resid : (sol .- appxsol)
418419
if error_estimate == :l2
419-
if isnothing(appxsol)
420-
errors[i] = Dict(error_estimate => sqrt(sum(abs2, sol.resid)))
421-
else
422-
errors[i] = Dict(error_estimate => sqrt(sum(abs2, sol .- appxsol)))
423-
end
420+
errors[i] = Dict(error_estimate => norm(err, 2))
421+
elseif error_estimate == :l∞ || error_estimate == :linf
422+
errors[i] = Dict(error_estimate => norm(err, Inf))
424423
else
425424
error("Unsupported norm used: $(error_estimate).")
426425
end

0 commit comments

Comments
 (0)