Skip to content

Code generation fails for 2D constant lists with an LHS index #109

@ToddFincannon

Description

@ToddFincannon

Two-dimensional constant lists with an index on the LHS do not generate code correctly. For instance, this model:

DimA: A1, A2, A3 ~~|
DimB: B1, B2 ~~|
DimC: C1, C2 ~~|

p[DimA, DimB, C1]=
0, 0;
0, 0;
0, 0;
~~|

emits the following error message when generating C code:

_p[_a1,_b1] → _p[0][0] not found in C names

The LHS only contains the dimension subscripts, thus the search through C names that contain all three subscripts fails. Constant lists are separated into individual equations that assign one constant value to each combination of subscripts resolved into indices. The code generator assumes that only the separation dimensions are present on the LHS.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions