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

Commit eec25ff

Browse files
fix vector sizing in num_jacvec!
1 parent 4615d78 commit eec25ff

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/differentiation/jaches_products.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ function num_jacvec!(
4141
@. x += ϵ * vv
4242
f(cache2, x)
4343
@. x -= ϵ * vv
44-
@. dy = (cache2 - cache1) / ϵ
44+
vecdy = _vec(dy)
45+
veccache1 = _vec(cache1)
46+
veccache2 = _vec(cache2)
47+
@. vecdy = (veccache2 - veccache1) / ϵ
4548
end
4649

4750
function num_jacvec(f, x, v, f0 = nothing)

0 commit comments

Comments
 (0)