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).
| #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) |
|
nag_ztgsja (f08ysc) computes the GSVD of the matrices
and
which are assumed to have the form as returned by
nag_zggsvp (f08vsc)
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
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.
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
- 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 Nag_ColMajor.
- 2:
jobu – 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:
jobv – 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:
jobq – 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:
m – IntegerInput
-
On entry:
, the number of rows of the matrix .
Constraint:
.
- 6:
p – IntegerInput
-
On entry:
, the number of rows of the matrix .
Constraint:
.
- 7:
n – IntegerInput
-
On entry:
, the number of columns of the matrices and .
Constraint:
.
- 8:
k – IntegerInput
- 9:
l – 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:
a[] – 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:
pda – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
a.
Constraints:
- if ,
;
- if , .
- 12:
b[] – 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:
pdb – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraints:
- if ,
;
- if , .
- 14:
tola – doubleInput
- 15:
tolb – 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), say
where
is the
machine precision.
- 16:
alpha[n] – doubleOutput
On exit: see the description of
beta.
- 17:
beta[n] – 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:
u[] – ComplexInput/Output
-
Note: the dimension,
dim, of the array
u
must be at least
- when
or and
;
- when
or and
;
- 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)).
On exit: if
,
u contains the
unitary
matrix
.
If
,
u contains the product
.
If
,
u is not referenced.
- 19:
pdu – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
u.
Constraints:
- if ,
- if , ;
- otherwise ;
- if ,
- if or ,
;
- otherwise .
- 20:
v[] – ComplexInput/Output
-
Note: the dimension,
dim, of the array
v
must be at least
- when
or and
;
- when
or and
;
- 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)).
On exit: if
,
v contains the
unitary
matrix
.
If
,
v contains the product
.
If
,
v is not referenced.
- 21:
pdv – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
v.
Constraints:
- if ,
- if , ;
- otherwise ;
- if ,
- if or ,
;
- otherwise .
- 22:
q[] – ComplexInput/Output
-
Note: the dimension,
dim, of the array
q
must be at least
- when
or and
;
- when
or and
;
- 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)).
On exit: if
,
q contains the
unitary
matrix
.
If
,
q contains the product
.
If
,
q is not referenced.
- 23:
pdq – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
q.
Constraints:
- if ,
- if , ;
- otherwise ;
- if ,
- if or ,
;
- otherwise .
- 24:
ncycle – Integer *Output
-
On exit: the number of cycles required for convergence.
- 25:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
- NE_ALLOC_FAIL
Dynamic memory allocation failed.
- 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, , , .
Constraint: if or ,
;
otherwise .
On entry, , , .
Constraint: if or ,
;
otherwise .
On entry, , and .
Constraint: if , ;
otherwise .
On entry, , , .
Constraint: if or ,
;
otherwise .
On entry, , and .
Constraint: if , ;
otherwise .
On entry, , and .
Constraint: if , ;
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.
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.
The real analogue of this function is
nag_dtgsja (f08yec).
This example finds the generalized singular value decomposition
of the matrix pair
, where
and