1818
1919const ParamIndexMap = Dict{Union{Symbol, BasicSymbolic}, Tuple{Int, Int}}
2020const UnknownIndexMap = Dict{
21- Union{Symbol, BasicSymbolic}, Union{Int, UnitRange{Int}, Array {Int}}}
21+ Union{Symbol, BasicSymbolic}, Union{Int, UnitRange{Int}, AbstractArray {Int}}}
2222
2323struct IndexCache
2424 unknown_idx:: UnknownIndexMap
@@ -41,7 +41,7 @@ function IndexCache(sys::AbstractSystem)
4141 for sym in unks
4242 usym = unwrap (sym)
4343 sym_idx = if Symbolics. isarraysymbolic (sym)
44- idx: (idx + length (sym) - 1 )
44+ reshape ( idx: (idx + length (sym) - 1 ), size (sym) )
4545 else
4646 idx
4747 end
@@ -60,7 +60,7 @@ function IndexCache(sys::AbstractSystem)
6060
6161 idxs = [unk_idxs[arrsym[i]] for i in eachindex (arrsym)]
6262 if idxs == idxs[begin ]: idxs[end ]
63- idxs = idxs[begin ]: idxs[end ]
63+ idxs = reshape ( idxs[begin ]: idxs[end ], size (idxs))
6464 end
6565 unk_idxs[arrsym] = idxs
6666 if hasname (arrsym)
@@ -140,7 +140,7 @@ function IndexCache(sys::AbstractSystem)
140140 for (j, p) in enumerate (buf)
141141 idxs[p] = (i, j)
142142 idxs[default_toterm (p)] = (i, j)
143- if hasname (p)
143+ if hasname (p) && ( ! istree (p) || operation (p) != = getindex)
144144 idxs[getname (p)] = (i, j)
145145 idxs[getname (default_toterm (p))] = (i, j)
146146 end
0 commit comments