XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ dtrsna()

void dtrsna ( char  job,
char  howmny,
int  select[],
int  n,
int  ldt,
double  t[],
int  ldvl,
double  vl[],
int  ldvr,
double  vr[],
double  s[],
double  sep[],
int  mm,
int *  m,
double  work[],
int  lwork,
int  iwork[],
int  liwork,
int *  info 
)

Condition numbers for eigenvalues and/or eigenvectors of upper quasi-triangular matrix

Purpose
This routine estimates reciprocal condition numbers for specified eigenvalues and/or right eigenvectors of a real upper quasi-triangular matrix T (or of any matrix Q*T*Q^T with Q orthogonal).

T must be in Schur canonical form (as returned by dhseqr), that is, block upper triangular with 1 x 1 and 2 x 2 diagonal blocks; each 2 x 2 diagonal block has its diagonal elements equal and its off-diagonal elements of opposite sign.
Parameters
[in]jobSpecifies whether condition numbers are required for eigenvalues (s) or eigenvectors (sep).
= 'E': For eigenvalues only (s).
= 'V': For eigenvectors only (sep).
= 'B': For both eigenvalues and eigenvectors (s and sep).
[in]howmny= 'A': Compute condition numbers for all eigenpairs.
= 'S': Compute condition numbers for selected eigenpairs specified by the array select[].
[in]select[]Array select[lselect] (lselect >= n)
If howmny = 'S', select[] specifies the eigenpairs for which condition numbers are required. To select condition numbers for the eigenpair corresponding to a real eigenvalue w[j], select[j] must be set to true. To select condition numbers corresponding to a complex conjugate pair of eigenvalues w[j] and w[j+1], either select[j] or select[j+1] or both, must be set to true.
If howmny = 'A', select[] is not referenced.
[in]nOrder of the matrix T. (n >= 0) (If n = 0, returns without computation)
[in]ldtLeading dimension of the two dimensional array t[][]. (ldt >= max(1, n))
[in]t[][]Array t[lt][ldt] (lt >= n)
The upper quasi-triangular matrix T in Schur canonical form.
[in]ldvlLeading dimension of the two dimensional array vl[][]. (ldvl >= 1 if job = 'V', ldvl >= n if job = 'E' or 'B')
[in]vl[][]Array vl[lvl][ldvl] (lvl >= mm)
If job = 'E' or 'B', vl[][] must contain left eigenvectors of T (or of any Q*T*Q^T with Q orthogonal), corresponding to the eigenpairs specified by howmny and select[]. The eigenvectors must be stored in consecutive rows of vl[][], as returned by dhsein or dtrevc.
If job = 'V', vl[][] is not referenced.
[in]ldvrLeading dimension of the two dimensional array vr[][]. (ldvr >= 1 if job = 'V', ldvr >= n if job = 'E' or 'B')
[in]vr[][]Array vr[lvr][ldvr] (lvr >= mm)
If job = 'E' or 'B', vr[][] must contain right eigenvectors of T (or of any Q*T*Q^T with Q orthogonal), corresponding to the eigenpairs specified by howmny and select[]. The eigenvectors must be stored in consecutive rows of vr[][], as returned by dhsein or dtrevc.
If job = 'V', vr[][] is not referenced.
[out]s[]Array s[ls] (ls >= mm)
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], sep[j], and the j-th rows of vl[][] and vr[][] all correspond to the same eigenpair (but not in general the j-th eigenpair, unless all eigenpairs are selected).
If job = 'V', s[] is not referenced.
[out]sep[]Array sep[lsep] (lsep >= mm)
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 sep[] are set to the same value. If the eigenvalues cannot be reordered to compute sep[j], sep[j] is set to 0; this can only occur when the true value would be very small anyway.
If job = 'E', sep[] is not referenced.
[in]mmThe number of elements in the arrays s[] (if job = 'E' or 'B') and/or sep[] (if job = 'V' or 'B'). (mm >= m)
[out]mThe number of elements of the arrays s[] and/or sep[] actually used to store the estimated condition numbers.
If howmny = 'A', m is set to n.
[out]work[]Array work[lwork]
Work array.
If job = 'E', work[] is not referenced.
[in]lworkThe dimension of the array work[]. (lwork >= n*(n + 6) if job = 'V' or 'B')
[out]iwork[]Array iwork[liwork]
Integer work array.
If job = 'E', iwork[] is not referenced.
[in]liworkThe dimension of the array iwork[]. (liwork >= 2*(n - 1) if job = 'V' or 'B')
[out]info= 0: Successful exit
= -1: The argument job had an illegal value (job != 'E', 'V' nor 'B')
= -2: The argument howmny had an illegal value (hownmy != 'A' nor 'S')
= -4: The argument n had an illegal value (n < 0)
= -5: The argument ldt had an illegal value (ldt < max(1, n))
= -7: The argument ldvl had an illegal value (ldvl too small)
= -9: The argument ldvr had an illegal value (ldvr too small)
= -13: The argument mm had an illegal value (mm < m)
= -16: The argument lwork had an illegal value (lwork too small)
= -18: The argument liwork had an illegal value (liwork too small)
Further Details
The reciprocal of the condition number of an eigenvalue lambda is defined as
s(lambda) = |v^T*u| / (norm(u)*norm(v))
where u and v are the right and left eigenvectors of T corresponding to lambda; v^T denotes the transpose of v, and norm(u) denotes the Euclidean norm. These reciprocal condition numbers always lie between zero (very badly conditioned) and one (very well conditioned). If n = 1, s(lambda) is defined to be 1.

An approximate error bound for a computed eigenvalue w(i) is given by
eps * norm(T) / s(i)
where eps is the machine precision.

The reciprocal of the condition number of the right eigenvector u corresponding to lambda is defined as follows. Suppose
T = ( lambda c )
( 0 T22 )
Then the reciprocal condition number is
sep( lambda, T22 ) = sigma-min( T22 - lambda*I )
where sigma-min denotes the smallest singular value. We approximate the smallest singular value by the reciprocal of an estimate of the one-norm of the inverse of T22 - lambda*I. If n = 1, sep(1) is defined to be abs(T(1,1)).

An approximate error bound for a computed right eigenvector vr(i) is given by
eps * norm(T) / sep(i)
Reference
LAPACK