naginterfaces.library.lapackeig.ztrsna¶
- naginterfaces.library.lapackeig.ztrsna(job, howmny, t, select=None, vl=None, vr=None)[source]¶
ztrsna
estimates condition numbers for specified eigenvalues and/or right eigenvectors of a complex upper triangular matrix.For full information please refer to the NAG Library document for f08qy
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f08/f08qyf.html
- Parameters
- jobstr, length 1
Indicates whether condition numbers are required for eigenvalues and/or eigenvectors.
Condition numbers for eigenvalues only are computed.
Condition numbers for eigenvectors only are computed.
Condition numbers for both eigenvalues and eigenvectors are computed.
- howmnystr, length 1
Indicates how many condition numbers are to be computed.
Condition numbers for all eigenpairs are computed.
Condition numbers for selected eigenpairs (as specified by ) are computed.
- tcomplex, array-like, shape
The upper triangular matrix , as returned by
zhseqr()
.- selectNone or bool, array-like, shape , optional
Note: the required length for this argument is determined as follows: if : ; otherwise: .
Specifies the eigenpairs for which condition numbers are to be computed if . To select condition numbers for the eigenpair corresponding to the eigenvalue , must be set to .
If , is not referenced.
- vlNone or complex, array-like, shape , optional
Note: the required extent for this argument in dimension 1 is determined as follows: if : ; if : ; otherwise: .
Note: the required extent for this argument in dimension 2 is determined as follows: if : ; otherwise: .
If or , must contain the left eigenvectors of (or of any matrix with unitary) corresponding to the eigenpairs specified by and . The eigenvectors must be stored in consecutive columns of , as returned by
ztrevc()
orzhsein()
.If , is not referenced.
- vrNone or complex, array-like, shape , optional
Note: the required extent for this argument in dimension 1 is determined as follows: if : ; if : ; otherwise: .
Note: the required extent for this argument in dimension 2 is determined as follows: if : ; otherwise: .
If or , must contain the right eigenvectors of (or of any matrix with unitary) corresponding to the eigenpairs specified by and . The eigenvectors must be stored in consecutive columns of , as returned by
ztrevc()
orzhsein()
.If , is not referenced.
- Returns
- sNone or float, ndarray, shape
The reciprocal condition numbers of the selected eigenvalues if or , stored in consecutive elements of the array. Thus , and the th columns of and all correspond to the same eigenpair (but not in general the th eigenpair unless all eigenpairs have been selected).
If , is not referenced.
- sepNone or float, ndarray, shape
The estimated reciprocal condition numbers of the selected right eigenvectors if or , stored in consecutive elements of the array.
If , is not referenced.
- mint
, the number of selected eigenpairs. If , is set to .
- Raises
- NagValueError
- (errno )
On entry, error in parameter .
Constraint: , or .
- (errno )
On entry, error in parameter .
Constraint: or .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
On entry, error in parameter .
Constraint: .
- Notes
ztrsna
estimates condition numbers for specified eigenvalues and/or right eigenvectors of a complex upper triangular matrix . These are the same as the condition numbers of the eigenvalues and right eigenvectors of an original matrix (with unitary ), from which may have been derived.ztrsna
computes the reciprocal of the condition number of an eigenvalue aswhere and are the right and left eigenvectors of , respectively, corresponding to . 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 is then given by
where is the machine precision.
To estimate the reciprocal of the condition number of the right eigenvector corresponding to , the function first calls
ztrexc()
to reorder the eigenvalues so that is in the leading position:The reciprocal condition number of the eigenvector is then estimated as , the smallest singular value of the matrix . 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 corresponding to is then given by
- References
Golub, G H and Van Loan, C F, 1996, Matrix Computations, (3rd Edition), Johns Hopkins University Press, Baltimore