raw.symbol: Locate a symbol

View source: R/c-samplers.R

raw.symbolR Documentation

Locate a symbol

Description

Call R_FindSymbol and return function pointer in a raw vector

Usage

raw.symbol(symbol)

Arguments

symbol

a length one character vector containing a C symbol

Details

This function calls R_FindSymbol(symbol, "", NULL) in C. If the symbol is found, the function pointer is returned as a raw vector. If not, an error is thrown.

This is intended to be used to fill in context objects for samplers and distributions implemented in C. Exposing this interface in R prevents the need for extra C glue that does nothing except call R_FindSymbol.

Value

A raw vector containing a function pointer.

See Also

wrap.c.sampler, make.c.dist, “R/C Glue in SamplerCompare” (vignette)


SamplerCompare documentation built on April 24, 2023, 9:09 a.m.