Skip to content

Commit e186248

Browse files
authored
Merge pull request #1899 from SciML/YingboMa-patch-1
Only generate sparsity when sparsity is wanted
2 parents e314197 + 84a897c commit e186248

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ function ODEFunctionExpr{iip}(sys::AbstractODESystem, dvs = states(sys),
562562
syms = $(Symbol.(states(sys))),
563563
indepsym = $(QuoteNode(Symbol(get_iv(sys)))),
564564
paramsyms = $(Symbol.(parameters(sys))),
565-
sparsity = $(jacobian_sparsity(sys)))
565+
sparsity = $sparsity ? $(jacobian_sparsity(sys)) : $nothing)
566566
end
567567
!linenumbers ? striplines(ex) : ex
568568
end

0 commit comments

Comments
 (0)