QR Factorization#
GEQRF (GEneral QR Factorization) function computes batched QR factorization of a general matrix:
using Householder reflection transformations, where:
\(A\) is a batched \(M \times N\) matrix, with leading dimension \(\mathrm{lda} \geq M\) if matrix
Ais in column-major layout, or \(\mathrm{lda} \geq N\) if matrixAis row-major,\(Q\) is a unitary \(M \times M\) matrix, and
\(R\) is an upper triangular matrix if \(M \geq N\), or upper trapezoidal matrix if \(M < N\).
cuSolverDx geqrf device functions are (see Execution Methods):
__device__ void execute(data_type* A, data_type* tau);
// with the runtime lda
__device__ void execute(data_type* A, const unsigned int lda, data_type* tau);
After the function, the upper triangular or upper trapezoidal part of input A, including diagonal elements, is replaced by the matrix R.
Matrix \(Q\) is not explicitly formed. The elements below the diagonal of A, with the array tau, represent the matrix \(Q\) as a product of \(\min(M, N)\) Householder vectors:
Each Householder vector has the form \(H(i) = I - \mathrm{tau}[i] v v^H\), where:
tauis an array of size \(\min(M, N)\) for each batch, andvis a vector of sizeMfor each batch, withv[0 : i-1] = 0,v[i] = 1, andv[i+1 : M]is stored on exit inA[i+1 : M, i].
The functions support A being either column- or row-major memory layout, see Arrangement operator.