#2532 closed defect (fixed)
Incorrect multilevel matrix slicing/indexing
| Reported by: | Malte Lenz | Owned by: | Adrian Pop |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.1 |
| Component: | Frontend | Version: | trunk |
| Keywords: | Cc: |
Description
Instantiating Matrix:
model Vector
Real x[2];
end Vector;
model Matrix
Vector v[2];
equation
v[:].x[:] = {{sin(time),cos(time)},{sin(time-0.5),cos(time-0.5)}};
end Matrix;
gives:
class Matrix Real v[1].x[1]; Real v[1].x[2]; Real v[2].x[1]; Real v[2].x[2]; equation v[:].x[1,1] = sin(time); v[:].x[1,2] = cos(time); v[:].x[2,1] = sin(time + -0.5); v[:].x[2,2] = cos(time + -0.5); end Matrix;
which is clearly not the correct indexing in the equations. This leads to a build/simulation failure.
Change History (3)
comment:1 by , 12 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:3 by , 12 years ago
Hi!
Now it's working perfectly!
Thank you for this fix!
class Matrix Real v[1].x[1]; Real v[1].x[2]; Real v[2].x[1]; Real v[2].x[2]; equation v[1].x[1] = sin(time); v[1].x[2] = cos(time); v[2].x[1] = sin(time + -0.5); v[2].x[2] = cos(time + -0.5); end Matrix;
Note:
See TracTickets
for help on using tickets.

Fixed in r18725.