Skip to content

Commit ade11d3

Browse files
committed
use W_sparsity in the SDEFunctionExpr
1 parent 8251a01 commit ade11d3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/systems/diffeqs/sdesystem.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,8 @@ function SDEFunctionExpr{iip}(sys::SDESystem, dvs = unknowns(sys),
741741

742742
if sparse
743743
uElType = u0 === nothing ? Float64 : eltype(u0)
744-
jac_prototype = similar(calculate_jacobian(sys; sparse), uElType)
745-
W_prototype = similar(jac_prototype + M, uElType)
744+
W_prototype = similar(W_sparsity(sys), uElType)
746745
else
747-
jac_prototype = nothing
748746
W_prototype = nothing
749747
end
750748

@@ -763,13 +761,13 @@ function SDEFunctionExpr{iip}(sys::SDESystem, dvs = unknowns(sys),
763761
g = $g
764762
tgrad = $_tgrad
765763
jac = $_jac
766-
jac_prototype = $jac_prototype
764+
W_prototype = $W_prototype
767765
Wfact = $_Wfact
768766
Wfact_t = $_Wfact_t
769767
M = $_M
770768
SDEFunction{$iip}(f, g,
771769
jac = jac,
772-
jac_prototype = jac_prototype,
770+
jac_prototype = W_prototype,
773771
tgrad = tgrad,
774772
Wfact = Wfact,
775773
Wfact_t = Wfact_t,

0 commit comments

Comments
 (0)