xptr_create {itp}R Documentation

Create an external pointer to a C++ function

Description

This function is used in the itp package to create external pointers to the C++ functions used as examples to illustrate the use of the function itp. These pointers are passed as the argument f to itp. To create their own examples the user will need to create their own C++ function(s) and a function that is similar to xptr_create.

Usage

xptr_create(fstr)

Arguments

fstr

A string indicating the C++ function required.

Details

See the vignette Overview of the itp package and the file user_fns.cpp for information.

The example C++ functions available in itp are: "wiki", "lambert", "trig1", "poly3", "linear", "warsaw" and staircase.

Value

The external pointer.

See Also

xptr_eval for calling a C++ function using an external pointer.

Examples

lambert_ptr <- xptr_create("lambert")
res <- itp(lambert_ptr, c(-1, 1))

[Package itp version 1.2.1 Index]