Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit f05b38b

Browse files
Fix AutoFiniteDiff caching
Adds the third cache to be truly non-allocating
1 parent 601ff82 commit f05b38b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/differentiation/jaches_products.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ function JacVec(f, u::AbstractArray, p = nothing, t = nothing; fu = nothing,
268268
cache, vecprod, vecprod! = if autodiff isa AutoFiniteDiff
269269
cache1 = similar(fu)
270270
cache2 = similar(u)
271+
cache3 = similar(u)
271272

272-
(cache1, cache2), num_jacvec, num_jacvec!
273+
(cache1, cache2, cache3), num_jacvec, num_jacvec!
273274
elseif autodiff isa AutoForwardDiff
274275
cache1 = Dual{
275276
typeof(ForwardDiff.Tag(tag, eltype(u))), eltype(u), 1

0 commit comments

Comments
 (0)