naginterfaces.library.lapackeig.ztgsna

naginterfaces.library.lapackeig.ztgsna(job, howmny, a, b, mm, select=None, vl=None, vr=None)[source]

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

For full information please refer to the NAG Library document for f08yy

https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f08/f08yyf.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.

acomplex, array-like, shape

The upper triangular matrix .

bcomplex, array-like, shape

The upper triangular matrix .

mmint

The number of elements in the arrays and .

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 : ; otherwise: .

Note: the required extent for this argument in dimension 2 is determined as follows: if : ; otherwise: .

If or , must contain left eigenvectors of , corresponding to the eigenpairs specified by and . The eigenvectors must be stored in consecutive columns of , as returned by zggev3() or ztgevc().

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 : ; otherwise: .

Note: the required extent for this argument in dimension 2 is determined as follows: if : ; otherwise: .

If or , must contain right eigenvectors of , corresponding to the eigenpairs specified by and . The eigenvectors must be stored in consecutive columns of , as returned by zggev3() or ztgevc().

If , is not referenced.

Returns
sfloat, ndarray, shape

If or , the reciprocal condition numbers of the selected eigenvalues, stored in consecutive elements of the array.

If , is not referenced.

diffloat, ndarray, shape

If or , the estimated reciprocal condition numbers of the selected eigenvectors, stored in consecutive elements of the array. If the eigenvalues cannot be reordered to compute , is set to ; this can only occur when the true value would be very small anyway.

If , is not referenced.

mint

The number of elements of the arrays and used to store the specified condition numbers; for each selected eigenvalue one element is used.

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

ztgsna estimates condition numbers for specified eigenvalues and/or right eigenvectors of an matrix pair in generalized Schur form. The function actually returns estimates of the reciprocals of the condition numbers in order to avoid possible overflow.

The pair are in generalized Schur form if and are upper triangular as returned, for example, by zgges3() or zggesx(), or zhgeqz() with . The diagonal elements define the generalized eigenvalues , for , of the pair and the eigenvalues are given by

so that

where is the corresponding (right) eigenvector.

If and are the result of a generalized Schur factorization of a matrix pair

then the eigenvalues and condition numbers of the pair are the same as those of the pair .

Let be a simple generalized eigenvalue of . Then the reciprocal of the condition number of the eigenvalue is defined as

where and are the right and left eigenvectors of corresponding to . If both and are zero, then is singular and is returned.

If and are unitary transformations such that

where and are matrices, then the reciprocal condition number is given by

where denotes the smallest singular value of the matrix

and is the Kronecker product.

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.

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