Matrix cross-product x %*% t(y), or x %*% t(x) when y is omitted. Equivalent to R's tcrossprod().
x %*% t(y)
x %*% t(x)
y
tcrossprod()
A vector argument is treated as a one-column matrix.
A matrix (array of rows) or a vector.
Optional
A matrix or a vector with the same number of columns as x. Defaults to x.
x
The product as an array of rows (nrow(x) x nrow(y)).
nrow(x)
nrow(y)
tcrossprod([[1, 2], [3, 4]]); // [[5, 11], [11, 25]] Copy
tcrossprod([[1, 2], [3, 4]]); // [[5, 11], [11, 25]]
Matrix cross-product
x %*% t(y), orx %*% t(x)whenyis omitted. Equivalent to R'stcrossprod().A vector argument is treated as a one-column matrix.