Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bossart committed Jun 29, 2024
1 parent a001d10 commit 5f03500
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/base/jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ function JacobianFunctionWrapper(
end
jac = zeros(n, n)
if sparse_retrieve_loop > 0
h(p, t; idxs = nothing) = typeof(idxs) <: Number ? x0[idxs] : x0
for _ in 1:sparse_retrieve_loop
temp = zeros(n, n)
rng_state = copy(Random.default_rng())
Jf(temp, x0 + Random.randn(n))
Jf(temp, x0 + Random.randn(n), h, 0.0)
copy!(Random.default_rng(), rng_state)
jac .+= abs.(temp)
end
Expand Down

0 comments on commit 5f03500

Please sign in to comment.