From 71eed5fc8ca5ea239b9ded64f7e09d7cfc2f38f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20M=C3=BCller-Widmann?= Date: Wed, 5 Nov 2025 10:25:48 +0000 Subject: [PATCH] Use `FiniteDiff.finite_difference_jacobian!` --- .../onearg.jl | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl index 82b769ef6..2fdb0351e 100644 --- a/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl +++ b/DifferentiationInterface/ext/DifferentiationInterfaceFiniteDiffExt/onearg.jl @@ -403,12 +403,7 @@ function DI.jacobian!( DI.check_prep(f, prep, backend, x, contexts...) (; relstep, absstep, dir) = prep fc = DI.fix_tail(f, map(DI.unwrap, contexts)...) - return copyto!( - jac, - finite_difference_jacobian( - fc, x, prep.cache; jac_prototype = jac, relstep, absstep, dir - ), - ) + return finite_difference_jacobian!(jac, fc, x, prep.cache; relstep, absstep, dir) end function DI.value_and_jacobian!( @@ -425,12 +420,7 @@ function DI.value_and_jacobian!( y = fc(x) return ( y, - copyto!( - jac, - finite_difference_jacobian( - fc, x, prep.cache, y; jac_prototype = jac, relstep, absstep, dir - ), - ), + finite_difference_jacobian!(jac, fc, x, prep.cache, y; relstep, absstep, dir), ) end