chol.HDF5Matrix: Cholesky decomposition of a symmetric positive-definite...

View source: R/S3_factorizations.R

chol.HDF5MatrixR Documentation

Cholesky decomposition of a symmetric positive-definite HDF5Matrix

Description

Computes the lower-triangular Cholesky factor L such that A = L L'. The input matrix must be square and symmetric positive-definite.

Usage

## S3 method for class 'HDF5Matrix'
chol(
  x,
  full_matrix = FALSE,
  overwrite = FALSE,
  threads = -1L,
  block_size = NULL,
  compression = NULL,
  ...
)

Arguments

x

An HDF5Matrix.

full_matrix

Logical. Return full symmetric matrix (L + L'). Default FALSE.

overwrite

Logical. Overwrite existing result. Default FALSE.

threads

Integer. OpenMP threads (-1 = auto).

block_size

Integer or NULL. Elements per block. NULL = auto.

compression

Integer (0-9) or NULL. gzip compression level for the result dataset. NULL uses the global option set by hdf5matrix_options (default 6). Use 0 to disable compression (faster for benchmarks).

...

Ignored (for S3 compatibility).

Value

HDF5Matrix containing the Cholesky factor L.

Examples



tmp <- tempfile(fileext = ".h5")

X  <- hdf5_create_matrix(tmp, "data/X", data = matrix(rnorm(10000), 100, 100))

# Create a symmetric positive-definite matrix: A = t(X) %*% X
X  <- hdf5_matrix(tmp, "data/X")
AtA <- crossprod(X)              # HDF5Matrix, square SPD
L   <- chol(AtA)

hdf5_close_all()
unlink(tmp)




BigDataStatMeth documentation built on May 15, 2026, 1:07 a.m.