Changes between Initial Version and Version 2 of Ticket #1415


Ignore:
Timestamp:
2013-04-29T16:06:27Z (12 years ago)
Author:
Martin Sjölund
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1415

    • Property Cc Frenkel TUD added; Jens Frenkel removed
    • Property ComponentBackend
  • Ticket #1415 – Description

    initial v2  
    1 {{{  class ArrayCall
     1{{{#!mo
     2  class ArrayCall
    23    function fn
    34      input Real r;
     
    89    end fn;
    910    Real x[10] = fn(time);
    10   end ArrayCall;}}}
     11  end ArrayCall;
     12}}}
    1113
    1214Either we do common subexpression elimination in the backend or keep the arrays non-expanded. Common subexpression elimination would of course be preferrable as then we could do things like:
    13 {{{class ArrayCall
     15{{{#!mo
     16class ArrayCall
    1417  Real x[10] = fn(time);
    1518  Real y[10] = fn(time)*2;
    1619  Real z[10] = fn(time)*3;
    17 end ArrayCall;}}}
     20end ArrayCall;
     21}}}
    1822And only call fn once. We probably need to introduce temporary variables to deal with duplicated function calls.