Skip to content

Commit a257dca

Browse files
some more
1 parent bad6457 commit a257dca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/DiffEqBaseForwardDiffExt.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ using DiffEqBase: Void, FunctionWrappersWrappers, OrdinaryDiffEqTag, AbstractTim
66
RecursiveArrayTools, reduce_tup, _promote_tspan, has_continuous_callback
77
import DiffEqBase: hasdualpromote, wrapfun_oop, wrapfun_iip, prob2dtmin,
88
promote_tspan, anyeltypedual, isdualtype, value, ODE_DEFAULT_NORM,
9-
InternalITP, nextfloat_tdir, DualEltypeChecker
9+
InternalITP, nextfloat_tdir, DualEltypeChecker, sse
1010

1111
eltypedual(x) = eltype(x) <: ForwardDiff.Dual
1212
isdualtype(::Type{<:ForwardDiff.Dual}) = true
@@ -500,7 +500,6 @@ value(x::ForwardDiff.Dual) = value(ForwardDiff.value(x))
500500
unitfulvalue(x::Type{ForwardDiff.Dual{T, V, N}}) where {T, V, N} = V
501501
unitfulvalue(x::ForwardDiff.Dual) = unitfulvalue(ForwardDiff.unitfulvalue(x))
502502

503-
sse(x::Number) = abs2(x)
504503
sse(x::ForwardDiff.Dual) = sse(ForwardDiff.value(x)) + sum(sse, ForwardDiff.partials(x))
505504
totallength(x::Number) = 1
506505
function totallength(x::ForwardDiff.Dual)

src/utils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
value(x) = x
33
unitfulvalue(x) = x
44
isdistribution(u0) = false
5+
sse(x::Number) = abs2(x)
56

67
_vec(v) = vec(v)
78
_vec(v::Number) = v

0 commit comments

Comments
 (0)