We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
flatten_equations
1 parent 0a9ad57 commit 9a3a0d6Copy full SHA for 9a3a0d6
src/utils.jl
@@ -1182,8 +1182,14 @@ without scalarizing occurrences of array variables and return the new list of eq
1182
function flatten_equations(eqs::Vector{Equation})
1183
_eqs = Equation[]
1184
for eq in eqs
1185
- for (i1, i2) in zip(SU.stable_eachindex(eq.lhs), SU.stable_eachindex(eq.rhs))
1186
- push!(_eqs, eq.lhs[i1] ~ eq.rhs[i2])
+ if !SU.is_array_shape(SU.shape(eq.lhs))
+ push!(_eqs, eq)
1187
+ continue
1188
+ end
1189
+ lhs = vec(collect(eq.lhs)::Array{SymbolicT})::Vector{SymbolicT}
1190
+ rhs = vec(collect(eq.rhs)::Array{SymbolicT})::Vector{SymbolicT}
1191
+ for (l, r) in zip(lhs, rhs)
1192
+ push!(_eqs, l ~ r)
1193
end
1194
1195
return _eqs
0 commit comments