crossprodR Documentation

Matrix Crossproduct

Description

Given matrices 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).

Usage

## S4 method for signature 'fm,ANY'
crossprod(x, y = NULL)

## S4 method for signature 'fm,ANY'
tcrossprod(x, y = NULL)

Arguments

x, y

numeric matrices (or vectors): y = NULL is taken to be the same matrix as x. Vectors are promoted to single-column or single-row matrices, depending on the context.

lazy

a logical value, indicating to perform the computation lazily.

Value

a double matrix

Examples

mat <- fm.runif.matrix(100, 10)
crossprod(mat)
tcrossprod(mat)