Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, you already have a program that produces this text:</p> <pre><code>prefactor = +s.ds8*s.ds10*ti[0]-&gt;value(); expr = ( - 5/243.*(s.x14*s.x15*csc[49300] + 9/10.*s.x14*s.x15*csc[49301] + 1/10.*s.x14*s.x15*csc[49302] - 3/5.*s.x14*s.x15*csc[49303] -... </code></pre> <p>and</p> <pre><code>double csc19295 = + s.ds0*s.ds1*s.ds2 * ( - 32*s.x12pow2*s.x15*s.x34*s.mbpow2*s.mWpowinv2 - 32*s.x12pow2*s.x15*s.x35*s.mbpow2*s.mWpowinv2 - 32*s.x12pow2*s.x15*s.x35*s.x45*s.mWpowinv2 -... </code></pre> <p>right?</p> <p>If all your functions have a similar "format" (multiply n numbers m times and add the results - or something similar) then I think you can do this:</p> <ul> <li>change the generator program to output offsets instead of strings (i.e. instead of the string "s.ds0" it will produce <code>offsetof(ProcessVars, ds0)</code></li> <li>create an array of such offsets </li> <li>write an evaluator which accepts the array above and the base addresses of the structure pointers and produces an result</li> </ul> <p>The array+evaluator will represent the same logic as one of your functions, but only the evaluator will be code. The array is "data" and can be either generated at runtime or saved on disk and read i chunks or with a memory mapped file.</p> <p>For your particular example in func1 imagine how you would rewrite the function via an evaluator if you had access to the base address of <code>s</code> and <code>csc</code> and also a vector like representation of the constants and the offsets you need to add to the base addresses to get to <code>x14</code>, <code>ds8</code> and <code>csc[51370]</code></p> <p>You need to create a new form of "data" that will describe how to process the actual data you pass to your huge number of functions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload