Opened 8 years ago
Closed 8 years ago
#4382 closed defect (fixed)
Array operators .- .+ fail
Reported by: | Owned by: | Lennart Ochel | |
---|---|---|---|
Priority: | normal | Milestone: | 1.12.0 |
Component: | MetaModelica | Version: | |
Keywords: | array, operator, scalar | Cc: |
Description
The operators .- and .+ give an error or wrong results as one can see in the example below. The result of the operation is shown as comment after the expression.
function main protected Real m[:]; String str; Real b[:]; algorithm m := array(1.0,2.0,3.0,4.0); b := m .+ 10.0; // 10 20 30 40 b := m .- 10.0; // -10 -20 -30 -40 b := 10.0 .+ m; // 10 20 30 40 b := 10.0 .- m; // Template error: Code generation does not support SUB_SCALAR_ARRAY 10.0 .- m. end main;
Change History (4)
comment:1 by , 8 years ago
comment:3 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → accepted |
comment:4 by , 8 years ago
Milestone: | Future → 1.12.0 |
---|---|
Resolution: | → fixed |
Status: | accepted → closed |
I've fixed also the missing case for SUB_SCALAR_ARRAY and added the example to the test suite (see OpenModelica-testsuite#615).
Note:
See TracTickets
for help on using tickets.
It seems that this only fail if the symbolic function evaluation is turned off.