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

◆ ztrsna()

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

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

Purpose
This routine estimates reciprocal condition numbers for specified eigenvalues and/or right eigenvectors of a complex upper triangular matrix T (or of any matrix Q*T*Q^H with Q unitary).
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 j-th eigenpair, select[j] 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 triangular matrix T.
[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 >= m)
If job = 'E' or 'B', vl must contain left eigenvectors of T (or of any Q*T*Q^H with Q unitary), corresponding to the eigenpairs specified by howmny and select. The eigenvectors must be stored in consecutive columns of vl, as returned by zhsein or ztrevc3.
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 >= m)
If job = 'E' or 'B', vr must contain right eigenvectors of T (or of any Q*T*Q^H with Q unitary), corresponding to the eigenpairs specified by howmny and select. The eigenvectors must be stored in consecutive columns of vr, as returned by zhsein or ztrevc3.
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. 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.
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]
Complex 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]rwork[]Array rwork[lrwork] (lrwork >= n)
Work array.
If job = 'E', rwork[] is not referenced.
[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)
Further Details
The reciprocal of the condition number of an eigenvalue lambda is defined as
s(lambda) = |v^H*u| / (norm(u)*norm(v))
where u and v are the right and left eigenvectors of T corresponding to lambda; v^H denotes the conjugate 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