| crossprod | R Documentation |
S3 generic for crossprod(). Dispatches to
crossprod.HDF5Matrix for HDF5Matrix objects,
and to base::crossprod() for all others.
crossprod(x, y = NULL, ...)
## S3 method for class 'HDF5Matrix'
crossprod(x, y = NULL, outgroup = NULL, outdataset = NULL, ...)
x |
An |
y |
An |
... |
Ignored. |
outgroup |
Character or |
outdataset |
Character or |
Computes t(x) \times y (or t(x) \times x when y = NULL).
Uses the dedicated BigDataStatMeth block-wise cross-product algorithm, which
is more efficient than explicitly computing t(x) %*% y.
Performance settings:
This method uses global options set via hdf5matrix_options.
Symmetric optimization:
When y = NULL or y refers to the same dataset as x,
the symmetric optimisation (bisSymetric = TRUE) is applied automatically,
providing significant speedup.
Result of the cross product.
A new HDF5Matrix pointing to the result dataset.
hdf5matrix_options for global performance settings
fn <- tempfile(fileext = ".h5")
X <- hdf5_create_matrix(fn, "INPUT/X", data = matrix(rnorm(60), 6, 10))
Y <- hdf5_create_matrix(fn, "INPUT/Y", data = matrix(rnorm(60), 6, 10))
# t(X) %*% X → stored in OUTPUT/CrossProd_X
C1 <- crossprod(X)
dim(C1)
# t(X) %*% Y → stored in OUTPUT/CrossProd_X_x_Y
C2 <- crossprod(X, Y)
# Custom output location
C3 <- crossprod(X, outgroup = "RESULTS", outdataset = "my_crossprod")
hdf5_close_all()
unlink(fn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.