supportCppAccess {beachmat}R Documentation

Support C++ access

Description

Does the current matrix class support C++ access?

Usage

## S4 method for signature 'ANY'
supportCppAccess(x)

Arguments

x

A matrix-like object.

Details

This function is called by the beachmat C++ API upon encountering an unknown matrix type. If it returns TRUE, we assume that the package used to define the class of x also contains registered C++ functions to access rows or columns of x. This allows beachmat to use those C++ functions to directly access values of x, rather than relying on block realization of an unknown matrix.

If you need to use this function, you almost certainly need to read the vignette on “Extending beachmat”.

Value

A logical scalar specifying whether C++ access is supported for x.

Author(s)

Aaron Lun

Examples

library(Matrix)
Y <- Matrix(0, 10, 10)    
supportCppAccess(Y)

# Note that certain matrix types are always supported
# by beachmat but still return FALSE.
X <- matrix(0, 10, 10)
supportCppAccess(X)

[Package beachmat version 1.4.0 Index]