Skip to content

Commit a5b1ff4

Browse files
refactor: don't do CSE hack for operators
Prevents annoying equations with `Initial` parameters
1 parent 684bc21 commit a5b1ff4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ function cse_and_array_hacks(sys, obs, subeqs, unknowns, neweqs; cse = true, arr
647647
# HACK 1
648648
if cse && is_getindexed_array(rhs)
649649
rhs_arr = arguments(rhs)[1]
650+
iscall(rhs_arr) && operation(rhs_arr) isa Symbolics.Operator && continue
650651
if !haskey(rhs_to_tempvar, rhs_arr)
651652
tempvar = gensym(Symbol(lhs))
652653
N = length(rhs_arr)

0 commit comments

Comments
 (0)