Opened 15 years ago

Last modified 15 years ago

#1136 closed defect (fixed)

Reduction expression (from MathCore)

Reported by: Jan Brugård Owned by: Jan Brugård
Priority: high Milestone:
Component: Version:
Keywords: Cc: Jan Brugård, Per Östlund

Description

Reduction expression doesn't work. See for example the model:

model test
  Real A;
  parameter Real x[:]={1,2,3,4,5};
equation 
  A=min(x[j] for j in 1:size(x, 1));
end test;

The error messages from this model is:

--- [55] 12:51:27 Validation of class test ---
Check of test failed
Error: Type mismatch in equation A=<reduction>min(x[1] for j in {1,2,3,4,5}) of type Real=Real[5]
Error: Error occured while flattening model test

See the Modelica Spec 3.1 section 10.3.4 for more information about the reduction expressions.

Change History (2)

comment:2 by Per Östlund, 15 years ago

Reduction are now implemented and working, except for reduction expressions where the range is an empty vector.

Note: See TracTickets for help on using tickets.