diff --git a/src/Numerics/caches.jl b/src/Numerics/caches.jl index 39c72fb3af4063ef9247951cf7042bb70011f1f1..b0cfe0dedc7af7172c8f6311120e3f2efb56ad7b 100644 --- a/src/Numerics/caches.jl +++ b/src/Numerics/caches.jl @@ -23,12 +23,12 @@ Base.show(io::IO, mime::MIME{Symbol("text/plain")}, cache::DiffCache) = show(io, _retrieve(cache_var::AbstractArray{T}, ::AbstractArray{T}) where {T} = cache_var _retrieve(cache_var::AbstractArray{T}, u::AbstractArray{U}) where {T,U} = copyto!(similar(u, length(cache_var)), cache_var) retrieve(dc::DiffCache) = dc.cache.du -retrieve(dc::DiffCache, u::AbstractArray{T}) where {T<:ForwardDiff.Dual} = copyto!(Prealloc.get_tmp(dc.cache, u), dc.cache.du) +retrieve(dc::DiffCache, u::AbstractArray{T}) where {T<:ForwardDiff.Dual} = Prealloc.get_tmp(dc.cache, u) retrieve(dc::DiffCache, u::AbstractArray{T}) where {T} = _retrieve(dc.cache.du, u) retrieve(dc::DiffCache, u::AbstractArray{T}, t) where {T} = retrieve(dc, u) # these cover cases for Rosenbrock solvers where only t has differentiable type -retrieve(dc::DiffCache, u::AbstractArray, t::T) where {T<:ForwardDiff.Dual} = copyto!(Prealloc.get_tmp(dc.cache, t), dc.cache.du) -retrieve(dc::DiffCache, u::AbstractArray{T}, t::T) where {T<:ForwardDiff.Dual} = copyto!(Prealloc.get_tmp(dc.cache, u), dc.cache.du) +retrieve(dc::DiffCache, u::AbstractArray, t::T) where {T<:ForwardDiff.Dual} = Prealloc.get_tmp(dc.cache, t) +retrieve(dc::DiffCache, u::AbstractArray{T}, t::T) where {T<:ForwardDiff.Dual} = Prealloc.get_tmp(dc.cache, u) """ ArrayCache{T,TA} <: StateVarCache