NAG FL Interface
f08ylf (dtgsna)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

f08ylf estimates condition numbers for specified eigenvalues and/or eigenvectors of a matrix pair in generalized real Schur form.

2 Specification

Fortran Interface
Subroutine f08ylf ( 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 (In) :: a(lda,*), b(ldb,*), vl(ldvl,*), vr(ldvr,*)
Real (Kind=nag_wp), Intent (Inout) :: s(*), dif(*)
Real (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  f08ylf_ (const char *job, const char *howmny, const logical sel[], const Integer *n, const double a[], const Integer *lda, const double b[], const Integer *ldb, const double vl[], const Integer *ldvl, const double vr[], const Integer *ldvr, double s[], double dif[], const Integer *mm, Integer *m, double work[], const Integer *lwork, Integer iwork[], Integer *info, const Charlen length_job, const Charlen length_howmny)
The routine may be called by the names f08ylf, nagf_lapackeig_dtgsna or its LAPACK name dtgsna.

3 Description

f08ylf estimates condition numbers for specified eigenvalues and/or right eigenvectors of an n×n matrix pair (S,T) in real generalized Schur form. The routine actually returns estimates of the reciprocals of the condition numbers in order to avoid possible overflow.
The pair (S,T) are in real generalized Schur form if S is block upper triangular with 1×1 and 2×2 diagonal blocks and T is upper triangular as returned, for example, by f08xbf or f08xcf, or f08xef with job='S'. The diagonal elements, or blocks, define the generalized eigenvalues (αi,βi), for i=1,2,,n, of the pair (S,T) and the eigenvalues are given by
λi = αi / βi ,  
so that
βi S xi = αi T xi   or   S xi = λi T xi ,  
where xi is the corresponding (right) eigenvector.
If S and T are the result of a generalized Schur factorization of a matrix pair (A,B)
A = QSZT ,   B = QTZT  
then the eigenvalues and condition numbers of the pair (S,T) are the same as those of the pair (A,B).
Let (α,β)(0,0) be a simple generalized eigenvalue of (A,B). Then the reciprocal of the condition number of the eigenvalue λ=α/β is defined as
s(λ)= ( |yTAx| 2 + |yTBx| 2 ) 1/2 (x2y2) ,  
where x and y are the right and left eigenvectors of (A,B) corresponding to λ. If both α and β are zero, then (A,B) is singular and s(λ)=-1 is returned.
The definition of the reciprocal of the estimated condition number of the right eigenvector x and the left eigenvector y corresponding to the simple eigenvalue λ depends upon whether λ is a real eigenvalue, or one of a complex conjugate pair.
If the eigenvalue λ is real and U and V are orthogonal transformations such that
UT (A,B) V= (S,T) = ( α * 0 S22 ) ( β * 0 T22 ) ,  
where S22 and T22 are (n-1)×(n-1) matrices, then the reciprocal condition number is given by
Dif(x) Dif(y) = Dif((α,β),(S22,T22)) = σmin (Z) ,  
where σmin(Z) denotes the smallest singular value of the 2(n-1)×2(n-1) matrix
Z = ( αI -1S22 βI -1T22 )  
and is the Kronecker product.
If λ is part of a complex conjugate pair and U and V are orthogonal transformations such that
UT (A,B) V = (S,T) = ( S11 * 0 S22 ) ( T11 * 0 T22 ) ,  
where S11 and T11 are two by two matrices, S22 and T22 are (n-2)×(n-2) matrices, and (S11,T11) corresponds to the complex conjugate eigenvalue pair λ, λ¯, then there exist unitary matrices U1 and V1 such that
U1H S11 V1 = ( s11 s12 0 s22 )   and   U1H T11 V1 = ( t11 t12 0 t22 ) .  
The eigenvalues are given by λ=s11/t11 and λ¯=s22/t22. Then the Frobenius norm-based, estimated reciprocal condition number is bounded by
Dif(x) Dif(y) min(d1,max(1,|Re(s11)/Re(s22)|),d2)  
where Re(z) denotes the real part of z, d1=Dif((s11,t11),(s22,t22))=σmin(Z1), Z1 is the complex two by two matrix
Z1 = ( s11 -s22 t11 -t22 ) ,  
and d2 is an upper bound on Dif((S11,T11),(S22,T22)); i.e., an upper bound on σmin(Z2), where Z2 is the (2n-2)×(2n-2) matrix
Z2 = ( S11TI -IS22 T11TI -IT22 ) .  
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: job Character(1) Input
On entry: indicates whether condition numbers are required for eigenvalues and/or eigenvectors.
job='E'
Condition numbers for eigenvalues only are computed.
job='V'
Condition numbers for eigenvectors only are computed.
job='B'
Condition numbers for both eigenvalues and eigenvectors are computed.
Constraint: job='E', 'V' or 'B'.
2: howmny Character(1) Input
On entry: indicates how many condition numbers are to be computed.
howmny='A'
Condition numbers for all eigenpairs are computed.
howmny='S'
Condition numbers for selected eigenpairs (as specified by select) are computed.
Constraint: howmny='A' or 'S'.
3: select(*) Logical array Input
Note: the dimension of the array select must be at least max(1,n) if howmny='S', and at least 1 otherwise.
On entry: specifies the eigenpairs for which condition numbers are to be computed if howmny='S'. To select condition numbers for the eigenpair corresponding to the real eigenvalue λj, select(j) must be set .TRUE.. To select condition numbers corresponding to a complex conjugate pair of eigenvalues λj and λj+1, select(j) and/or select(j+1) must be set to .TRUE..
If howmny='A', select is not referenced.
4: n Integer Input
On entry: n, the order of the matrix pair (S,T).
Constraint: n0.
5: a(lda,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array a must be at least max(1,n).
On entry: the upper quasi-triangular matrix S.
6: lda Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f08ylf is called.
Constraint: ldamax(1,n).
7: b(ldb,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array b must be at least max(1,n).
On entry: the upper triangular matrix T.
8: ldb Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f08ylf is called.
Constraint: ldbmax(1,n).
9: vl(ldvl,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array vl must be at least max(1,mm) if job='E' or 'B'.
On entry: if job='E' or 'B', vl must contain left eigenvectors of (S,T), corresponding to the eigenpairs specified by howmny and select. The eigenvectors must be stored in consecutive columns of vl, as returned by f08wcf or f08ykf.
If job='V', vl is not referenced.
10: ldvl Integer Input
On entry: the first dimension of the array vl as declared in the (sub)program from which f08ylf is called.
Constraints:
  • if job='E' or 'B', ldvl max(1,n) ;
  • otherwise ldvl1.
11: vr(ldvr,*) Real (Kind=nag_wp) array Input
Note: the second dimension of the array vr must be at least max(1,mm) if job='E' or 'B'.
On entry: if job='E' or 'B', vr must contain right eigenvectors of (S,T), corresponding to the eigenpairs specified by howmny and select. The eigenvectors must be stored in consecutive columns of vr, as returned by f08wcf or f08ykf.
If job='V', vr is not referenced.
12: ldvr Integer Input
On entry: the first dimension of the array vr as declared in the (sub)program from which f08ylf is called.
Constraints:
  • if job='E' or 'B', ldvr max(1,n) ;
  • otherwise ldvr1.
13: s(*) Real (Kind=nag_wp) array Output
Note: the dimension of the array s must be at least max(1,mm) if job='E' or 'B'.
On exit: if job='E' or 'B', the reciprocal condition numbers of the selected eigenvalues, stored in consecutive elements of the array. For a complex conjugate pair of eigenvalues two consecutive elements of s are set to the same value. Thus s(j), dif(j), and the jth columns of VL and VR all correspond to the same eigenpair (but not in general the jth eigenpair, unless all eigenpairs are selected).
If job='V', s is not referenced.
14: dif(*) Real (Kind=nag_wp) array Output
Note: the dimension of the array dif must be at least max(1,mm) if job='V' or 'B'.
On exit: if job='V' or 'B', the estimated reciprocal condition numbers of the selected eigenvectors, stored in consecutive elements of the array. For a complex eigenvector two consecutive elements of dif are set to the same value. If the eigenvalues cannot be reordered to compute dif(j), dif(j) is set to 0; this can only occur when the true value would be very small anyway.
If job='E', dif is not referenced.
15: mm Integer Input
On entry: the number of elements in the arrays s and dif.
Constraints:
  • if howmny='A', mmn;
  • otherwise mmm.
16: m Integer Output
On exit: m, the number of elements of the arrays s and dif used to store the specified condition numbers; for each selected real eigenvalue one element is used, and for each selected complex conjugate pair of eigenvalues, two elements are used. If howmny='A', m is set to n.
17: work(max(1,lwork)) Real (Kind=nag_wp) array Workspace
On exit: if info=0, work(1) contains the minimum value of lwork required for optimal performance.
18: lwork Integer Input
On entry: the dimension of the array work as declared in the (sub)program from which f08ylf is called.
If lwork=-1, 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 lwork-1,
  • if job='V' or 'B', lwork2×n×(n+2)+16;
  • otherwise lworkmax(1,n).
19: iwork(*) Integer array Workspace
Note: the dimension of the array iwork must be at least (n+6).
If job='E', iwork is not referenced.
20: info Integer Output
On exit: info=0 unless the routine detects an error (see Section 6).

6 Error Indicators and Warnings

info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

7 Accuracy

Not applicable.

8 Parallelism and Performance

f08ylf 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.

9 Further Comments

An approximate asymptotic error bound on the chordal distance between the computed eigenvalue λ~ and the corresponding exact eigenvalue λ is
χ(λ~,λ) ε(A,B)F / S(λ)  
where ε is the machine precision.
An approximate asymptotic error bound for the right or left computed eigenvectors x~ or y~ corresponding to the right and left eigenvectors x and y is given by
θ(z~,z) ε (A,B)F / Dif .  
The complex analogue of this routine is f08yyf.

10 Example

This example estimates condition numbers and approximate error estimates for all the eigenvalues and eigenvalues and right eigenvectors of the pair (S,T) given by
S = ( 4.0 1.0 1.0 2.0 0.0 3.0 -1.0 1.0 0.0 1.0 3.0 1.0 0.0 0.0 0.0 6.0 )   and   T= ( 2.0 1.0 1.0 3.0 0.0 1.0 0.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 2.0 ) .  
The eigenvalues and eigenvectors are computed by calling f08ykf.

10.1 Program Text

Program Text (f08ylfe.f90)

10.2 Program Data

Program Data (f08ylfe.d)

10.3 Program Results

Program Results (f08ylfe.r)