| bigmatrix-operations | R Documentation |
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.
## S4 method for signature 'big.matrix,big.matrix'
x %*% y
## S4 method for signature 'matrix,big.matrix'
x %*% y
## S4 method for signature 'big.matrix,matrix'
x %*% y
## S4 method for signature 'big.matrix,big.matrix'
Arith(e1, e2)
## S4 method for signature 'big.matrix,matrix'
Arith(e1, e2)
## S4 method for signature 'matrix,big.matrix'
Arith(e1, e2)
## S4 method for signature 'numeric,big.matrix'
Arith(e1, e2)
## S4 method for signature 'big.matrix,numeric'
Arith(e1, e2)
x, y |
Matrix operands supplied either as |
e1, e2 |
Numeric operands, which may be |
Matrix multiplications dispatch to bigalgebra::dgemm(), mixed
arithmetic on matrices relies on bigalgebra::daxpy(), and
scalar/matrix combinations use bigalgebra::dadd() when appropriate.
bigmemory::big.matrix(), bigalgebra::dgemm(),
bigalgebra::daxpy(), bigalgebra::dadd()
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
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.