hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_dtrsna (f08ql)

Purpose

nag_lapack_dtrsna (f08ql) estimates condition numbers for specified eigenvalues and/or right eigenvectors of a real upper quasi-triangular matrix.

Syntax

[s, sep, m, info] = f08ql(job, howmny, select, t, vl, vr, mm, 'n', n)
[s, sep, m, info] = nag_lapack_dtrsna(job, howmny, select, t, vl, vr, mm, 'n', n)

Description

nag_lapack_dtrsna (f08ql) estimates condition numbers for specified eigenvalues and/or right eigenvectors of a real upper quasi-triangular matrix TT in canonical Schur form. These are the same as the condition numbers of the eigenvalues and right eigenvectors of an original matrix A = ZTZTA=ZTZT (with orthogonal ZZ), from which TT may have been derived.
nag_lapack_dtrsna (f08ql) computes the reciprocal of the condition number of an eigenvalue λiλi as
si = (|vHu|)/(uEvE) ,
si = |vHu| uEvE ,
where uu and vv are the right and left eigenvectors of TT, respectively, corresponding to λiλi. This reciprocal condition number always lies between zero (i.e., ill-conditioned) and one (i.e., well-conditioned).
An approximate error estimate for a computed eigenvalue λiλi is then given by
(εT)/(si) ,
εT si ,
where εε is the machine precision.
To estimate the reciprocal of the condition number of the right eigenvector corresponding to λiλi, the function first calls nag_lapack_dtrexc (f08qf) to reorder the eigenvalues so that λiλi is in the leading position:
T = Q
(λicT)
0 T22
QT.
T =Q λi cT 0 T22 QT.
The reciprocal condition number of the eigenvector is then estimated as sepisepi, the smallest singular value of the matrix (T22λiI)(T22-λiI). This number ranges from zero (i.e., ill-conditioned) to very large (i.e., well-conditioned).
An approximate error estimate for a computed right eigenvector uu corresponding to λiλi is then given by
(εT)/(sepi) .
εT sepi .

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     job – string (length ≥ 1)
Indicates whether condition numbers are required for eigenvalues and/or eigenvectors.
job = 'E'job='E'
Condition numbers for eigenvalues only are computed.
job = 'V'job='V'
Condition numbers for eigenvectors only are computed.
job = 'B'job='B'
Condition numbers for both eigenvalues and eigenvectors are computed.
Constraint: job = 'E'job='E', 'V''V' or 'B''B'.
2:     howmny – string (length ≥ 1)
Indicates how many condition numbers are to be computed.
howmny = 'A'howmny='A'
Condition numbers for all eigenpairs are computed.
howmny = 'S'howmny='S'
Condition numbers for selected eigenpairs (as specified by select) are computed.
Constraint: howmny = 'A'howmny='A' or 'S''S'.
3:     select( : :) – logical array
Note: the dimension of the array select must be at least max (1,n)max(1,n) if howmny = 'S'howmny='S', and at least 11 otherwise.
Specifies the eigenpairs for which condition numbers are to be computed if howmny = 'S'howmny='S'. To select condition numbers for the eigenpair corresponding to the real eigenvalue λjλj, select(j)selectj must be set true. To select condition numbers corresponding to a complex conjugate pair of eigenvalues λjλj and λj + 1λj+1, select(j)selectj and/or select(j + 1)selectj+1 must be set to true.
If howmny = 'A'howmny='A', select is not referenced.
4:     t(ldt, : :) – double array
The first dimension of the array t must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
The nn by nn upper quasi-triangular matrix TT in canonical Schur form, as returned by nag_lapack_dhseqr (f08pe).
5:     vl(ldvl, : :) – double array
The first dimension, ldvl, of the array vl must satisfy
  • if job = 'E'job='E' or 'B''B', ldvl max (1,n) ldvl max(1,n) ;
  • if job = 'V'job='V', ldvl1ldvl1.
The second dimension of the array must be at least max (1,mm)max(1,mm) if job = 'E'job='E' or 'B''B' and at least 11 if job = 'V'job='V'
If job = 'E'job='E' or 'B''B', vl must contain the left eigenvectors of TT (or of any matrix QTQTQTQT with QQ orthogonal) corresponding to the eigenpairs specified by howmny and select. The eigenvectors must be stored in consecutive columns of vl, as returned by nag_lapack_dhsein (f08pk) or nag_lapack_dtrevc (f08qk).
If job = 'V'job='V', vl is not referenced.
6:     vr(ldvr, : :) – double array
The first dimension, ldvr, of the array vr must satisfy
  • if job = 'E'job='E' or 'B''B', ldvr max (1,n) ldvr max(1,n) ;
  • if job = 'V'job='V', ldvr1ldvr1.
The second dimension of the array must be at least max (1,mm)max(1,mm) if job = 'E'job='E' or 'B''B' and at least 11 if job = 'V'job='V'
If job = 'E'job='E' or 'B''B', vr must contain the right eigenvectors of TT (or of any matrix QTQTQTQT with QQ orthogonal) corresponding to the eigenpairs specified by howmny and select. The eigenvectors must be stored in consecutive columns of vr, as returned by nag_lapack_dhsein (f08pk) or nag_lapack_dtrevc (f08qk).
If job = 'V'job='V', vr is not referenced.
7:     mm – int64int32nag_int scalar
The number of elements in the arrays s and sep, and the number of columns in the arrays vl and vr (if used). The precise number required, mm, is nn if howmny = 'A'howmny='A'; if howmny = 'S'howmny='S', mm is obtained by counting 11 for each selected real eigenvalue, and 22 for each selected complex conjugate pair of eigenvalues (see select), in which case 0mn0mn.
Constraint: mmmmmm.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array t and the second dimension of the array t. (An error is raised if these dimensions are not equal.)
nn, the order of the matrix TT.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

ldt ldvl ldvr work ldwork iwork

Output Parameters

1:     s( : :) – double array
Note: the dimension of the array s must be at least max (1,mm)max(1,mm) if job = 'E'job='E' or 'B''B' and at least 11 if job = 'V'job='V'.
The reciprocal condition numbers of the selected eigenvalues if job = 'E'job='E' or 'B''B', stored in consecutive elements of the array. Thus s(j)sj, sep(j)sepj and the jjth columns of vl and vr all correspond to the same eigenpair (but not in general the jjth eigenpair unless all eigenpairs have been selected). For a complex conjugate pair of eigenvalues, two consecutive elements of s are set to the same value.
s is not referenced if job = 'V'job='V'.
2:     sep( : :) – double array
Note: the dimension of the array sep must be at least max (1,mm)max(1,mm) if job = 'V'job='V' or 'B''B' and at least 11 if job = 'E'job='E'.
The estimated reciprocal condition numbers of the selected right eigenvectors if job = 'V'job='V' or 'B''B', stored in consecutive elements of the array. For a complex eigenvector, two consecutive elements of sep are set to the same value. If the eigenvalues cannot be reordered to compute sep(j)sepj, then sep(j)sepj is set to zero; this can only occur when the true value would be very small anyway.
If job = 'E'job='E', sep is not referenced.
3:     m – int64int32nag_int scalar
mm, the number of elements of s and/or sep actually used to store the estimated condition numbers. If howmny = 'A'howmny='A', m is set to nn.
4:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: job, 2: howmny, 3: select, 4: n, 5: t, 6: ldt, 7: vl, 8: ldvl, 9: vr, 10: ldvr, 11: s, 12: sep, 13: mm, 14: m, 15: work, 16: ldwork, 17: iwork, 18: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.

Accuracy

The computed values sepisepi may over estimate the true value, but seldom by a factor of more than 33.

Further Comments

For a description of canonical Schur form, see the document for nag_lapack_dhseqr (f08pe).
The complex analogue of this function is nag_lapack_ztrsna (f08qy).

Example

function nag_lapack_dtrsna_example
job = 'Both';
howmny = 'All';
select = [false];
t = [0.7995, -0.1144, 0.006, 0.0336;
     0, -0.0994, 0.2478, 0.3474;
     0, -0.6483, -0.0994, 0.2026;
     0, 0, 0, -0.1007];
vl = [1, 0, 0, 0;
     -0.1101757724599591, 0.8492971136777001, 0, 0;
     -0.02369735945664465, 0, 0.5250761453388553, 0;
     -0.01052671448401023, -0.2630232022148211, 0.7369767977851788, 1];
vr = [1, 0.06811593844054897, 0.02369735945664464, 0.008112867113990377;
     0, 0.6182478862610575, 0, 0.2206494686069181;
     0, 0, 1, -1;
     0, 0, 0, 0.7124731021612292];
mm = int64(4);
[s, sep, m, info] = nag_lapack_dtrsna(job, howmny, select, t, vl, vr, mm)
 

s =

    0.9937
    0.7028
    0.7028
    0.5711


sep =

    0.6252
    0.3743
    0.3743
    0.3125


m =

                    4


info =

                    0


function f08ql_example
job = 'Both';
howmny = 'All';
select = [false];
t = [0.7995, -0.1144, 0.006, 0.0336;
     0, -0.0994, 0.2478, 0.3474;
     0, -0.6483, -0.0994, 0.2026;
     0, 0, 0, -0.1007];
vl = [1, 0, 0, 0;
     -0.1101757724599591, 0.8492971136777001, 0, 0;
     -0.02369735945664465, 0, 0.5250761453388553, 0;
     -0.01052671448401023, -0.2630232022148211, 0.7369767977851788, 1];
vr = [1, 0.06811593844054897, 0.02369735945664464, 0.008112867113990377;
     0, 0.6182478862610575, 0, 0.2206494686069181;
     0, 0, 1, -1;
     0, 0, 0, 0.7124731021612292];
mm = int64(4);
[s, sep, m, info] = f08ql(job, howmny, select, t, vl, vr, mm)
 

s =

    0.9937
    0.7028
    0.7028
    0.5711


sep =

    0.6252
    0.3743
    0.3743
    0.3125


m =

                    4


info =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013