Skip to content

Commit 12f926c

Browse files
fix: only use OffsetArray if starting index is not 1
1 parent 816fde7 commit 12f926c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,9 @@ function tearing_reassemble(state::TearingState, var_eq_matching,
592592

593593
# respect non-1-indexed arrays
594594
# TODO: get rid of this hack together with the above hack, then remove OffsetArrays dependency
595-
obs_arr_subs[arg1] = Origin(index_first)(obs_arr_subs[arg1])
595+
if !isone(index_first)
596+
obs_arr_subs[arg1] = Origin(index_first)(obs_arr_subs[arg1])
597+
end
596598
end
597599
for i in eachindex(neweqs)
598600
neweqs[i] = fast_substitute(neweqs[i], obs_arr_subs; operator = Symbolics.Operator)

0 commit comments

Comments
 (0)