File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -243,16 +243,16 @@ end
243
243
const EMPTY_TGRAD = Vector {Num} (undef, 0 )
244
244
const EMPTY_JAC = Matrix {Num} (undef, 0 , 0 )
245
245
function invalidate_cache! (sys:: AbstractSystem )
246
- if isdefined (sys, :tgrad )
247
- sys. tgrad [] = EMPTY_TGRAD
248
- elseif isdefined (sys, :jac )
249
- sys. jac [] = EMPTY_JAC
250
- elseif isdefined (sys, :ctrl_jac )
251
- sys. jac [] = EMPTY_JAC
252
- elseif isdefined (sys, :Wfact )
253
- sys. jac [] = EMPTY_JAC
254
- elseif isdefined (sys, :Wfact_t )
255
- sys. jac [] = EMPTY_JAC
246
+ if has_tgrad (sys)
247
+ get_tgrad ( sys) [] = EMPTY_TGRAD
248
+ elseif has_jac (sys)
249
+ get_jac ( sys) [] = EMPTY_JAC
250
+ elseif has_ctrl_jac (sys)
251
+ get_ctrl_jac ( sys) [] = EMPTY_JAC
252
+ elseif has_Wfact (sys)
253
+ get_Wfact ( sys) [] = EMPTY_JAC
254
+ elseif has_Wfact_t (sys)
255
+ get_Wfact_t ( sys) [] = EMPTY_JAC
256
256
end
257
257
return sys
258
258
end
You can’t perform that action at this time.
0 commit comments