qrDecomposition
Performs QR decomposition on a sparse matrix.
QR decomposition factors a matrix A into the product of an orthogonal matrix Q and an upper triangular matrix R, such that A = QR.
This implementation uses the Gram-Schmidt process adapted for sparse matrices. It's more straightforward than Householder reflections and easier to debug.
This implementation is optimized for sparse matrices by:
Efficiently extracting columns from the sparse matrix
Avoiding unnecessary operations on zero elements
Returning sparse matrices as the result
Return
A Pair of matrices (Q, R) representing the orthogonal and upper triangular matrices.
Parameters
matrix
The sparse matrix to decompose.