Skip to content

Commit fe391b6

Browse files
committed
make sure sparse matrix is constructed with eltype(u)
1 parent 29c9780 commit fe391b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/OrdinaryDiffEqDifferentiation/src/derivative_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, jac_config, ::Type{uEltypeNoUn
767767
!isnothing(jac_config) ?
768768
convert.(
769769
eltype(u), SparseMatrixColorings.sparsity_pattern(jac_config[1])) :
770-
spzeros(length(u), length(u))
770+
spzeros(eltype(u), length(u), length(u))
771771
elseif eltype(f.sparsity) == Bool
772772
convert.(eltype(u), f.sparsity)
773773
else
@@ -798,7 +798,7 @@ function build_J_W(alg, u, uprev, p, t, dt, f::F, jac_config, ::Type{uEltypeNoUn
798798

799799
if isnothing(f.sparsity)
800800
!isnothing(jac_config) ? convert.(eltype(u), SparseMatrixColorings.sparsity_pattern(jac_config[1])) :
801-
spzeros(length(u), length(u))
801+
spzeros(eltype(u), length(u), length(u))
802802
elseif eltype(f.sparsity) == Bool
803803
convert.(eltype(u), f.sparsity)
804804
else

0 commit comments

Comments
 (0)