Skip to contents

rxOptExpr() and the rxode2.fullOpt code generation treat user R functions, rxFun() C functions and C functions from other packages as pure: the same arguments give the same value with no side effects, so repeated calls are evaluated once and a call whose result is unused may be left out, and a line whose arguments hold for the subject is computed once per subject (options(rxode2.subjConst)). Random draws, simeta() and simeps() are always impure; register any other function that draws random numbers, keeps state or has side effects so every call is kept. Registration changes the generated code, so models compiled afterwards are recompiled.

Usage

rxImpureFun(name)

rxRmImpureFun(name)

Arguments

name

character vector of function names, as written in the model

Value

rxImpureFun() and rxRmImpureFun() invisibly return the registered names; rxImpureFun() without name returns them visibly

Author

Matthew L. Fidler

Examples

rxImpureFun("myCounter")
rxImpureFun()
#> [1] "myCounter"
rxRmImpureFun("myCounter")