crossprod: Matrix Crossproduct

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

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

Usage

1
2
3
4

Arguments

x, y

a matrix in simple_triplet_matrix-form and/or a dense matrix, where one must be of the form indicated by the suffix.

Details

Function tcrossprod_simple_triplet_matrix implements fast computation of x %*% t(x) and x %*% t(y) (tcrossprod). The remaining functions are (optimized) wrappers.

Value

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

Note

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

Author(s)

Christian Buchta

See Also

crossprod for dense-on-dense computations.

Examples

1
2
3
4
5
6
7
8
9

Example output

     [,1] [,2]
[1,]    1    2
[2,]    0    1
[3,]    0    0
     [,1] [,2] [,3]
[1,]    5    2    0
[2,]    2    1    0
[3,]    0    0    0
     [,1] [,2] [,3]
[1,]    5    2    0
[2,]    2    1    0
[3,]    0    0    0
     [,1] [,2]
[1,]    2    0

slam documentation built on Jan. 8, 2022, 5:08 p.m.

Related to crossprod in slam...