Opened 10 years ago
Last modified 2 years ago
#698 assigned umbrella
Scalarization of array expressions of unknown size in functions
Reported by: | Jesper Mattsson | Owned by: | Jonathan Kämpe |
---|---|---|---|
Priority: | major | Milestone: | Future |
Component: | Modelica/FrontEnd | Version: | trunk |
Keywords: | Cc: |
Description (last modified by )
General support for array expressions of unknown size in functions is implemented by scalarizing expressions to for loops. However, this is only implemented for a few node types, and needs to be expanded to all statements and expression types.
Already implemented:
- Assign statements (unknown = unknown)
- Function call statements
- All element-wise operators
- Multiplication
- size()
Create new tickets for each part and update lists below with links to the new tickets. Close this ticket when lists are complete and all sub-tickets are closed.
Basic support
- Assigning from unknown to known or vice versa
- Array constructors
Array concatenation- End operator
- Slices (e.g.
x[:,2:end]
) - For statements (the in expression of an index is an array - range expressions already supported)
Operators
scalar()?- transpose()
- symmetric()
- identity()
- linspace()
- fill(), ones() & zeroes()
- min() & max()
- cat()
sum()- Matrix exponentiation (`^`)
Iterator expressions (... for i in ...
)- vector() & matrix()
Current implementation can be very inefficient - see #3225.
Subtickets
Open:
Ticket | Summary | Owner | Milestone |
---|---|---|---|
#5540 | Unknown size matrix exponentiation | ||
#5541 | Unknown size symmetric() |
Closed:
Change History (29)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 10 years ago by
TODO: Make sure that expressions that have known size, but has sub-expressions with unknown size are handled.
Example:
function f input Real x[2,:]; input Real y[size(x, 1), 2]; output Real z[2, 2]; algorithm; z := x * y; end f;
comment:6 Changed 10 years ago by
Note that there are two places that need to support this: addArrayUsesToIndexMap()/createArrayTemporaries() and extractUnknownRecordArrayCell().
comment:7 Changed 10 years ago by
Expressions that have known size, but has sub-expressions with unknown size are already handled.
comment:8 Changed 10 years ago by
Milestone: | → 1.3.x |
---|
comment:9 Changed 9 years ago by
Milestone: | 1.3.x → 1.4.x |
---|---|
Owner: | set to Jesper Mattsson |
Status: | new → assigned |
comment:10 Changed 9 years ago by
Milestone: | 1.4.x → 1.5.x |
---|
comment:11 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:12 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:13 Changed 9 years ago by
Milestone: | 1.5.x → Future |
---|
comment:14 Changed 8 years ago by
Description: | modified (diff) |
---|
- Added support for sum() of array of unknown size.
- Added support for arrays of unknown size in iterator expressions.
comment:15 Changed 8 years ago by
Description: | modified (diff) |
---|
comment:16 Changed 8 years ago by
Description: | modified (diff) |
---|
comment:18 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:19 Changed 7 years ago by
Description: | modified (diff) |
---|
comment:20 Changed 6 years ago by
Description: | modified (diff) |
---|
comment:21 Changed 6 years ago by
Description: | modified (diff) |
---|
comment:22 Changed 6 years ago by
Description: | modified (diff) |
---|
comment:23 Changed 6 years ago by
Type: | enhancement → umbrella |
---|
comment:24 Changed 5 years ago by
Description: | modified (diff) |
---|
comment:25 Changed 5 years ago by
Description: | modified (diff) |
---|
comment:26 Changed 2 years ago by
Owner: | changed from Jesper Mattsson to Jonathan Kämpe |
---|
What remains?
comment:27 Changed 2 years ago by
Description: | modified (diff) |
---|
Removed items not relevant in functions
comment:28 Changed 2 years ago by
Description: | modified (diff) |
---|
Lists might not be complete.