NAG Library Function Document
nag_dorcsd (f08rac)
1 Purpose
nag_dorcsd (f08rac) computes the CS decomposition of a real by orthogonal matrix , partitioned into a by array of submatrices.
2 Specification
#include <nag.h> |
#include <nagf08.h> |
void |
nag_dorcsd (Nag_OrderType order,
Nag_ComputeUType jobu1,
Nag_ComputeUType jobu2,
Nag_ComputeVTType jobv1t,
Nag_ComputeVTType jobv2t,
Nag_SignsType signs,
Integer m,
Integer p,
Integer q,
double x11[],
Integer pdx11,
double x12[],
Integer pdx12,
double x21[],
Integer pdx21,
double x22[],
Integer pdx22,
double theta[],
double u1[],
Integer pdu1,
double u2[],
Integer pdu2,
double v1t[],
Integer pdv1t,
double v2t[],
Integer pdv2t,
NagError *fail) |
|
3 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.
4 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-65 Arguments
- 1:
order – Nag_OrderTypeInput
-
On entry: the
order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by
. See
Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint:
or .
- 2:
jobu1 – Nag_ComputeUTypeInput
-
On entry:
- if , is computed;
- if , is not computed.
Constraint:
or .
- 3:
jobu2 – Nag_ComputeUTypeInput
-
On entry:
- if , is computed;
- if , is not computed.
Constraint:
or .
- 4:
jobv1t – Nag_ComputeVTTypeInput
-
On entry:
- if , is computed;
- if , is not computed.
Constraint:
or .
- 5:
jobv2t – Nag_ComputeVTTypeInput
-
On entry:
- if , is computed;
- if , is not computed.
Constraint:
or .
- 6:
signs – Nag_SignsTypeInput
-
On entry:
- if , the lower-left block is made nonpositive (the other convention);
- if , the upper-right block is made nonpositive (the default convention).
Constraint:
or .
- 7:
m – IntegerInput
-
On entry: , the number of rows and columns in the orthogonal matrix .
Constraint:
.
- 8:
p – IntegerInput
On entry: , the number of rows in and .
Constraint:
.
- 9:
q – IntegerInput
On entry: , the number of columns in and .
Constraint:
.
- 10:
x11[] – doubleInput/Output
-
Note: the dimension,
dim, of the array
x11
must be at least
- when
;
- when
.
The
th element of the matrix is stored in
- when ;
- when .
On entry: the upper left partition of the orthogonal matrix whose CSD is desired.
On exit: contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 11:
pdx11 – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
x11.
Constraints:
- if , ;
- if , .
- 12:
x12[] – doubleInput/Output
-
Note: the dimension,
dim, of the array
x12
must be at least
- when
;
- when
.
The
th element of the matrix is stored in
- when ;
- when .
On entry: the upper right partition of the orthogonal matrix whose CSD is desired.
On exit: contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 13:
pdx12 – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
x12.
Constraints:
- if , ;
- if , .
- 14:
x21[] – doubleInput/Output
-
Note: the dimension,
dim, of the array
x21
must be at least
- when
;
- when
.
The
th element of the matrix is stored in
- when ;
- when .
On entry: the lower left partition of the orthogonal matrix whose CSD is desired.
On exit: contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 15:
pdx21 – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
x21.
Constraints:
- if , ;
- if , .
- 16:
x22[] – doubleInput/Output
-
Note: the dimension,
dim, of the array
x22
must be at least
- when
;
- when
.
The
th element of the matrix is stored in
- when ;
- when .
On entry: the lower right partition of the orthogonal matrix CSD is desired.
On exit: contains details of the orthogonal matrix used in a simultaneous bidiagonalization process.
- 17:
pdx22 – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
x22.
Constraints:
- if , ;
- if , .
- 18:
theta[] – doubleOutput
-
Note: the dimension,
dim, of the array
theta
must be at least
.
On exit: the values
for
where
. The diagonal submatrices
and
of
are constructed from these values as
-
and
-
.
- 19:
u1[] – doubleOutput
-
Note: the dimension,
dim, of the array
u1
must be at least
- when
;
- otherwise u1 may be NULL.
The
th element of the matrix is stored in
- when ;
- when .
On exit: if
,
u1 contains the
by
orthogonal matrix
.
- 20:
pdu1 – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
u1.
Constraint:
if ,
- 21:
u2[] – doubleOutput
-
Note: the dimension,
dim, of the array
u2
must be at least
- when
;
- otherwise u2 may be NULL.
The
th element of the matrix is stored in
- when ;
- when .
On exit: if
,
u2 contains the
by
orthogonal matrix
.
- 22:
pdu2 – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
u2.
Constraint:
if ,
- 23:
v1t[] – doubleOutput
-
Note: the dimension,
dim, of the array
v1t
must be at least
- when
;
- otherwise v1t may be NULL.
The
th element of the matrix is stored in
- when ;
- when .
On exit: if
,
v1t contains the
by
orthogonal matrix
.
- 24:
pdv1t – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
v1t.
Constraint:
if ,
- 25:
v2t[] – doubleOutput
-
Note: the dimension,
dim, of the array
v2t
must be at least
- when
;
- otherwise v2t may be NULL.
The
th element of the matrix is stored in
- when ;
- when .
On exit: if
,
v2t contains the
by
orthogonal matrix
.
- 26:
pdv2t – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
v2t.
Constraint:
if ,
- 27:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
6 Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_CONVERGENCE
-
The Jacobi-type procedure failed to converge during an internal reduction to
bidiagonal-block form. The process requires convergence to
values, the value of gives the number
of converged values.
- NE_ENUM_INT_2
-
On entry, , and .
Constraint: if , .
On entry, , and .
Constraint: if , .
- NE_ENUM_INT_3
-
On entry, , , and .
Constraint: if , .
On entry, , , and .
Constraint: if , .
On entry, , , and .
Constraint: if , ;
if , .
- NE_ENUM_INT_4
-
On entry, , , , and .
Constraint: if , ;
if , .
On entry, , , , and .
Constraint: if , ;
if , .
On entry, , , , and .
Constraint: if , ;
if , .
- NE_INT
-
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
On entry, and .
Constraint: .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
7 Accuracy
The computed
decomposition is nearly the exact
decomposition for the nearby matrix
, where
and
is the
machine precision.
8 Parallelism and Performance
nag_dorcsd (f08rac) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_dorcsd (f08rac) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
Users' Note for your implementation for any additional implementation-specific information.
The total number of floating-point operations required to perform the full decomposition is approximately .
The complex analogue of this function is
nag_zuncsd (f08rnc).
10 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.
10.1 Program Text
Program Text (f08race.c)
10.2 Program Data
Program Data (f08race.d)
10.3 Program Results
Program Results (f08race.r)