Learn R Programming

rodeo (version 0.8.2)

generate: 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.

Value

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

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.

See Also

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

Examples

Run this code
data(vars, pars, funs, pros, stoi)
model <- rodeo$new(vars, pars, funs, pros, stoi, dim=c(1))
fortranCode <- model$generate(lang="f95")
if (FALSE) {
write(fortranCode, file="")
}

Run the code above in your browser using DataLab