Skip to content

Commit 99c6ee4

Browse files
fix: fix type-instability of get_root_indp
1 parent 5edf434 commit 99c6ee4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/solutions/save_idxs.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ function as_diffeq_array(vt::Vector{VectorTemplate}, t)
4444
return DiffEqArray(typeof(TupleOfArraysWrapper(vt))[], t, (1, 1))
4545
end
4646

47-
function get_root_indp(indp)
48-
if hasmethod(symbolic_container, Tuple{typeof(indp)}) &&
49-
(sc = symbolic_container(indp)) !== indp
50-
return get_root_indp(sc)
51-
end
52-
return indp
47+
function get_root_indp(prob::AbstractSciMLProblem)
48+
prob.f.sys
49+
end
50+
51+
function get_root_indp(prob::LinearProblem)
52+
get_root_indp(prob.f)
53+
end
54+
55+
get_root_indp(::Nothing) = nothing
56+
57+
function get_root_indp(f::SymbolicLinearInterface)
58+
get_root_indp(f.sys)
5359
end
5460

5561
# Everything from this point on is public API

0 commit comments

Comments
 (0)