Learn R Programming

pomp (version 1.4.1.1)

Csnippet: C code snippets for accelerating computations

Description

For including snippets of C code in pomp objects.

Usage

Csnippet(text)

Arguments

text
character; a snippet of C code.

Value

  • An object of class Csnippet.

Using C snippets to accelerate computations

From version 0.50, pomp provides a facility whereby users can define their model's components using inline C code. Furnishing one or more Csnippets as arguments to the pomp constructor causes them to be written to a C file stored in the Rsession's temporary directory, which is then compiled (via R CMD SHLIB) into a dynamically loadable shared object file. This is then loaded as needed.

Note to Windows and Mac users: By default, your Rinstallation may not support R CMD SHLIB. The package website contains installation instructions that show how to enable this powerful feature of R.

In writing a Csnippet one must bear in mind both the goal of the snippet, i.e., what computation it is intended to perform, and the context in which it will be executed. Details of both of these are given below in the form of rules governing the use of Csnippets. Illustrative examples are given in the tutorials on the http://kingaa.github.io/pomp{package website}.