Create an R stub function for a sampler implemented in C.
A one-element character vector containing the symbol of the C sampler function.
An arbitrary R object to be passed to the sampler function.
This function is intended to allow
compare.samplers to be able to invoke sampler
functions written in C. It wraps a C sampler function in an
R function implementing the standard sampler interface.
The function named by
sampler.symbol is expected to have
the function prototype:
This is defined as a type
sampler_context is the same as the R object
sampler.context passed to
describes the distribution to be sampled.
tuning are as described in
should be considered read-only.
X_out is a column-major
matrix to be filled in with the generated sample; it has dimension
ds->ndim * sample_size.
The vignette “R/C Glue in SamplerCompare” covers this interface in greater detail.
An R function implementing the interface described in
“R/C Glue in SamplerCompare” (vignette)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.