XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ dgeqp3()

void dgeqp3 ( int  m,
int  n,
int  lda,
double  a[],
int  jpvt[],
double  tau[],
double  work[],
int  lwork,
int *  info 
)

QR factorization with pivoting

Purpose
This routine computes a QR factorization with column pivoting of a matrix A:
A * P = Q * R
using Level 3 BLAS.
Parameters
[in]mNumber of rows of the matrix A. (m >= 0)
[in]nNumber of columns of the matrix A. (n >= 0)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, m))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] m x n matrix A.
[out] The upper triangle of the array contains the min(m, n) x n upper trapezoidal matrix R; the elements below the diagonal, together with the array tau[], represent the orthogonal matrix Q as a product of min(m, n) elementary reflectors.
[in,out]jpvt[]Array jpvt[ljpvt] (ljpvt >= n)
[in] If jpvt[j-1] != 0, the j-th column of A is permuted to the front of A*P (a leading column); if jpvt[j-1] = 0, the j-th column of A is a free column.
[out] If jpvt[j-1] = k, then the j-th column of A*P was the the k-th column of A.
[out]tau[]Array tau[ltau] (ltau >= min(m, n))
The scalar factors of the elementary reflectors.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork >= 3*n + 1)
For optimal performance lwork >= 2*n + (n + 1)*nb, where nb is the optimal blocksize.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0].
[out]info= 0: Successful exit
= -1: The argument m had an illegal value (m < 0)
= -2: The argument n had an illegal value (n < 0)
= -3: The argument lda had an illegal value (lda < max(1, m))
= -8: The argument lwork had an illegal value (lwork too small)
Reference
LAPACK