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

◆ zungqr()

void zungqr ( int  m,
int  n,
int  k,
int  lda,
doublecomplex  a[],
doublecomplex  tau[],
doublecomplex  work[],
int  lwork,
int *  info 
)

Generates matrix Q of QR factorization of a complex matrix

Purpose
This routine generates an m x n complex matrix Q with orthonormal columns, which is defined as the first n columns of a product of k elementary reflectors of order m
Q = H(1) H(2) . . . H(k)
as returned by zgeqrf.
Parameters
[in]mNumber of rows of the matrix A. (m >= 0)
[in]nNumber of columns of the matrix A. (m >= n >= 0) (If n = 0, returns without computation)
[in]kNumber of elementary reflectors whose product defines the matrix Q. (n >= k >= 0)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, m))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] The i-th column must contain the vector which defines the elementary reflector H(i), for i = 1, 2, ..., k, as returned by zgeqrf in the first k columns of its array argument a[][].
[out] m x n matrix Q.
[in]tau[]Array tau[ltau] (ltau >= k)
The scalar factors of the elementary reflectors H(i) as returned by zgeqrf.
[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 >= max(1, n))
For optimal performance lwork >= n*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 or n > m)
= -3: The argument k had an illegal value (k < 0 or k > n)
= -4: The argument lda had an illegal value (lda < max(1, m))
= -8: The argument lwork had an illegal value (lwork too small)
Reference
LAPACK