LINEAR_ALGEBRA

1 Description

Computes the QR decomposition (also called QR factorization) of a matrix A into a product A = QR where Q is an orthogonal matrix and R is an upper triangular matrix. This function operates on in-memory matrices.

2 Usage

bdQR(X, thin = NULL, block_size = NULL, threads = NULL)

3 Arguments

Parameter Description
X A real matrix or vector to be decomposed
thin Logical. If TRUE, returns the reduced (thin) Q matrix. If FALSE (default), returns the full Q matrix. The thin decomposition is more memory efficient.
block_size Integer. Optional block size for blocked computation. Larger blocks may improve performance but require more memory.
threads Integer. Optional number of threads for parallel computation. If NULL, uses all available threads.

4 Value

A list containing: * Q: The orthogonal matrix Q * R: The upper triangular matrix R

5 Details

The QR decomposition is a fundamental matrix factorization that decomposes a matrix into an orthogonal matrix Q and an upper triangular matrix R. This implementation: - Supports both thin and full QR decomposition - Can utilize parallel computation for better performance - Handles both matrix and vector inputs

6 Examples

Code
# Create a random 100x50 matrix
X <- matrix(rnorm(5000), 100, 50)

# Compute thin QR decomposition
result <- bdQR(X, thin = TRUE)

# Verify the decomposition
# Should be approximately zero
max(abs(X - result$Q %*% result$R))

7 See Also

bdQR_hdf5 for QR decomposition of HDF5-stored matrices