bdQR_hdf5

HDF5_ALGEBRA

1 Description

Computes the QR decomposition of a matrix stored in an HDF5 file, factoring it into a product A = QR where Q is an orthogonal matrix and R is an upper triangular matrix. Results are stored back in the HDF5 file.

2 Usage

bdQR_hdf5(filename, group, dataset, outgroup = NULL, outdataset = NULL, thin = NULL, block_size = NULL, overwrite = NULL, threads = NULL)

3 Arguments

Parameter Description
filename Character string. Path to the HDF5 file containing the input matrix.
group Character string. Path to the group containing the input dataset.
dataset Character string. Name of the input dataset to decompose.
outgroup Character string. Optional output group path where results will be stored. If not provided, results are stored in <input_group>/QRDec.
outdataset Character string. Optional base name for output datasets. Results will be stored as Q.'outdataset' and R.'outdataset'.
thin Logical. If TRUE, computes the reduced (thin) QR decomposition. If FALSE (default), computes the full decomposition.
block_size Integer. Optional block size for blocked computation.
overwrite Logical. If TRUE, allows overwriting existing datasets. Default is FALSE.
threads Integer. Optional number of threads for parallel computation. If NULL, uses all available threads.

4 Value

List with components. If an error occurs, all string values are returned as empty strings (““):

  • fn: Character string with the HDF5 filename
  • ds_Q: Character string with the full dataset path to the Q matrix (orthogonal matrix). Results are written to the HDF5 file as “Q.’outdataset’” within the specified group
  • ds_R: Character string with the full dataset path to the R matrix (upper triangular matrix). Results are written to the HDF5 file as “R.’outdataset’” within the specified group

5 Details

This function performs QR decomposition on large matrices stored in HDF5 format, which is particularly useful for matrices too large to fit in memory. Features include: - Support for both thin and full QR decomposition - Blocked computation for improved performance - Parallel processing capabilities - Flexible output location specification - Optional overwriting of existing datasets

6 Examples

Code
# Create a sample HDF5 file with a matrix
library(rhdf5)
A <- matrix(rnorm(1000), 100, 10)
h5createFile("example.h5")
h5write(A, "example.h5", "mygroup/mymatrix")

# Compute QR decomposition
bdQR_hdf5("example.h5", "mygroup", "mymatrix",
          outgroup = "mygroup/results",
          outdataset = "qr_result",
          thin = TRUE)

7 See Also

bdQR for QR decomposition of in-memory matrices