[R-sig-dyn-mod] defining and passing dynamically allocated arrays in C with deSolve

Walker, Martin m.walker06 at imperial.ac.uk
Thu Mar 12 15:24:16 CET 2015


Dear mailing list,

I am using the deSolve C interface to write a model describing the dynamics of an infectious disease. I have many arrays in the model whose size and contents depends on a small number of parameter values which are declared at runtime.  What I am trying to do is initialize and pass these arrays to the derivative function rather like other parameter values, but with the trick that the size and contents of the arrays is only known once the parameters have been declared at runtime.  As it stands, I am defining my arrays within the derivative function which seems rather inefficient since the arrays are constant through time and yet will presumably be re-declared at every single time step.

Any thoughts on this would be greatly appreciated!

Kind regards,

Martin

********************
Dr Martin Walker
Research Associate
Imperial College London



	[[alternative HTML version deleted]]



More information about the R-sig-dynamic-models mailing list