crossprod | R Documentation |
Compute the matrix cross-product of a sparse and a dense or sparse matrix.
tcrossprod_simple_triplet_matrix(x, y = NULL)
##
crossprod_simple_triplet_matrix(x, y = NULL)
matprod_simple_triplet_matrix(x, y)
x , y |
a matrix in |
Function tcrossprod_simple_triplet_matrix
implements fast computation
of x %*% t(x)
and x %*% t(y)
(tcrossprod
). The
remaining functions are (optimized) wrappers.
A double matrix, with appropriate dimnames
taken from x
and y
.
The computation is delegated to tcrossprod
if y
(or x
if y == NULL
) contains any of the special values NA
,
NaN
, or Inf
.
Christian Buchta
crossprod
for dense-on-dense computations.
##
x <- matrix(c(1, 0, 0, 2, 1, 0), nrow = 3)
x
s <- as.simple_triplet_matrix(x)
tcrossprod_simple_triplet_matrix(s, x)
##
tcrossprod_simple_triplet_matrix(s)
##
tcrossprod_simple_triplet_matrix(s[1L, ], s[2:3, ])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.