Opened 12 years ago
Closed 11 years ago
#2669 closed enhancement (fixed)
Unnecessary function call for returning arrays
| Reported by: | Willi Braun | Owned by: | Willi Braun |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.2 |
| Component: | Code Generation | Version: | trunk |
| Keywords: | Cc: |
Description
For the second equation in the example below our code generation generate too many call to the function. For every array output element one call to the function.
That cause performance issue for instance in our fmi import.
loadString("
function f1
input Real u[:];
input Integer n;
output Real y[n];
algorithm
for i in 1:n loop
y[i] := sin(u[i]);
end for;
end f1;
model ArrayReturnFunction
parameter Integer n = 2;
Real x[n] = {time, 2*time};
Real y1[n];
Real z1,z2;
equation
y1 = f1(x, n);
{z1,z2} = f1(x, 2);
end ArrayReturnFunction;
");
getErrorString();
simulate(ArrayReturnFunction);
getErrorString();
Change History (3)
comment:1 by , 11 years ago
| Milestone: | 1.9.1 → 1.9.2 |
|---|
comment:2 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → accepted |
Note:
See TracTickets
for help on using tickets.

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).