Skip to content

Commit 1e6b296

Browse files
committed
fix: check actual sparsity pattern
1 parent bd8913b commit 1e6b296

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,10 @@ end
132132

133133
function assert_jac_length_header(sys)
134134
W = W_sparsity(sys)
135-
135+
(W_Is, W_Js, W_Vs) = findnz(W)
136136
identity, expr -> Func([expr.args...], [], LiteralExpr(quote
137-
@assert nnz($(expr.args[1])) == nnz(W)
137+
J_Is, J_Js, J_Vs = $(findnz)($(expr.args[1]))
138+
@assert (J_Is, J_Js) == ($W_Is, $W_Js)
138139
expr.body
139140
end))
140141
end

0 commit comments

Comments
 (0)