NAG CL Interface
f08ylc (dtgsna)

Settings help

CL Name Style:


1 Purpose

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

2 Specification

#include <nag.h>
void  f08ylc (Nag_OrderType order, Nag_JobType job, Nag_HowManyType howmny, const Nag_Boolean select[], Integer n, const double a[], Integer pda, const double b[], Integer pdb, const double vl[], Integer pdvl, const double vr[], Integer pdvr, double s[], double dif[], Integer mm, Integer *m, NagError *fail)
The function may be called by the names: f08ylc, nag_lapackeig_dtgsna or nag_dtgsna.

3 Description

f08ylc estimates condition numbers for specified eigenvalues and/or right eigenvectors of an n×n matrix pair (S,T) in real generalized Schur form. The function 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 f08xbc or f08xcc, or f08xec with job=Nag_Schur. 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: order Nag_OrderType Input
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 order=Nag_RowMajor. See Section 3.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2: job Nag_JobType Input
On entry: indicates whether condition numbers are required for eigenvalues and/or eigenvectors.
job=Nag_EigVals
Condition numbers for eigenvalues only are computed.
job=Nag_EigVecs
Condition numbers for eigenvectors only are computed.
job=Nag_DoBoth
Condition numbers for both eigenvalues and eigenvectors are computed.
Constraint: job=Nag_EigVals, Nag_EigVecs or Nag_DoBoth.
3: howmny Nag_HowManyType Input
On entry: indicates how many condition numbers are to be computed.
howmny=Nag_ComputeAll
Condition numbers for all eigenpairs are computed.
howmny=Nag_ComputeSelected
Condition numbers for selected eigenpairs (as specified by select) are computed.
Constraint: howmny=Nag_ComputeAll or Nag_ComputeSelected.
4: select[dim] const Nag_Boolean Input
Note: the dimension, dim, of the array select must be at least
  • n when howmny=Nag_ComputeSelected;
  • otherwise select may be NULL.
On entry: specifies the eigenpairs for which condition numbers are to be computed if howmny=Nag_ComputeSelected. To select condition numbers for the eigenpair corresponding to the real eigenvalue λj, select[j-1] must be set Nag_TRUE. To select condition numbers corresponding to a complex conjugate pair of eigenvalues λj and λj+1, select[j-1] and/or select[j] must be set to Nag_TRUE.
If howmny=Nag_ComputeAll, select is not referenced and may be NULL.
5: n Integer Input
On entry: n, the order of the matrix pair (S,T).
Constraint: n0.
6: a[dim] const double Input
Note: the dimension, dim, of the array a must be at least pda×n.
The (i,j)th element of the matrix A is stored in
  • a[(j-1)×pda+i-1] when order=Nag_ColMajor;
  • a[(i-1)×pda+j-1] when order=Nag_RowMajor.
On entry: the upper quasi-triangular matrix S.
7: pda Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array a.
Constraint: pdamax(1,n).
8: b[dim] const double Input
Note: the dimension, dim, of the array b must be at least pdb×n.
The (i,j)th element of the matrix B is stored in
  • b[(j-1)×pdb+i-1] when order=Nag_ColMajor;
  • b[(i-1)×pdb+j-1] when order=Nag_RowMajor.
On entry: the upper triangular matrix T.
9: pdb Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array b.
Constraint: pdbmax(1,n).
10: vl[dim] const double Input
Note: the dimension, dim, of the array vl must be at least
  • pdvl×mm when job=Nag_EigVals or Nag_DoBoth and order=Nag_ColMajor;
  • n×pdvl when job=Nag_EigVals or Nag_DoBoth and order=Nag_RowMajor;
  • otherwise vl may be NULL.
The (i,j)th element of the matrix is stored in
  • vl[(j-1)×pdvl+i-1] when order=Nag_ColMajor;
  • vl[(i-1)×pdvl+j-1] when order=Nag_RowMajor.
On entry: if job=Nag_EigVals or Nag_DoBoth, 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 f08wcc or f08ykc.
If job=Nag_EigVecs, vl is not referenced and may be NULL.
11: pdvl Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array vl.
Constraints:
  • if order=Nag_ColMajor,
    • if job=Nag_EigVals or Nag_DoBoth, pdvl n ;
    • otherwise pdvl1;
  • if order=Nag_RowMajor,
    • if job=Nag_EigVals or Nag_DoBoth, pdvlmm;
    • otherwise vl may be NULL.
12: vr[dim] const double Input
Note: the dimension, dim, of the array vr must be at least
  • pdvr×mm when job=Nag_EigVals or Nag_DoBoth and order=Nag_ColMajor;
  • n×pdvr when job=Nag_EigVals or Nag_DoBoth and order=Nag_RowMajor;
  • otherwise vr may be NULL.
The (i,j)th element of the matrix is stored in
  • vr[(j-1)×pdvr+i-1] when order=Nag_ColMajor;
  • vr[(i-1)×pdvr+j-1] when order=Nag_RowMajor.
On entry: if job=Nag_EigVals or Nag_DoBoth, 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 f08wcc or f08ykc.
If job=Nag_EigVecs, vr is not referenced and may be NULL.
13: pdvr Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array vr.
Constraints:
  • if order=Nag_ColMajor,
    • if job=Nag_EigVals or Nag_DoBoth, pdvr n ;
    • otherwise pdvr1;
  • if order=Nag_RowMajor,
    • if job=Nag_EigVals or Nag_DoBoth, pdvrmm;
    • otherwise vr may be NULL.
14: s[dim] double Output
Note: the dimension, dim, of the array s must be at least
  • mm when job=Nag_EigVals or Nag_DoBoth;
  • otherwise s may be NULL.
On exit: if job=Nag_EigVals or Nag_DoBoth, 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-1], dif[j-1], 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=Nag_EigVecs, s is not referenced and may be NULL.
15: dif[dim] double Output
Note: the dimension, dim, of the array dif must be at least
  • mm when job=Nag_EigVecs or Nag_DoBoth;
  • otherwise dif may be NULL.
On exit: if job=Nag_EigVecs or Nag_DoBoth, 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-1], dif[j-1] is set to 0; this can only occur when the true value would be very small anyway.
If job=Nag_EigVals, dif is not referenced and may be NULL.
16: mm Integer Input
On entry: the number of elements in the arrays s and dif.
Constraints:
  • if howmny=Nag_ComputeAll, mmn;
  • otherwise mmm.
17: 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=Nag_ComputeAll, m is set to n.
18: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_ENUM_INT_2
On entry, job=value, pdvl=value and mm=value.
Constraint: if job=Nag_EigVals or Nag_DoBoth, pdvlmm.
On entry, job=value, pdvl=value and n=value.
Constraint: if job=Nag_EigVals or Nag_DoBoth, pdvl n .
On entry, job=value, pdvr=value and mm=value.
Constraint: if job=Nag_EigVals or Nag_DoBoth, pdvrmm.
On entry, job=value, pdvr=value and n=value.
Constraint: if job=Nag_EigVals or Nag_DoBoth, pdvr n .
NE_ENUM_INT_3
On entry, howmny=value, n=value, mm=value and m=value.
Constraint: if howmny=Nag_ComputeAll, mmn;
otherwise mmm.
NE_INT
On entry, n=value.
Constraint: n0.
On entry, pda=value.
Constraint: pda>0.
On entry, pdb=value.
Constraint: pdb>0.
On entry, pdvl=value.
Constraint: pdvl>0.
On entry, pdvr=value.
Constraint: pdvr>0.
NE_INT_2
On entry, pda=value and n=value.
Constraint: pdamax(1,n).
On entry, pdb=value and n=value.
Constraint: pdbmax(1,n).
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 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

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

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 function is f08yyc.

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

10.1 Program Text

Program Text (f08ylce.c)

10.2 Program Data

Program Data (f08ylce.d)

10.3 Program Results

Program Results (f08ylce.r)