generate: Code Generator

generateR Documentation

Code Generator

Description

This is a low-level method to translate the ODE-model specification into a function that computes process rates and the state variables derivatives (either in R or Fortran). You probably want to use the high-level method compile instead, which uses generate internally.

Arguments

lang

Character string to select the language of the generated source code. Currently either 'f95' (for Fortran) or 'r' (for R).

name

Name for the generated function (character string). It should start with a letter, optionally followed by letters, numbers, or underscores.

Value

The generated source code as a string. Must be written to disk, e.g. using write, prior to compilation.

Note

Details of this low-level method may change in the future.

Author(s)

david.kneis@tu-dresden.de

See Also

See other methods of the rodeo-class, especially compile which internally uses this method.

Examples

data(vars, pars, funs, pros, stoi)
model <- rodeo$new(vars, pars, funs, pros, stoi, dim=c(1))
fortranCode <- model$generate(lang="f95")
## Not run: 
write(fortranCode, file="")

## End(Not run)

dkneis/rodeo documentation built on Jan. 4, 2024, 2:18 p.m.