Skip to content

Commit 4a873d6

Browse files
Update lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl
Co-authored-by: Guillaume Dalle <22795598+gdalle@users.noreply.github.com>
1 parent 29ab3b8 commit 4a873d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ function calc_J!(J, integrator, cache, next_step::Bool = false)
180180
if !isnothing(integrator.f.jac_prototype) &&
181181
integrator.f.jac_prototype isa SparseMatrixCSC
182182

183-
integrator.f.jac_prototype.nzval .= 1.0
184-
J .= 1.0 .* integrator.f.jac_prototype
185-
J.nzval .= 0.0
183+
integrator.f.jac_prototype.nzval .= true
184+
J .= true .* integrator.f.jac_prototype
185+
J.nzval .= false
186186
f.jac(J, duprev, uprev, p, uf.α * uf.invγdt, t)
187187
else
188188
f.jac(J, duprev, uprev, p, uf.α * uf.invγdt, t)

0 commit comments

Comments
 (0)