Skip to content

Commit f3d4218

Browse files
Merge pull request #2657 from jClugstor/bug_fix_2656
Fix typo, add test for 2656
2 parents da8d130 + 6b9a5ab commit f3d4218

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/OrdinaryDiffEqDifferentiation/src/alg_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function prepare_user_sparsity(ad_alg, prob)
122122

123123
if !isnothing(jac_prototype)
124124
for idx in idxs
125-
jac_prototype[idx] = f.mass_matrix[idx]
125+
jac_prototype[idx] = prob.f.mass_matrix[idx]
126126
end
127127
end
128128
end

test/interface/sparsediff_tests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ for f in [f_oop, f_ip]
6464
[
6565
ODEFunction(f, colorvec = colors,
6666
jac_prototype = jac_sp),
67+
ODEFunction(f, colorvec = colors,
68+
jac_prototype = jac_sp, mass_matrix = I(length(u0))),
6769
ODEFunction(f, jac_prototype = jac_sp),
6870
ODEFunction(f, colorvec = colors,
6971
sparsity = jac_sp)

0 commit comments

Comments
 (0)