Skip to content

Commit 89f1803

Browse files
fixup! fix: improve type-stability of tearing_reassemble
1 parent 6804adb commit 89f1803

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,17 @@ Effects on the system structure:
325325
"""
326326
function generate_derivative_variables!(
327327
ts::TearingState, neweqs, var_eq_matching, full_var_eq_matching,
328-
var_sccs, mm::SparseMatrixCLIL{T, Int}, iv::Union{SymbolicT, Nothing}) where {T}
328+
var_sccs, mm::Union{Nothing, SparseMatrixCLIL}, iv::Union{SymbolicT, Nothing})
329329
@unpack fullvars, sys, structure = ts
330330
@unpack solvable_graph, var_to_diff, eq_to_diff, graph = structure
331331
eq_var_matching = invview(var_eq_matching)
332332
diff_to_var = invview(var_to_diff)
333333
is_discrete = is_only_discrete(structure)
334334
linear_eqs = Dict{Int, Int}()
335-
for (i, e) in enumerate(mm.nzrows)
336-
linear_eqs[e] = i
335+
if mm !== nothing
336+
for (i, e) in enumerate(mm.nzrows)
337+
linear_eqs[e] = i
338+
end
337339
end
338340

339341
# We need the inverse mapping of `var_sccs` to update it efficiently later.

0 commit comments

Comments
 (0)