NAG Library Function Document
nag_ztgsna (f08yyc)
1 Purpose
nag_ztgsna (f08yyc) estimates condition numbers for specified eigenvalues and/or eigenvectors of a complex matrix pair in generalized Schur form.
2 Specification
#include <nag.h> |
#include <nagf08.h> |
void |
nag_ztgsna (Nag_OrderType order,
Nag_JobType job,
Nag_HowManyType how_many,
const Nag_Boolean select[],
Integer n,
const Complex a[],
Integer pda,
const Complex b[],
Integer pdb,
const Complex vl[],
Integer pdvl,
const Complex vr[],
Integer pdvr,
double s[],
double dif[],
Integer mm,
Integer *m,
NagError *fail) |
|
3 Description
nag_ztgsna (f08yyc) estimates condition numbers for specified eigenvalues and/or right eigenvectors of an by matrix pair in generalized Schur form. The function actually returns estimates of the reciprocals of the condition numbers in order to avoid possible overflow.
The pair
are in generalized Schur form if
and
are upper triangular as returned, for example, by
nag_zgges (f08xnc) or
nag_zggesx (f08xpc), or
nag_zhgeqz (f08xsc) with
. The diagonal elements define the generalized eigenvalues
, for
, of the pair
and the eigenvalues are given by
so that
where
is the corresponding (right) eigenvector.
If
and
are the result of a generalized Schur factorization of a matrix pair
then the eigenvalues and condition numbers of the pair
are the same as those of the pair
.
Let
be a simple generalized eigenvalue of
. Then the reciprocal of the condition number of the eigenvalue
is defined as
where
and
are the right and left eigenvectors of
corresponding to
. If both
and
are zero, then
is singular and
is returned.
If
and
are unitary transformations such that
where
and
are
by
matrices, then the reciprocal condition number is given by
where
denotes the smallest singular value of the
by
matrix
and
is the Kronecker product.
See Sections 2.4.8 and 4.11 of
Anderson et al. (1999) and
Kågström and Poromaa (1996) for further details and 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
Kågström B and Poromaa P (1996) LAPACK-style algorithms and software for solving the generalized Sylvester equation and estimating the separation between regular matrix pairs ACM Trans. Math. Software 22 78–103
5 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:
job – Nag_JobTypeInput
On entry: indicates whether condition numbers are required for eigenvalues and/or eigenvectors.
- Condition numbers for eigenvalues only are computed.
- Condition numbers for eigenvectors only are computed.
- Condition numbers for both eigenvalues and eigenvectors are computed.
Constraint:
, or .
- 3:
how_many – Nag_HowManyTypeInput
On entry: indicates how many condition numbers are to be computed.
- Condition numbers for all eigenpairs are computed.
- Condition numbers for selected eigenpairs (as specified by select) are computed.
Constraint:
or .
- 4:
select[] – const Nag_BooleanInput
-
Note: the dimension,
dim, of the array
select
must be at least
- when ;
- otherwise select may be NULL.
On entry: specifies the eigenpairs for which condition numbers are to be computed if
. To select condition numbers for the eigenpair corresponding to the eigenvalue
,
must be set to Nag_TRUE.
If
,
select is not referenced and may be
NULL.
- 5:
n – IntegerInput
On entry: , the order of the matrix pair .
Constraint:
.
- 6:
a[] – const ComplexInput
-
Note: the dimension,
dim, of the array
a
must be at least
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the upper triangular matrix .
- 7:
pda – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
a.
Constraint:
.
- 8:
b[] – const ComplexInput
-
Note: the dimension,
dim, of the array
b
must be at least
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the upper triangular matrix .
- 9:
pdb – IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraint:
.
- 10:
vl[] – const ComplexInput
-
Note: the dimension,
dim, of the array
vl
must be at least
- when
or and
;
- when
or and
;
- otherwise vl may be NULL.
The
th element of the
th vector is stored in
- when ;
- when .
On entry: if
or
,
vl must contain left eigenvectors of
, corresponding to the eigenpairs specified by
how_many and
select. The eigenvectors must be stored in consecutive columns of
vl, as returned by
nag_zggev (f08wnc) or
nag_ztgevc (f08yxc).
If
,
vl is not referenced and may be
NULL.
- 11:
pdvl – IntegerInput
-
On entry: the stride used in the array
vl.
Constraints:
- if ,
- if or , ;
- otherwise ;
- if ,
- if or ,
;
- otherwise vl may be NULL.
- 12:
vr[] – const ComplexInput
-
Note: the dimension,
dim, of the array
vr
must be at least
- when
or and
;
- when
or and
;
- otherwise vr may be NULL.
The
th element of the
th vector is stored in
- when ;
- when .
On entry: if
or
,
vr must contain right eigenvectors of
, corresponding to the eigenpairs specified by
how_many and
select. The eigenvectors must be stored in consecutive columns of
vr, as returned by
nag_zggev (f08wnc) or
nag_ztgevc (f08yxc).
If
,
vr is not referenced and may be
NULL.
- 13:
pdvr – IntegerInput
-
On entry: the stride used in the array
vr.
Constraints:
- if ,
- if or , ;
- otherwise ;
- if ,
- if or ,
;
- otherwise vr may be NULL.
- 14:
s[] – doubleOutput
-
Note: the dimension,
dim, of the array
s
must be at least
- when or ;
- otherwise s may be NULL.
On exit: if
or
, the reciprocal condition numbers of the selected eigenvalues, stored in consecutive elements of the array.
If
,
s is not referenced and may be
NULL.
- 15:
dif[] – doubleOutput
-
Note: the dimension,
dim, of the array
dif
must be at least
- when or ;
- otherwise dif may be NULL.
On exit: if
or
, the estimated reciprocal condition numbers of the selected eigenvectors, stored in consecutive elements of the array. If the eigenvalues cannot be reordered to compute
,
is set to
; this can only occur when the true value would be very small anyway.
If
,
dif is not referenced and may be
NULL.
- 16:
mm – IntegerInput
-
On entry: the number of elements in the arrays
s and
dif.
Constraints:
- if , ;
- otherwise .
- 17:
m – Integer *Output
On exit: the number of elements of the arrays
s and
dif used to store the specified condition numbers; for each selected eigenvalue one element is used.
If
,
m is set to
n.
- 18:
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_ENUM_INT_2
-
On entry, , , .
Constraint: if or ,
.
On entry, , and .
Constraint: if or , .
On entry, , , .
Constraint: if or ,
.
On entry, , and .
Constraint: if or , .
- NE_ENUM_INT_3
-
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: .
- 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
None.
8 Parallelism and Performance
nag_ztgsna (f08yyc) is not threaded by NAG in any implementation.
nag_ztgsna (f08yyc) 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.
An approximate asymptotic error bound on the chordal distance between the computed eigenvalue
and the corresponding exact eigenvalue
is
where
is the
machine precision.
An approximate asymptotic error bound for the right or left computed eigenvectors
or
corresponding to the right and left eigenvectors
and
is given by
The real analogue of this function is
nag_dtgsna (f08ylc).
10 Example
This example estimates condition numbers and approximate error estimates for all the eigenvalues and right eigenvectors of the pair
given by
and
The eigenvalues and eigenvectors are computed by calling
nag_ztgevc (f08yxc).
10.1 Program Text
Program Text (f08yyce.c)
10.2 Program Data
Program Data (f08yyce.d)
10.3 Program Results
Program Results (f08yyce.r)