Skip to content

Commit 9e6ba3e

Browse files
committed
Fix constants handling in ODAEProblem
1 parent 5d99e9c commit 9e6ba3e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/structural_transformation/codegen.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,13 @@ function gen_nlsolve!(is_not_prepended_assignment, eqs, vars, u0map::AbstractDic
187187

188188
fname = gensym("fun")
189189
# f is the function to find roots on
190-
funex = isscalar ? rhss[1] : MakeArray(rhss, SVector)
191-
pre = get_preprocess_constants(funex)
190+
if isscalar
191+
funex = rhss[1]
192+
pre = get_preprocess_constants(funex)
193+
else
194+
funex = MakeArray(rhss, SVector)
195+
pre = get_preprocess_constants(rhss)
196+
end
192197
f = Func([DestructuredArgs(vars, inbounds = !checkbounds)
193198
DestructuredArgs(params, inbounds = !checkbounds)],
194199
[],

0 commit comments

Comments
 (0)