NAG FL Interface
f08yyf (ztgsna)
1
Purpose
f08yyf estimates condition numbers for specified eigenvalues and/or eigenvectors of a complex matrix pair in generalized Schur form.
2
Specification
Fortran Interface
Subroutine f08yyf ( |
job, howmny, select, n, a, lda, b, ldb, vl, ldvl, vr, ldvr, s, dif, mm, m, work, lwork, iwork, info) |
Integer, Intent (In) |
:: |
n, lda, ldb, ldvl, ldvr, mm, lwork |
Integer, Intent (Inout) |
:: |
iwork(*) |
Integer, Intent (Out) |
:: |
m, info |
Real (Kind=nag_wp), Intent (Inout) |
:: |
s(*), dif(*) |
Complex (Kind=nag_wp), Intent (In) |
:: |
a(lda,*), b(ldb,*), vl(ldvl,*), vr(ldvr,*) |
Complex (Kind=nag_wp), Intent (Out) |
:: |
work(max(1,lwork)) |
Logical, Intent (In) |
:: |
select(*) |
Character (1), Intent (In) |
:: |
job, howmny |
|
C Header Interface
#include <nag.h>
void |
f08yyf_ (const char *job, const char *howmny, const logical sel[], const Integer *n, const Complex a[], const Integer *lda, const Complex b[], const Integer *ldb, const Complex vl[], const Integer *ldvl, const Complex vr[], const Integer *ldvr, double s[], double dif[], const Integer *mm, Integer *m, Complex work[], const Integer *lwork, Integer iwork[], Integer *info, const Charlen length_job, const Charlen length_howmny) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
f08yyf_ (const char *job, const char *howmny, const logical sel[], const Integer &n, const Complex a[], const Integer &lda, const Complex b[], const Integer &ldb, const Complex vl[], const Integer &ldvl, const Complex vr[], const Integer &ldvr, double s[], double dif[], const Integer &mm, Integer &m, Complex work[], const Integer &lwork, Integer iwork[], Integer &info, const Charlen length_job, const Charlen length_howmny) |
}
|
The routine may be called by the names f08yyf, nagf_lapackeig_ztgsna or its LAPACK name ztgsna.
3
Description
f08yyf estimates condition numbers for specified eigenvalues and/or right eigenvectors of an by matrix pair in generalized Schur form. The routine 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
f08xnf or
f08xpf, or
f08xsf 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
https://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:
– Character(1)
Input
-
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 .
-
2:
– Character(1)
Input
-
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 .
-
3:
– Logical array
Input
-
Note: the dimension of the array
select
must be at least
if
, and at least
otherwise.
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 .TRUE..
If
,
select is not referenced.
-
4:
– Integer
Input
-
On entry: , the order of the matrix pair .
Constraint:
.
-
5:
– Complex (Kind=nag_wp) array
Input
-
Note: the second dimension of the array
a
must be at least
.
On entry: the upper triangular matrix .
-
6:
– Integer
Input
-
On entry: the first dimension of the array
a as declared in the (sub)program from which
f08yyf is called.
Constraint:
.
-
7:
– Complex (Kind=nag_wp) array
Input
-
Note: the second dimension of the array
b
must be at least
.
On entry: the upper triangular matrix .
-
8:
– Integer
Input
-
On entry: the first dimension of the array
b as declared in the (sub)program from which
f08yyf is called.
Constraint:
.
-
9:
– Complex (Kind=nag_wp) array
Input
-
Note: the second dimension of the array
vl
must be at least
if
or
.
On entry: if
or
,
vl must contain left eigenvectors of
, corresponding to the eigenpairs specified by
howmny and
select. The eigenvectors must be stored in consecutive columns of
vl, as returned by
f08wnf or
f08yxf.
If
,
vl is not referenced.
-
10:
– Integer
Input
-
On entry: the first dimension of the array
vl as declared in the (sub)program from which
f08yyf is called.
Constraints:
- if or , ;
- otherwise .
-
11:
– Complex (Kind=nag_wp) array
Input
-
Note: the second dimension of the array
vr
must be at least
if
or
.
On entry: if
or
,
vr must contain right eigenvectors of
, corresponding to the eigenpairs specified by
howmny and
select. The eigenvectors must be stored in consecutive columns of
vr, as returned by
f08wnf or
f08yxf.
If
,
vr is not referenced.
-
12:
– Integer
Input
-
On entry: the first dimension of the array
vr as declared in the (sub)program from which
f08yyf is called.
Constraints:
- if or , ;
- otherwise .
-
13:
– Real (Kind=nag_wp) array
Output
-
Note: the dimension of the array
s
must be at least
if
or
.
On exit: if
or
, the reciprocal condition numbers of the selected eigenvalues, stored in consecutive elements of the array.
If
,
s is not referenced.
-
14:
– Real (Kind=nag_wp) array
Output
-
Note: the dimension of the array
dif
must be at least
if
or
.
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.
-
15:
– Integer
Input
-
On entry: the number of elements in the arrays
s and
dif.
Constraints:
- if , ;
- otherwise .
-
16:
– 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.
-
17:
– Complex (Kind=nag_wp) array
Workspace
-
On exit: if
, the real part of
contains the minimum value of
lwork required for optimal performance.
-
18:
– Integer
Input
-
On entry: the dimension of the array
work as declared in the (sub)program from which
f08yyf is called.
If
, a workspace query is assumed; the routine only calculates the minimum size of the
work array, returns this value as the first entry of the
work array, and no error message related to
lwork is issued.
Constraints:
if
,
- if or , ;
- otherwise .
-
19:
– Integer array
Workspace
-
Note: the dimension of the array
iwork
must be at least
.
If
,
iwork is not referenced.
-
20:
– Integer
Output
On exit:
unless the routine detects an error (see
Section 6).
6
Error Indicators and Warnings
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
7
Accuracy
None.
8
Parallelism and Performance
f08yyf 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 routine. Please also 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 routine is
f08ylf.
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
f08yxf.
10.1
Program Text
10.2
Program Data
10.3
Program Results