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 Jonathan Kämpe)

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

Operators

Current implementation can be very inefficient - see #3225.

Subtickets

New subticket

Open:

Closed:

Ticket Summary Owner Milestone
#731 Support 'end' operator in arrays of unknown size Jesper Mattsson 1.2.x
#732 Support slices in arrays of unknown size Jonathan Kämpe 1.12.x
#734 Support for statement over vector of unknown size Jesper Mattsson 2.0.x
#735 Support array constructors in array expressions of unknown size Jesper Mattsson 1.4.x
#1719 Support fill expressions in array expressions of unknown size Jesper Mattsson 1.7
#1748 Assigning between unknown and known array size Jonathan Kämpe 1.12
#1885 Linspace in functions Jonathan Kämpe 1.12
#3130 transpose() over unknown size array Jonathan Kämpe 1.12.x
#3369 Unknown size min()/max() Jonathan Kämpe 1.14.x
#3370 Unknown size cat() Jonathan Kämpe 1.14.x
#3903 Unknown size identity() Jesper Mattsson 1.15.x
#3904 Unknown size vector() & matrix() Jonathan Kämpe 1.15.x
#3934 Hidden unknown sizes Jonathan Kämpe 1.15.x


Change History (29)

comment:1 Changed 10 years ago by Jesper Mattsson

Lists might not be complete.

comment:2 Changed 10 years ago by Jesper Mattsson

Description: modified (diff)

comment:3 Changed 10 years ago by Jesper Mattsson

Description: modified (diff)

comment:4 Changed 10 years ago by Jesper Mattsson

Description: modified (diff)

comment:5 Changed 10 years ago by Jesper Mattsson

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 Jesper Mattsson

Note that there are two places that need to support this: addArrayUsesToIndexMap()/createArrayTemporaries() and extractUnknownRecordArrayCell().

comment:7 Changed 10 years ago by Jesper Mattsson

Expressions that have known size, but has sub-expressions with unknown size are already handled.

comment:8 Changed 10 years ago by jakesson

Milestone: 1.3.x

comment:9 Changed 9 years ago by jakesson

Milestone: 1.3.x1.4.x
Owner: set to Jesper Mattsson
Status: newassigned

comment:10 Changed 9 years ago by Jesper Mattsson

Milestone: 1.4.x1.5.x

comment:11 Changed 9 years ago by Jesper Mattsson

Description: modified (diff)

comment:12 Changed 9 years ago by Jesper Mattsson

Description: modified (diff)

comment:13 Changed 9 years ago by Jesper Mattsson

Milestone: 1.5.xFuture

comment:14 Changed 8 years ago by Jesper Mattsson

Description: modified (diff)

changeset:2880

  • 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 Jesper Mattsson

Description: modified (diff)

comment:16 Changed 8 years ago by Jesper Mattsson

Description: modified (diff)

comment:17 Changed 7 years ago by Jesper Mattsson

Compliance errors are missing, this is covered by #2155.

comment:18 Changed 7 years ago by Jesper Mattsson

Description: modified (diff)

comment:19 Changed 7 years ago by Jesper Mattsson

Description: modified (diff)

comment:20 Changed 6 years ago by Jonathan Kämpe

Description: modified (diff)

comment:21 Changed 6 years ago by Jonathan Kämpe

Description: modified (diff)

comment:22 Changed 6 years ago by Jonathan Kämpe

Description: modified (diff)

comment:23 Changed 6 years ago by Jesper Mattsson

Type: enhancementumbrella

comment:24 Changed 5 years ago by Jesper Mattsson

Description: modified (diff)

comment:25 Changed 5 years ago by Jesper Mattsson

Description: modified (diff)

comment:26 Changed 2 years ago by Jesper Mattsson

Owner: changed from Jesper Mattsson to Jonathan Kämpe

What remains?

comment:27 Changed 2 years ago by Jonathan Kämpe

Description: modified (diff)

Removed items not relevant in functions

comment:28 Changed 2 years ago by Jonathan Kämpe

Description: modified (diff)

comment:29 Changed 2 years ago by Jonathan Kämpe

Still relevant for symmetric and matrix exponentiation.

Note: See TracTickets for help on using tickets.