nag_lapack_zungbr (f08kt) generates one of the complex unitary matrices
or
which were determined by
nag_lapack_zgebrd (f08ks) when reducing a complex matrix to bidiagonal form.
nag_lapack_zungbr (f08kt) is intended to be used after a call to
nag_lapack_zgebrd (f08ks), which reduces a complex rectangular matrix
to real bidiagonal form
by a unitary transformation:
.
nag_lapack_zgebrd (f08ks) represents the matrices
and
as products of elementary reflectors.
The various possibilities are specified by the arguments
vect,
m,
n and
k. The appropriate values to cover the most likely cases are as follows (assuming that
was an
by
matrix):
1. |
To form the full by matrix :
[a, info] = f08kt('Q', n, a, tau);
(note that the array a must have at least columns).
|
2. |
If , to form the leading columns of :
[a, info] = f08kt('Q', n, a(1:m,1:n), tau);
|
3. |
To form the full by matrix :
[a, info] = f08kt('P', m, a, tau);
(note that the array a must have at least rows).
|
4. |
If , to form the leading rows of :
[a, info] = f08kt('P', m, a(1:m,1:n), tau);
|
The computed matrix
differs from an exactly unitary matrix by a matrix
such that
where
is the
machine precision. A similar statement holds for the computed matrix
.
The total number of real floating-point operations for the cases listed in
Description are approximately as follows:
1. |
To form the whole of :
- if ,
- if ;
|
2. |
To form the leading columns of when :
|
3. |
To form the whole of :
- if ,
- if ;
|
4. |
To form the leading rows of when :
|
The real analogue of this function is
nag_lapack_dorgbr (f08kf).
For this function two examples are presented, both of which involve computing the singular value decomposition of a matrix
, where
in the first example and
in the second.
must first be reduced to tridiagonal form by
nag_lapack_zgebrd (f08ks). The program then calls
nag_lapack_zungbr (f08kt) twice to form
and
, and passes these matrices to
nag_lapack_zbdsqr (f08ms), which computes the singular value decomposition of
.
function f08kt_example
fprintf('f08kt example results\n\n');
ex1;
ex2;
function ex1
m = int64(6);
n = int64(4);
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];
[B, d, e, tauq, taup, info] = ...
f08ks(a);
vect = 'P';
[PT, info] = f08kt( ...
vect, m, B, taup, 'm', n, 'n', n);
vect = 'Q';
[Q, info] = f08kt( ...
vect, n, B, tauq, 'm', m, 'n', n);
c = [];
uplo = 'Upper';
[s, ~, VT, U, c, info] = f08ms( ...
uplo, d, e, PT, Q, c);
disp('Example 1: singular values');
disp(s(1:n)');
disp('Example 1: right singular vectors, by row');
disp(VT(1:n,:));
disp('Example 1: left singular vectors, by column');
disp(U);
function ex2
m = int64(3);
n = int64(4);
a = [0.28 - 0.36i 0.50 - 0.86i -0.77 - 0.48i 1.58 + 0.66i;
-0.50 - 1.10i -1.21 + 0.76i -0.32 - 0.24i -0.27 - 1.15i;
0.36 - 0.51i -0.07 + 1.33i -0.75 + 0.47i -0.08 + 1.01i];
[B, d, e, tauq, taup, info] = ...
f08ks(a);
vect = 'P';
[PT, info] = f08kt( ...
vect, m, B, taup, 'm', m, 'n', n);
vect = 'Q';
[Q, info] = f08kt( ...
vect, n, B, tauq, 'm', m, 'n', m);
c = [];
uplo = 'Lower';
[s, ~, VT, U, c, info] = f08ms( ...
uplo, d, e, PT, Q, c, 'n', m);
disp('Example 2: singular values');
disp(s(1:m)');
disp('Example 2: right singular vectors, by row');
disp(VT);
disp('Example 2: left singular vectors, by column');
disp(U(:,1:m));