NAG Library Function Document
nag_ztgsja (f08ysc)
1
Purpose
nag_ztgsja (f08ysc) computes the generalized singular value decomposition (GSVD) of two complex upper trapezoidal matrices and , where is an by matrix and is a by matrix.
and
are assumed to be in the form returned by
nag_zggsvp (f08vsc) or
nag_zggsvp3 (f08vuc).
2
Specification
#include <nag.h> |
#include <nagf08.h> |
void |
nag_ztgsja (Nag_OrderType order,
Nag_ComputeUType jobu,
Nag_ComputeVType jobv,
Nag_ComputeQType jobq,
Integer m,
Integer p,
Integer n,
Integer k,
Integer l,
Complex a[],
Integer pda,
Complex b[],
Integer pdb,
double tola,
double tolb,
double alpha[],
double beta[],
Complex u[],
Integer pdu,
Complex v[],
Integer pdv,
Complex q[],
Integer pdq,
Integer *ncycle,
NagError *fail) |
|
3
Description
nag_ztgsja (f08ysc) computes the GSVD of the matrices
and
which are assumed to have the form as returned by
nag_zggsvp (f08vsc) or
nag_zggsvp3 (f08vuc)
where the
by
matrix
and the
by
matrix
are nonsingular upper triangular,
is
by
upper triangular if
and is
by
upper trapezoidal otherwise.
nag_ztgsja (f08ysc) computes unitary matrices
,
and
, diagonal matrices
and
, and an upper triangular matrix
such that
Optionally , and may or may not be computed, or they may be premultiplied by matrices , and respectively.
If
then
,
and
have the form
where
.
If
then
,
and
have the form
where
.
In both cases the diagonal matrix
has real non-negative diagonal elements, the diagonal matrix
has real positive diagonal elements, so that
is nonsingular, and
. See Section 2.3.5.3 of
Anderson et al. (1999) for further information.
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 (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5
Arguments
- 1:
– 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.3.1.3 in How to Use the NAG Library and its Documentation for a more detailed explanation of the use of this argument.
Constraint:
or .
- 2:
– Nag_ComputeUTypeInput
-
On entry: if
,
u must contain a unitary matrix
on entry, and the product
is returned.
If
,
u is initialized to the unit matrix, and the unitary matrix
is returned.
If , is not computed.
Constraint:
, or .
- 3:
– Nag_ComputeVTypeInput
-
On entry: if
,
v must contain a unitary matrix
on entry, and the product
is returned.
If
,
v is initialized to the unit matrix, and the unitary matrix
is returned.
If , is not computed.
Constraint:
, or .
- 4:
– Nag_ComputeQTypeInput
-
On entry: if
,
q must contain a unitary matrix
on entry, and the product
is returned.
If
,
q is initialized to the unit matrix, and the unitary matrix
is returned.
If , is not computed.
Constraint:
, or .
- 5:
– IntegerInput
-
On entry: , the number of rows of the matrix .
Constraint:
.
- 6:
– IntegerInput
-
On entry: , the number of rows of the matrix .
Constraint:
.
- 7:
– IntegerInput
-
On entry: , the number of columns of the matrices and .
Constraint:
.
- 8:
– IntegerInput
- 9:
– IntegerInput
-
On entry:
k and
l specify the sizes,
and
, of the subblocks of
and
, whose GSVD is to be computed by
nag_ztgsja (f08ysc).
- 10:
– ComplexInput/Output
-
Note: the dimension,
dim, of the array
a
must be at least
- when
;
- when
.
Where
appears in this document, it refers to the array element
- when ;
- when .
On entry: the by matrix .
On exit: if
,
contains the
by
upper triangular matrix
.
If , contains the first rows of the by upper triangular matrix , and the submatrix is returned in .
- 11:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
a.
Constraints:
- if ,
;
- if , .
- 12:
– ComplexInput/Output
-
Note: the dimension,
dim, of the array
b
must be at least
- when
;
- when
.
Where
appears in this document, it refers to the array element
- when ;
- when .
On entry: the by matrix .
On exit: if , contains the submatrix of .
- 13:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraints:
- if ,
;
- if , .
- 14:
– doubleInput
- 15:
– doubleInput
-
On entry:
tola and
tolb are the convergence criteria for the Jacobi–Kogbetliantz iteration procedure. Generally, they should be the same as used in the preprocessing step performed by
nag_zggsvp (f08vsc) or
nag_zggsvp3 (f08vuc), say
where
is the
machine precision.
- 16:
– doubleOutput
-
On exit: see the description of
beta.
- 17:
– doubleOutput
-
On exit:
alpha and
beta contain the generalized singular value pairs of
and
;
- , , for , and
- if ,
, , for , or
- if ,
, , for and
, , for .
Furthermore, if ,
, for .
- 18:
– ComplexInput/Output
-
Note: the dimension,
dim, of the array
u
must be at least
- when
or ;
- otherwise.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: if
,
u must contain an
by
matrix
(usually the unitary matrix returned by
nag_zggsvp (f08vsc) or
nag_zggsvp3 (f08vuc)).
On exit: if
,
u contains the product
.
If
,
u contains the unitary matrix
.
If
,
u is not referenced.
- 19:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
u.
Constraints:
- if or , ;
- otherwise .
- 20:
– ComplexInput/Output
-
Note: the dimension,
dim, of the array
v
must be at least
- when
or ;
- otherwise.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: if
,
v must contain an
by
matrix
(usually the unitary matrix returned by
nag_zggsvp (f08vsc) or
nag_zggsvp3 (f08vuc)).
On exit: if
,
v contains the unitary matrix
.
If
,
v contains the product
.
If
,
v is not referenced.
- 21:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
v.
Constraints:
- if or , ;
- otherwise .
- 22:
– ComplexInput/Output
-
Note: the dimension,
dim, of the array
q
must be at least
- when
or ;
- otherwise.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: if
,
q must contain an
by
matrix
(usually the unitary matrix returned by
nag_zggsvp (f08vsc) or
nag_zggsvp3 (f08vuc)).
On exit: if
,
q contains the unitary matrix
.
If
,
q contains the product
.
If
,
q is not referenced.
- 23:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
q.
Constraints:
- if or , ;
- otherwise .
- 24:
– Integer *Output
-
On exit: the number of cycles required for convergence.
- 25:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.7 in How to Use the NAG Library and its Documentation).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_CONVERGENCE
-
The procedure does not converge after cycles.
- NE_ENUM_INT_2
-
On entry, , and .
Constraint: if or , ;
otherwise .
On entry, , and .
Constraint: if or , ;
otherwise .
On entry, , and .
Constraint: if or , ;
otherwise .
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
On entry, and .
Constraint: .
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.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
The computed generalized singular value decomposition is nearly the exact generalized singular value decomposition for nearby matrices
and
, where
and
is the
machine precision. See Section 4.12 of
Anderson et al. (1999) for further details.
8
Parallelism and Performance
nag_ztgsja (f08ysc) 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
x06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The real analogue of this function is
nag_dtgsja (f08yec).
10
Example
This example finds the generalized singular value decomposition
of the matrix pair
, where
and
10.1
Program Text
Program Text (f08ysce.c)
10.2
Program Data
Program Data (f08ysce.d)
10.3
Program Results
Program Results (f08ysce.r)