compile: Compile Linear Algebra Code to C++

Description Usage Arguments Examples

View source: R/armacmp.R

Description

Compile Linear Algebra Code to C++

Usage

1
compile(fun, verbose = FALSE)

Arguments

fun

a function

verbose

optional logical, print out compiler information

This function always compiles functions. Every function needs to have a return statement with an optional type argument. All input parameters are by default of type double matrix. Type inference is tried to be done, but sometimes it is helpful to add type annotation.

Take a look at function reference vignette for more information.

Examples

1
2
3
4
5
6
7
## Not run: 
trans <- compile(function(X) {
  return(t(X))
})
trans(matrix(1:10))

## End(Not run)

dirkschumacher/armacmp documentation built on Oct. 22, 2021, 7:10 p.m.