﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1931	Do not scalarize vector equations	Martin Sjölund	Jens Frenkel	"We should not scalarize equations, so we can reduce the number of function calls performed (here f is called once for each element in the matrix):
{{{
model M
  function f
    input Real r1,r2;
    output Real o[2] := {r1,r2};
  end f;
  Real rtime = time;
  Real r[:,:](each start = 1.5) = f(rtime,2:3);
end M;

model N
  M m;
end N;
}}}

With a better frontend, we can generate this flat code:
{{{
function M.f
  input Real r1;
  input Real r2;
  output Real[2] o = {r1, r2};
end M.f;

class N
  Real m.rtime = time;
  Real m.r[1,1](start = 1.5);
  Real m.r[1,2](start = 1.5);
  Real m.r[2,1](start = 1.5);
  Real m.r[2,2](start = 1.5);
equation
  m.r = {M.f(m.rtime, 2.0), M.f(m.rtime, 3.0)};
end N;
}}}"	defect	assigned	high		Frontend				Jens Frenkel
