Opened 10 years ago

Closed 10 years ago

#2791 closed defect (fixed)

Array constructor with several iterators

Reported by: Henrik Tidefelt Owned by: Martin Sjölund
Priority: high Milestone: 1.9.1
Component: Frontend Version: trunk
Keywords: Cc:

Description (last modified by Henrik Tidefelt)

This example from version 3.3 of the Modelica specification, section 10.4.1.2 Array constructor with several iterators, does not work:

model Nested
  parameter Integer n = 4;
  Real hilb[:,:]= {(1/(i+j-1)) for i in 1:n, j in 1:n};
end Nested;

Output from the translation:

[CodegenC.tpl:9529:14-9529:14] Error: Template error: Code generation does not support multiple iterators: array(DIVISION(1.0, /*Real*/(i + j + -1)) for j in {1, 2, 3, 4}, i in {1, 2, 3, 4})

Change History (7)

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

Resolution: invalid
Status: newclosed

You have unbalanced parenthesis. It should not parse.

comment:2 by Martin Sjölund, 10 years ago

Milestone: Future

comment:3 by Per Östlund, 10 years ago

Reported as #1558.

comment:4 by Henrik Tidefelt, 10 years ago

Description: modified (diff)
Resolution: invalid
Status: closedreopened

Sorry about the missing parentheses in the description. Description corrected.

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

Owner: changed from somebody to Martin Sjölund
Status: reopenedaccepted

comment:6 by Martin Sjölund, 10 years ago

Milestone: 1.9.1

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

Resolution: fixed
Status: acceptedclosed

Fixed in r21983, with the expression in the description, and a similar one using sum, added as test cases.

Note: See TracTickets for help on using tickets.