
Last chance! 50% off unlimited learning
Sale ends in
x
and y
as arguments, return a matrix
cross-product.
This is formally equivalent to (but usually slightly faster than) the call t(x) %*% y
(crossprod) or x %*% t(y)
(tcrossprod).
crossprod(x, y)
"crossprod"(x, y)
"crossprod"(x, y)
(signature(x = "dgeMatrix", y = "missing")
: Calls CUBLAS function cublasDsyrk
for GPU enabled
systems and PLASMA_dsyrk
for multi-core systems. Library settings also affect choice between GPU and CPU. If
y = NULL
, then it is taken to be the same matrix as x
.(signature(x = "dgeMatrix", y = "dgeMatrix")
: Calls MAGMA function magma_dgemm
for GPU enabled
systems and PLASMA_dgemm
for multi-core systems. Library settings also affect choice between GPU and CPU.(signature(x = "dgeMatrix", y = "Matrix")
: Calls MAGMA function magma_dgemm
for GPU enabled
systems and PLASMA_dgemm
for multi-core systems. Library settings also affect choice between GPU and CPU.(signature(x = "dgeMatrix", y = "numeric")
: Calls MAGMA function magma_dgemm
for GPU enabled
systems and PLASMA_dgemm
for multi-core systems. Library settings also affect choice between GPU and CPU. y
is
coerced to a base::matrix
(signature(x = "dgeMatrix", y = "matrix")
: Calls MAGMA function magma_dgemm
for GPU enabled
systems and PLASMA_dgemm
for multi-core systems. Library settings also affect choice between GPU and CPU.(signature(x = "dtrMatrix", y = "dtrMatrix")
: Calls the CUBLAS function cublasDtrmm
for GPU enabled
systems and PLASMA_dtrmm
for multi-core systems. Library settings also affect choice between GPU and CPU.(signature(x = "dtrMatrix", y = "ddenseMatrix")
: y
inherits from virtual class ddenseMatrix
Calls CUBLAS function magma_dgemm
for GPU enabled systems and PLASMA_dgemm
for multi-core systems. Library settings also affect choice between GPU and CPU.(signature(x = "dtrMatrix", y = "matrix")
: Calls CUBLAS function cublasDtrmm
for GPU enabled
systems and PLASMA_dtrmm
for multi-core systems. Library settings also affect choice between GPU and CPU.m <- matrix(0, 400, 500)
set.seed(12)
m[runif(314, 0, length(m))] <- 1
mm <- as(m, "dgeMatrix")
object.size(m) / object.size(mm) # smaller by a factor of > 200
## tcrossprod() is very fast:
system.time(tCmm <- tcrossprod(mm))
system.time(cm <- crossprod(t(m)))
system.time(cm. <- tcrossprod(m))
stopifnot(cm == as(tCmm, "matrix"))
Run the code above in your browser using DataLab