@@ -7,24 +7,15 @@ import SciMLBase:
77 wrapfun_oop, wrapfun_iip, isdualtype, value, DualEltypeChecker,
88 AbstractTimeseriesSolution, NonlinearProblem, NonlinearLeastSquaresProblem,
99 ODEProblem, SDEProblem, RODEProblem, DDEProblem, PDEProblem, DAEProblem,
10- RecursiveArrayTools, totallength
10+ RecursiveArrayTools, totallength, sse, anyeltypedual
11+
12+ import Static: reduce_tup
1113
1214
1315
1416eltypedual (x) = eltype (x) <: ForwardDiff.Dual
1517isdualtype (:: Type{<:ForwardDiff.Dual} ) = true
1618
17- # Copy of the other prob2dtmin dispatch, just for optionality
18- function prob2dtmin (tspan, :: ForwardDiff.Dual , use_end_time)
19- t1, t2 = tspan
20- isfinite (t1) || throw (ArgumentError (" t0 in the tspan `(t0, t1)` must be finite" ))
21- if use_end_time && isfinite (t2 - t1)
22- return max (eps (t2), eps (t1))
23- else
24- return max (eps (typeof (t1)), eps (t1))
25- end
26- end
27-
2819promote_dual (:: Type{T} , :: Type{T2} ) where {T <: ForwardDiff.Dual , T2} = T
2920function promote_dual (:: Type{T} ,
3021 :: Type{T2} ) where {T <: ForwardDiff.Dual , T2 <: ForwardDiff.Dual }
@@ -414,6 +405,7 @@ unitfulvalue(x::Type{ForwardDiff.Dual{T, V, N}}) where {T, V, N} = V
414405unitfulvalue (x:: ForwardDiff.Dual ) = unitfulvalue (ForwardDiff. value (x))
415406
416407sse (x:: ForwardDiff.Dual ) = sse (ForwardDiff. value (x)) + sum (sse, ForwardDiff. partials (x))
408+
417409function SciMLBase. totallength (x:: ForwardDiff.Dual )
418410 return SciMLBase. totallength (ForwardDiff. value (x)) +
419411 sum (SciMLBase. totallength, ForwardDiff. partials (x))
0 commit comments