PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dorcsd (f08ra)
Purpose
nag_lapack_dorcsd (f08ra) computes the CS decomposition of a real by orthogonal matrix , partitioned into a by array of submatrices.
Syntax
[
x11,
x12,
x21,
x22,
theta,
u1,
u2,
v1t,
v2t,
info] = f08ra(
m,
p,
q,
x11,
x12,
x21,
x22, 'jobu1',
jobu1, 'jobu2',
jobu2, 'jobv1t',
jobv1t, 'jobv2t',
jobv2t, 'trans',
trans, 'signs',
signs)
[
x11,
x12,
x21,
x22,
theta,
u1,
u2,
v1t,
v2t,
info] = nag_lapack_dorcsd(
m,
p,
q,
x11,
x12,
x21,
x22, 'jobu1',
jobu1, 'jobu2',
jobu2, 'jobv1t',
jobv1t, 'jobv2t',
jobv2t, 'trans',
trans, 'signs',
signs)
Description
The
by
orthogonal matrix
is partitioned as
where
is a
by
submatrix and the dimensions of the other submatrices
,
and
are such that
remains
by
.
The CS decomposition of
is
where
,
and
are
by
matrices, such that
is an orthogonal matrix containing the
by
orthogonal matrix
and the
by
orthogonal matrix
;
is an orthogonal matrix containing the
by
orthogonal matrix
and the
by
orthogonal matrix
; and
contains the
by
non-negative diagonal submatrices
and
satisfying
, where
and the top left partition is
by
.
The identity matrix is of order and vanishes if .
The identity matrix is of order and vanishes if .
The identity matrix is of order and vanishes if .
The identity matrix is of order and vanishes if .
In each of the four cases at least two of the identity matrices vanish.
The indicated zeros represent augmentations by additional rows or columns (but not both) to the square diagonal matrices formed by and or .
does not need to be stored in full; it is sufficient to return only the values for where and .
The algorithm used to perform the complete
decomposition is described fully in
Sutton (2009) including discussions of the stability and accuracy of the algorithm.
References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (2012) Matrix Computations (4th Edition) Johns Hopkins University Press, Baltimore
Sutton B D (2009) Computing the complete
decomposition
Numerical Algorithms (Volume 50) 1017–1398 Springer US 33–65
http://dx.doi.org/10.1007/s11075-008-9215-6
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
, the number of rows and columns in the orthogonal matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
, the number of rows in and .
Constraint:
.
- 3:
– int64int32nag_int scalar
-
, the number of columns in and .
Constraint:
.
- 4:
– double array
-
The first dimension,
, of the array
x11 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x11 must be at least
if
, and at least
otherwise.
The upper left partition of the orthogonal matrix whose CSD is desired.
- 5:
– double array
-
The first dimension,
, of the array
x12 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x12 must be at least
if
, and at least
otherwise.
The upper right partition of the orthogonal matrix whose CSD is desired.
- 6:
– double array
-
The first dimension,
, of the array
x21 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x21 must be at least
if
, and at least
otherwise.
The lower left partition of the orthogonal matrix whose CSD is desired.
- 7:
– double array
-
The first dimension,
, of the array
x22 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x22 must be at least
if
, and at least
otherwise.
The lower right partition of the orthogonal matrix CSD is desired.
Optional Input Parameters
- 1:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 2:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 3:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 4:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 5:
– string (length ≥ 1)
Default:
- if , , , , and are stored in row-major order;
- otherwise, , , , and are stored in column-major order.
- 6:
– string (length ≥ 1)
Default:
- if , the lower-left block is made nonpositive (the other convention);
- otherwise, the upper-right block is made nonpositive (the default convention).
Output Parameters
- 1:
– double array
-
The first dimension,
, of the array
x11 will be
- if , ;
- otherwise .
The second dimension of the array
x11 will be
if
and
otherwise.
Contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 2:
– double array
-
The first dimension,
, of the array
x12 will be
- if , ;
- otherwise .
The second dimension of the array
x12 will be
if
and
otherwise.
Contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 3:
– double array
-
The first dimension,
, of the array
x21 will be
- if , ;
- otherwise .
The second dimension of the array
x21 will be
if
and
otherwise.
Contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 4:
– double array
-
The first dimension,
, of the array
x22 will be
- if , ;
- otherwise .
The second dimension of the array
x22 will be
if
and
otherwise.
Contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 5:
– double array
-
The values
for
where
. The diagonal submatrices
and
of
are constructed from these values as
- and
- .
- 6:
– double array
-
The first dimension of the array
u1 will be if
,
.
The second dimension of the array
u1 will be
if
and
otherwise.
If
,
u1 contains the
by
orthogonal matrix
.
- 7:
– double array
-
The first dimension of the array
u2 will be if
,
.
The second dimension of the array
u2 will be
if
and
otherwise.
If
,
u2 contains the
by
orthogonal matrix
.
- 8:
– double array
-
The first dimension of the array
v1t will be if
,
.
The second dimension of the array
v1t will be
if
and
otherwise.
If
,
v1t contains the
by
orthogonal matrix
.
- 9:
– double array
-
The first dimension of the array
v2t will be if
,
.
The second dimension of the array
v2t will be
if
and
otherwise.
If
,
v2t contains the
by
orthogonal matrix
.
- 10:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
-
The Jacobi-type procedure failed to converge during an internal reduction to bidiagonal-block form. The process requires convergence to
values, the value of
info gives the number of converged values.
Accuracy
The computed
decomposition is nearly the exact
decomposition for the nearby matrix
, where
and
is the
machine precision.
Further Comments
The total number of floating-point operations required to perform the full decomposition is approximately .
The complex analogue of this function is
nag_lapack_zuncsd (f08rn).
Example
This example finds the full CS decomposition of
partitioned in
by
blocks.
The decomposition is performed both on submatrices of the orthogonal matrix and on separated partition matrices. Code is also provided to perform a recombining check if required.
Open in the MATLAB editor:
f08ra_example
function f08ra_example
fprintf('f08ra example results\n\n');
m = int64(5);
p = int64(3);
q = int64(2);
x = [-0.7576 0.3697 0.3838 0.2126 -0.3112;
-0.4077 -0.1552 -0.1129 0.2676 0.8517;
-0.0488 0.7240 -0.6730 -0.1301 0.0602;
-0.2287 0.0088 0.2235 -0.9235 0.2120;
0.4530 0.5612 0.5806 0.1162 0.3595];
x11 = x(1:p, 1:q); x12 = x(1:p, q+1:m);
x21 = x(p+1:m,1:q); x22 = x(p+1:m,q+1:m);
[x11, x12, x21, x22, theta, u1, u2, v1t, v2t, info] = ...
f08ra( ...
m, p, q, x11, x12, x21, x22);
disp('Components of CS factorization of X:');
disp(' Theta');
disp(theta);
disp(' U1');
disp(u1);
disp(' U2');
disp(u2);
disp(' V1');
disp(v1t');
disp(' V2');
disp(v2t');
f08ra example results
Components of CS factorization of X:
Theta
0.1811
0.8255
U1
-0.8249 -0.3370 -0.4538
-0.2042 -0.5710 0.7952
-0.5271 0.7486 0.4022
U2
-0.9802 -0.1982
-0.1982 0.9802
V1
0.7461 0.6658
-0.6658 0.7461
V2
-0.3397 0.7738 0.5346
0.8967 0.4379 -0.0640
-0.2837 0.4576 -0.8427
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015