Skip to content

Commit a10e0e9

Browse files
authored
Merge pull request #1521 from SciML/myb/jacfix
Fix invalidate_cache
2 parents 9c2064b + 4f301cd commit a10e0e9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/systems/abstractsystem.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,17 @@ const EMPTY_JAC = Matrix{Num}(undef, 0, 0)
241241
function invalidate_cache!(sys::AbstractSystem)
242242
if has_tgrad(sys)
243243
get_tgrad(sys)[] = EMPTY_TGRAD
244-
elseif has_jac(sys)
244+
end
245+
if has_jac(sys)
245246
get_jac(sys)[] = EMPTY_JAC
246-
elseif has_ctrl_jac(sys)
247+
end
248+
if has_ctrl_jac(sys)
247249
get_ctrl_jac(sys)[] = EMPTY_JAC
248-
elseif has_Wfact(sys)
250+
end
251+
if has_Wfact(sys)
249252
get_Wfact(sys)[] = EMPTY_JAC
250-
elseif has_Wfact_t(sys)
253+
end
254+
if has_Wfact_t(sys)
251255
get_Wfact_t(sys)[] = EMPTY_JAC
252256
end
253257
return sys

0 commit comments

Comments
 (0)