Skip to content

Commit 5a7bc0f

Browse files
ensure no mass matrix works
1 parent c44aa4f commit 5a7bc0f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
179179

180180
M = calculate_massmatrix(sys)
181181

182-
_M = u0 === nothing ? M : ArrayInterface.restructure(u0 .* u0',M)
182+
_M = (u0 === nothing || M == I) ? M : ArrayInterface.restructure(u0 .* u0',M)
183183

184184
ODEFunction{iip}(f,jac=_jac,
185185
tgrad = _tgrad,

src/systems/diffeqs/sdesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = sys.states, ps = sys.
139139
end
140140

141141
M = calculate_massmatrix(sys)
142-
_M = u0 === nothing ? M : ArrayInterface.restructure(u0 .* u0',M)
142+
_M = (u0 === nothing || M == I) ? M : ArrayInterface.restructure(u0 .* u0',M)
143143

144144
SDEFunction{iip}(f,g,jac=_jac,
145145
tgrad = _tgrad,

0 commit comments

Comments
 (0)