Opened 6 years ago

Closed 6 years ago

#4753 closed defect (fixed)

NF reductions use a poor generation

Reported by: sjoelund.se Owned by: perost
Priority: high Milestone: Future
Component: New Instantiation Version:
Keywords: Cc: casella, perost

Description

There are several problems with how reductions are handled in the new frontend. One is that for example sum is transformed into a sum *call* to a reduction returning an array instead of a single reduction that does not create a temporary array. The other is that it has problem with polymorphic types. It should be implemented in the same way as the old front-end handling of reductions.

function Modelica.Math.BooleanVectors.countTrue
  input Boolean[:] b;
  output Integer n;
algorithm
  /*Integer*/ n := /*polymorphic<ScalarBasicType>*/ sum(array(if /*Boolean*/ b[/*Integer*/ i] then 1 else 0 for i in 1:size(/*Boolean[:]*/ b, 1)));
end Modelica.Math.BooleanVectors.countTrue;

Change History (1)

comment:1 Changed 6 years ago by perost

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in bdd22db.

Note: See TracTickets for help on using tickets.