PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zungqr (f08at)
Purpose
nag_lapack_zungqr (f08at) generates all or part of the complex unitary matrix
from a
factorization computed by
nag_lapack_zgeqrf (f08as),
nag_lapack_zgeqpf (f08bs) or
nag_lapack_zgeqp3 (f08bt).
Syntax
[
a,
info] = nag_lapack_zungqr(
a,
tau, 'm',
m, 'n',
n, 'k',
k)
Description
nag_lapack_zungqr (f08at) is intended to be used after a call to
nag_lapack_zgeqrf (f08as),
nag_lapack_zgeqpf (f08bs) or
nag_lapack_zgeqp3 (f08bt), which perform a
factorization of a complex matrix
. The unitary matrix
is represented as a product of elementary reflectors.
This function may be used to generate explicitly as a square matrix, or to form only its leading columns.
Usually
is determined from the
factorization of an
by
matrix
with
. The whole of
may be computed by:
[a, info] = f08at(a, tau);
(note that the array
a must have
columns) or its leading
columns by:
[a, info] = f08at(a(1:p,:), tau);
The columns of
returned by the last call form an orthonormal basis for the space spanned by the columns of
; thus
nag_lapack_zgeqrf (f08as) followed by
nag_lapack_zungqr (f08at) can be used to orthogonalize the columns of
.
The information returned by the
factorization functions also yields the
factorization of the leading
columns of
, where
. The unitary matrix arising from this factorization can be computed by:
[a, info] = f08at(a, tau);
or its leading
columns by:
[a, info] = f08at(a(:,1:k), tau);
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– complex array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
Details of the vectors which define the elementary reflectors, as returned by
nag_lapack_zgeqrf (f08as),
nag_lapack_zgeqpf (f08bs) or
nag_lapack_zgeqp3 (f08bt).
- 2:
– complex array
-
The dimension of the array
tau
must be at least
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, the order of the unitary matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
a.
, the number of columns of the matrix .
Constraint:
.
- 3:
– int64int32nag_int scalar
-
Default:
the dimension of the array
tau.
, the number of elementary reflectors whose product defines the matrix .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
The by matrix .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
m, 2:
n, 3:
k, 4:
a, 5:
lda, 6:
tau, 7:
work, 8:
lwork, 9:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
Accuracy
The computed matrix
differs from an exactly unitary matrix by a matrix
such that
where
is the
machine precision.
Further Comments
The total number of real floating-point operations is approximately ; when , the number is approximately .
The real analogue of this function is
nag_lapack_dorgqr (f08af).
Example
This example forms the leading
columns of the unitary matrix
from the
factorization of the matrix
, where
The columns of
form an orthonormal basis for the space spanned by the columns of
.
Open in the MATLAB editor:
f08at_example
function f08at_example
fprintf('f08at example results\n\n');
a = [ 0.96 - 0.81i, -0.03 + 0.96i, -0.91 + 2.06i, -0.05 + 0.41i;
-0.98 + 1.98i, -1.20 + 0.19i, -0.66 + 0.42i, -0.81 + 0.56i;
0.62 - 0.46i, 1.01 + 0.02i, 0.63 - 0.17i, -1.11 + 0.60i;
-0.37 + 0.38i, 0.19 - 0.54i, -0.98 - 0.36i, 0.22 - 0.20i;
0.83 + 0.51i, 0.20 + 0.01i, -0.17 - 0.46i, 1.47 + 1.59i;
1.08 - 0.28i, 0.20 - 0.12i, -0.07 + 1.23i, 0.26 + 0.26i];
[m,n] = size(a);
[qr, tau, info] = f08as(a);
[Q, info] = f08at(qr, tau);
mtitle = sprintf('The leading %2d columns of Q\n',n);
disp(mtitle);
disp(Q(:,1:n));
f08at example results
The leading 4 columns of Q
-0.3110 + 0.2624i -0.3175 + 0.4835i 0.4966 - 0.2997i -0.0072 - 0.3718i
0.3175 - 0.6414i -0.2062 + 0.1577i -0.0793 - 0.3094i -0.0282 - 0.1491i
-0.2008 + 0.1490i 0.4892 - 0.0900i 0.0357 - 0.0219i 0.5625 - 0.0710i
0.1199 - 0.1231i 0.2566 - 0.3055i 0.4489 - 0.2141i -0.1651 + 0.1800i
-0.2689 - 0.1652i 0.1697 - 0.2491i -0.0496 + 0.1158i -0.4885 - 0.4540i
-0.3499 + 0.0907i -0.0491 - 0.3133i -0.1256 - 0.5300i 0.1039 + 0.0450i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015