You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an array variable with separated dimensions occurs on the RHS, we must expand the simple var name reference into a list of subscripted refIds over all the separated indices. This comes up when initializing an array with constant lists or reading a data variable from a file, both of which separate the variable into individual variables. For instance, the variable a in this model:
is separated on all three dimensions because of the const list. When it occurs in the SUM function, we need to expand all three dimensions into the separated variables, giving refIds such as _p[_a1,_b1,_c1].
The EquationReader.visitSubscriptList method is responsible for expanding the references, but it only handles one or two dimensions. To handle this case, it needs to handle three dimensions.
The text was updated successfully, but these errors were encountered:
I generalized the EquationReader.visitSubscriptList method to handle any number of separated dimensions by flattening the nested loops into a cartesian product. I added tests to cover this case plus the cases with two separated dimension with and without an additional unseparated dimension. This was done inside the SUM function on the RHS, but should apply to any function that takes subscripted variable arguments.
When an array variable with separated dimensions occurs on the RHS, we must expand the simple var name reference into a list of subscripted refIds over all the separated indices. This comes up when initializing an array with constant lists or reading a data variable from a file, both of which separate the variable into individual variables. For instance, the variable
a
in this model:is separated on all three dimensions because of the const list. When it occurs in the SUM function, we need to expand all three dimensions into the separated variables, giving refIds such as
_p[_a1,_b1,_c1]
.The
EquationReader.visitSubscriptList
method is responsible for expanding the references, but it only handles one or two dimensions. To handle this case, it needs to handle three dimensions.The text was updated successfully, but these errors were encountered: