Skip to content

Commit b5faf40

Browse files
hotfix total_length
1 parent ef11edb commit b5faf40

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DiffEqBase"
22
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
33
authors = ["Chris Rackauckas <[email protected]>"]
4-
version = "6.162.0"
4+
version = "6.162.1"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

ext/DiffEqBaseForwardDiffExt.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,9 @@ unitfulvalue(x::Type{ForwardDiff.Dual{T, V, N}}) where {T, V, N} = V
501501
unitfulvalue(x::ForwardDiff.Dual) = unitfulvalue(ForwardDiff.unitfulvalue(x))
502502

503503
sse(x::ForwardDiff.Dual) = sse(ForwardDiff.value(x)) + sum(sse, ForwardDiff.partials(x))
504-
totallength(x::Number) = 1
505504
function totallength(x::ForwardDiff.Dual)
506505
totallength(ForwardDiff.value(x)) + sum(totallength, ForwardDiff.partials(x))
507506
end
508-
totallength(x::AbstractArray) = __sum(totallength, x; init = 0)
509507

510508
@inline ODE_DEFAULT_NORM(u::ForwardDiff.Dual, ::Any) = sqrt(sse(u))
511509
@inline function ODE_DEFAULT_NORM(u::AbstractArray{<:ForwardDiff.Dual{Tag, T}},

src/utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ unitfulvalue(x) = x
44
isdistribution(u0) = false
55
sse(x::Number) = abs2(x)
66

7+
totallength(x::Number) = 1
8+
totallength(x::AbstractArray) = __sum(totallength, x; init = 0)
9+
710
_vec(v) = vec(v)
811
_vec(v::Number) = v
912
_vec(v::AbstractSciMLScalarOperator) = v

0 commit comments

Comments
 (0)