setupOutputs: Explicitly declare objects created in setup code to be...

View source: R/nimbleFunction_nodeFunctionNew.R

setupOutputsR Documentation

Explicitly declare objects created in setup code to be preserved and compiled as member data


Normally a nimbleFunction determines what objects from setup code need to be preserved for run code or other member functions. setupOutputs allows explicit declaration for cases when an object created in setup code is not used in member functions.



An arbitrary set of names


Normally any object created in setup whose name appears in run or another member function is included in the saved results of setup code. When the nimbleFunction is compiled, such objects will become member data of the resulting C++ class. If it is desired to force an object to become member data even if it does not appear in a member function, declare it using setupOutputs. E.g., setupOutputs(a, b) declares that a and b should be preserved.

The setupOutputs line will be removed from the setup code. It is really a marker during nimbleFunction creation of what should be preserved.

nimble documentation built on March 18, 2022, 8:03 p.m.