Learn R Programming

bigPLScox (version 0.8.1)

bigmatrix-operations: Matrix and arithmetic operations for big.matrix objects

Description

These methods extend the base matrix multiplication operator (%*%) and the group generic Arithmetic so that big.matrix objects can interoperate with base R matrices and numeric scalars using the high-performance routines provided by bigalgebra.

Usage

# S4 method for big.matrix,big.matrix
%*%(x, y)

# S4 method for matrix,big.matrix %*%(x, y)

# S4 method for big.matrix,matrix %*%(x, y)

# S4 method for big.matrix,big.matrix Arith(e1, e2)

# S4 method for big.matrix,matrix Arith(e1, e2)

# S4 method for matrix,big.matrix Arith(e1, e2)

# S4 method for numeric,big.matrix Arith(e1, e2)

# S4 method for big.matrix,numeric Arith(e1, e2)

Arguments

x, y

Matrix operands supplied either as big.matrix instances or base R matrices, depending on the method signature.

e1, e2

Numeric operands, which may be big.matrix objects, base R matrices, or numeric scalars depending on the method signature.

Details

Matrix multiplications dispatch to bigalgebra::dgemm(), mixed arithmetic on matrices relies on bigalgebra::daxpy(), and scalar/matrix combinations use bigalgebra::dadd() when appropriate.

See Also

bigmemory::big.matrix(), bigalgebra::dgemm(), bigalgebra::daxpy(), bigalgebra::dadd()

Examples

Run this code
if (requireNamespace("bigmemory", quietly = TRUE) &&
    requireNamespace("bigalgebra", quietly = TRUE)) {
  x <- bigmemory::big.matrix(2, 2, init = 1)
  y <- bigmemory::big.matrix(2, 2, init = 2)
  x %*% y
  x + y
  x * 3
}

Run the code above in your browser using DataLab