Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#2258 closed defect (fixed)

Code generation does not support multiple iterators

Reported by: Francesco Casella Owned by: Martin Sjölund
Priority: high Milestone: 1.9.4
Component: Code Generation Version: trunk
Keywords: Cc: e.da-silva@…

Description

Multiple iterators are not supported in OMC. This can be tested by simulating the following simple model:

model foo
  parameter Integer nRows = 3,nCols = 3;
  Real hilb[nRows,nCols] = array(1/(i+j-1) for i in 1:nRows, j in 1:nCols);
end foo;

which gives the following error:

[CodegenC.tpl:8122:14-8122:14:writable] Error: Template error: Code generation does not support multiple iterators: array(DIVISION(1.0, /*Real*/(i + j + -1), #SHARED_LITERAL_0(String)#) for j in #SHARED_LITERAL_1(Integer[3])#, i in #SHARED_LITERAL_1(Integer[3])#)

Change History (8)

comment:1 by Martin Sjölund, 12 years ago

But at least I added a nice message saying it's not working, right? ;)

comment:2 by Adrian Pop, 12 years ago

Maybe we should rewrite multiple iterators to for loops as those are supported already as far as i know.

comment:3 by Martin Sjölund, 12 years ago

Nah, you can rewrite them to 2 different iterators instead. Or fix them in the runtime (Ceval handles them).

comment:4 by Martin Sjölund, 12 years ago

Milestone: Future2.0.0

comment:5 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:6 by Francesco Casella, 9 years ago

Resolution: fixed
Status: newclosed

It seems that the problem has been solved in the meantime, as the reported test case works fine with omc v.1.9.4-dev-184-g7bf48ba

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.