Learn R Programming

slam (version 0.1-21)

crossprod: Matrix Crossproduct

Description

Compute the matrix cross-product of a sparse and dense matrix.

Usage

tcrossprod_simple_triplet_matrix(x, y = NULL)

Arguments

x
a matrix in simple_triplet_matrix-form.
y
a numeric matrix.

Value

  • A double matrix, with appropriate dimnames taken from x and y.

Details

Provides fast computation of x %*% t(x) and x %*% t(y) (tcrossprod).

See Also

crossprod for dense-on-dense computations.

Examples

Run this code
## 
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)

Run the code above in your browser using DataLab