From 12f926ce33455647c606da279bb3d3bf6b2e9d8c Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Thu, 10 Oct 2024 15:20:50 +0530 Subject: [PATCH] fix: only use `OffsetArray` if starting index is not 1 --- src/structural_transformation/symbolics_tearing.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/structural_transformation/symbolics_tearing.jl b/src/structural_transformation/symbolics_tearing.jl index 84cee928cd..b176a97a9b 100644 --- a/src/structural_transformation/symbolics_tearing.jl +++ b/src/structural_transformation/symbolics_tearing.jl @@ -592,7 +592,9 @@ function tearing_reassemble(state::TearingState, var_eq_matching, # respect non-1-indexed arrays # TODO: get rid of this hack together with the above hack, then remove OffsetArrays dependency - obs_arr_subs[arg1] = Origin(index_first)(obs_arr_subs[arg1]) + if !isone(index_first) + obs_arr_subs[arg1] = Origin(index_first)(obs_arr_subs[arg1]) + end end for i in eachindex(neweqs) neweqs[i] = fast_substitute(neweqs[i], obs_arr_subs; operator = Symbolics.Operator)