Great, thanks for the explanation Andrew.

> Hi Andre,
> 
> There are two main changes:
> 1) The separation of code generation into two steps:
>      a) generating a DAG of objects representing steps in a procedural 
> process.
>      b) DFS visit of the DAG, generating C code as a side effect.
> 2) Support for optimising numerical Jacobian calculations. This works by 
> splitting the DAG visit into two steps: firstly visit starting from all 
> equations used to compute variables directly used by the rate equations 
> (so the DFS will catch all procedural steps needed to compute variables 
> needed to compute the rates), and secondly (wrapped in #ifndef 
> VARIABLES_FOR_RATES_ONLY) visits all remaining equations.
> 
> Change 1 should not affect the output of the functions that get 
> generated (it may change the ordering of assignments, but only to the 
> extent that ordering does not matter, so you will still get the exact 
> same results).
> 
> Change 2 only makes any difference at all if you define 
> VARIABLES_FOR_RATES_ONLY in your variableCodeFragment. Since this will 
> not normally be defined, you don't have to do anything as a result of my 
> changes.
> 
> However, if you wanted, you could use my changes to get a more efficient 
> Jacobian function, or to avoid computing variables that you don't need 
> (if you define VARIABLES_FOR_RATES_ONLY, the code will not evaluate 
> variables which do not directly affect the time evolution of your model. 
> When computing the Jacobian, this is obviously a good idea, as it saves 
> computing variables which will just be thrown away unused anyway. You 
> might also want to do this for intermediate steps of the evaluation if 
> you are going to look at the final result). The CIS utilises this by 
> using variableCodeFragment twice, once with VARIABLES_FOR_RATES_ONLY 
> defined, and once with it not defined.
> 
> Best regards,
> Andrew
> 
> _______________________________________________
> cellml-discussion mailing list
> [email protected]
> http://www.cellml.org/mailman/listinfo/cellml-discussion

-- 
David Nickerson, PhD
Research Fellow
Division of Bioengineering
Faculty of Engineering
National University of Singapore
Email: [EMAIL PROTECTED]
_______________________________________________
cellml-discussion mailing list
[email protected]
http://www.cellml.org/mailman/listinfo/cellml-discussion

Reply via email to