?orgqr
?orgqr
Generates the real orthogonal matrix Q of the QR factorization formed by
?geqrf
. Syntax
lapack_int
LAPACKE_sorgqr
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
lapack_int
k
,
float
*
a
,
lapack_int
lda
,
const
float
*
tau
);
lapack_int
LAPACKE_dorgqr
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
lapack_int
k
,
double
*
a
,
lapack_int
lda
,
const
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_?orgqr(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_?orgqr(matrix_layout, m, p, p, a, lda)
To compute the matrix of the
Q
k
QR
factorization of leading k
columns of the matrix A
: LAPACKE_?orgqr(matrix_layout, m, m, k, a, lda, tau)
To compute the leading (which form an orthonormal basis in the space spanned by leading
k
columns of Q
k
k
columns of the matrix A
): LAPACKE_?orgqr(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 orthogonal 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 bysgeqrf/dgeqrforsgeqpf/dgeqpf.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
- Overwritten bynleading columns of them-by-morthogonal matrixQ.
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
Q
differs from an exactly orthogonal matrix by a matrix E
such that ||
where E
||2
= O
(ε
)|*|A
||2
ε
is the machine precision.The total number of floating-point operations is approximately
4*
. m
*n
*k
- 2*(m
+ n
)*k
2
+ (4/3)*k
3
If , the number is approximately
n
= k
(2/3)*
.n
2
*(3m
- n
)The complex counterpart of this routine is ungqr.