Skip to content

Commit 2e1d3c5

Browse files
fix: fix SCCNonlinearProblem codegen
1 parent c850df7 commit 2e1d3c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ function SciMLBase.SCCNonlinearProblem{iip}(sys::NonlinearSystem, u0map,
710710
# precomputed subexpressions should not contain `banned_vars`
711711
banned_vars = Set{Any}(vcat(_dvs, getproperty.(_obs, (:lhs,))))
712712
filter!(banned_vars) do var
713-
symbolic_type(var) != ArraySymbolic() || all(x -> var[i] in banned_vars, eachindex(var))
713+
symbolic_type(var) != ArraySymbolic() || all(j -> var[j] in banned_vars, eachindex(var))
714714
end
715715
state = Dict()
716716
for i in eachindex(_obs)
@@ -772,6 +772,7 @@ function SciMLBase.SCCNonlinearProblem{iip}(sys::NonlinearSystem, u0map,
772772
_obs = scc_obs[i]
773773
cachevars = scc_cachevars[i]
774774
cacheexprs = scc_cacheexprs[i]
775+
_prevobsidxs = vcat(_prevobsidxs, observed_equations_used_by(sys, reduce(vcat, values(cacheexprs); init = [])))
775776

776777
if isempty(cachevars)
777778
push!(explicitfuns, Returns(nothing))

0 commit comments

Comments
 (0)