Learn R Programming

rodeo (version 0.7.6)

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.

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.

See Also

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

Examples

Run this code
# NOT RUN {
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="")
# }

Run the code above in your browser using DataLab