@@ -4,6 +4,9 @@ abstract type OrdinaryDiffEqMutableCache <: OrdinaryDiffEqCache end
44struct ODEEmptyCache <: OrdinaryDiffEqConstantCache end
55struct ODEChunkCache{CS} <: OrdinaryDiffEqConstantCache end
66
7+ ismutablecache (cache:: OrdinaryDiffEqMutableCache ) = true
8+ ismutablecache (cache:: OrdinaryDiffEqConstantCache ) = false
9+
710# Don't worry about the potential alloc on a constant cache
811get_fsalfirstlast (cache:: OrdinaryDiffEqConstantCache , u) = (zero (u), zero (u))
912
@@ -13,6 +16,10 @@ mutable struct CompositeCache{T, F} <: OrdinaryDiffEqCache
1316 current:: Int
1417end
1518
19+ function ismutablecache (cache:: CompositeCache{T, F} ) where {T, F}
20+ eltype (T) <: OrdinaryDiffEqMutableCache
21+ end
22+
1623function get_fsalfirstlast (cache:: CompositeCache , u)
1724 _x = get_fsalfirstlast (cache. caches[1 ], u)
1825 if first (_x) != = nothing
@@ -44,6 +51,10 @@ function get_fsalfirstlast(cache::DefaultCache, u)
4451 (cache. u, cache. u) # will be overwritten by the cache choice
4552end
4653
54+ function ismutablecache (cache:: DefaultCache{T1, T2, T3, T4, T5, T6, A, F, uType} ) where {T1, T2, T3, T4, T5, T6, A, F, uType}
55+ T1 <: OrdinaryDiffEqMutableCache
56+ end
57+
4758function alg_cache (alg:: CompositeAlgorithm , u, rate_prototype, :: Type{uEltypeNoUnits} ,
4859 :: Type{uBottomEltypeNoUnits} , :: Type{tTypeNoUnits} , uprev, uprev2, f, t,
4960 dt, reltol, p, calck,
0 commit comments