Skip to content

Commit 545eba2

Browse files
fix: allow latexificaton of change_origin from array hack
1 parent ae2a7ec commit 545eba2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/structural_transformation/symbolics_tearing.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,16 +1265,15 @@ function tearing_hacks(sys, obs, unknowns, neweqs; array = true)
12651265
for (arrvar, cnt) in arr_obs_occurrences
12661266
cnt == length(arrvar) || continue
12671267
# firstindex returns 1 for multidimensional array symbolics
1268-
firstind = first(eachindex(arrvar))
1268+
firstind = Tuple(first(eachindex(arrvar)))
12691269
scal = [arrvar[i] for i in eachindex(arrvar)]
12701270
# respect non-1-indexed arrays
12711271
# TODO: get rid of this hack together with the above hack, then remove OffsetArrays dependency
12721272
# `change_origin` is required because `Origin(firstind)(scal)` makes codegen
12731273
# try to `create_array(OffsetArray{...}, ...)` which errors.
12741274
# `term(Origin(firstind), scal)` doesn't retain the `symtype` and `size`
12751275
# of `scal`.
1276-
rhs = scal
1277-
rhs = change_origin(firstind, rhs)
1276+
rhs = change_origin(firstind, scal)
12781277
push!(obs_arr_eqs, arrvar ~ rhs)
12791278
end
12801279
append!(obs, obs_arr_eqs)
@@ -1284,7 +1283,7 @@ end
12841283

12851284
# PART OF HACK
12861285
function change_origin(origin, arr)
1287-
if all(isone, Tuple(origin))
1286+
if all(isone, origin)
12881287
return arr
12891288
end
12901289
return Origin(origin)(arr)

0 commit comments

Comments
 (0)