crossprod {slam}R Documentation

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.

Details

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

Value

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

Note

If y (or x) contains any of the special values NA, NaN, or Inf (if y = NULL) then x is coerced to matrix and the computation is delegated to tcrossprod.

Author(s)

Christian Buchta

See Also

crossprod for dense-on-dense computations.

Examples

## 
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)

[Package slam version 0.1-23 Index]