?ungqr
?ungqr
Generates the complex unitary matrix Q of the QR factorization formed by
?geqrf
. Syntax
lapack_int
LAPACKE_cungqr
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
lapack_int
k
,
lapack_complex_float
*
a
,
lapack_int
lda
,
const
lapack_complex_float
*
tau
);
lapack_int
LAPACKE_zungqr
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
lapack_int
k
,
lapack_complex_double
*
a
,
lapack_int
lda
,
const
lapack_complex_double
*
tau
);
Include Files
- mkl.h
Description
Usually . To compute the whole matrix
Q
is determined from the QR
factorization of an m
by p
matrix A
with m
≥
p
Q
, use: LAPACKE_?ungqr(matrix_layout, m, m, p, a, lda, tau)
To compute the leading
p
columns of Q
(which form an orthonormal basis in the space spanned by the columns of A
): LAPACKE_?ungqr(matrix_layout, m, p, p, a, lda, tau)
To compute the matrix of the
Q
k
QR
factorization of the leading k
columns of the matrix A
: LAPACKE_?ungqr(matrix_layout, m, m, k, a, lda, tau)
To compute the leading (which form an orthonormal basis in the space spanned by the leading
k
columns of Q
k
k
columns of the matrix A
): LAPACKE_?ungqr(matrix_layout, m, k, k, a, lda, tau)
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- m
- The order of the unitary matrixQ().m≥0
- n
- The number of columns ofQto be computed(0≤).n≤m
- k
- The number of elementary reflectors whose product defines the matrixQ(0≤k≤n).
- a,tau
- Arrays:aandtauare the arrays returned bycgeqrf/zgeqrforcgeqpf/zgeqpf.The size ofais max(1,lda*n) for column major layout and max(1,lda*m) for row major layout .The size oftaumust be at least max(1,k).
- lda
- The leading dimension ofa; at least max(1,m)for column major layout and max(1,.n) for row major layout
Output Parameters
- a
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , the
info
= -i
i
-th parameter had an illegal value.Application Notes
The computed is the machine precision.
Q
differs from an exactly unitary matrix by a matrix E
such that ||
, where E
||2
= O
(ε
)*||A
||2
ε
The total number of floating-point operations is approximately
16*
. m
*n
*k
- 8*(m
+ n
)*k
2
+ (16/3)*k
3
If , the number is approximately
n
= k
(8/3)*
.n
2
*(3m
- n
)The real counterpart of this routine is orgqr.