Developer Reference for Intel® oneAPI Math Kernel Library for C
?gges3
Computes generalized Schur factorization for a pair of matrices.
Syntax
lapack_intLAPACKE_sgges3 ( intmatrix_layout , charjobvsl , charjobvsr , charsort , LAPACK_S_SELECT3selctg , lapack_intn , float*a , lapack_intlda , float*b , lapack_intldb , lapack_int*sdim , float*alphar , float*alphai , float*beta , float*vsl , lapack_intldvsl , float*vsr , lapack_intldvsr );
lapack_intLAPACKE_dgges3 ( intmatrix_layout , charjobvsl , charjobvsr , charsort , LAPACK_D_SELECT3selctg , lapack_intn , double*a , lapack_intlda , double*b , lapack_intldb , lapack_int*sdim , double*alphar , double*alphai , double*beta , double*vsl , lapack_intldvsl , double*vsr , lapack_intldvsr );
lapack_intLAPACKE_cgges3 ( intmatrix_layout , charjobvsl , charjobvsr , charsort , LAPACK_C_SELECT2selctg , lapack_intn , lapack_complex_float*a , lapack_intlda , lapack_complex_float*b , lapack_intldb , lapack_int*sdim , lapack_complex_float*alpha , lapack_complex_float*beta , lapack_complex_float*vsl , lapack_intldvsl , lapack_complex_float*vsr , lapack_intldvsr );
lapack_intLAPACKE_zgges3 ( intmatrix_layout , charjobvsl , charjobvsr , charsort , LAPACK_Z_SELECT2selctg , lapack_intn , lapack_complex_double*a , lapack_intlda , lapack_complex_double*b , lapack_intldb , lapack_int*sdim , lapack_complex_double*alpha , lapack_complex_double*beta , lapack_complex_double*vsl , lapack_intldvsl , lapack_complex_double*vsr , lapack_intldvsr );
Include Files
mkl.h
Description
For a pair of n -by- n real or complex nonsymmetric matrices ( A , B ), ?gges3 computes the generalized eigenvalues, the generalized real or complex Schur form ( S , T ), and optionally the left or right matrices of Schur vectors ( VSL and VSR ). This gives the generalized Schur factorization
( A , B ) = ( ( VSL )* S *( VSR ) T , ( VSL )* T *( VSR ) T ) for real ( A , B )
or
( A , B ) = ( ( VSL )* S *( VSR ) H , ( VSL )* T *( VSR ) H ) for complex ( A , B )
where ( VSR ) H is the conjugate-transpose of VSR .
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T . The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces).
A generalized eigenvalue for a pair of matrices ( A , B ) is a scalar w or a ratio alpha / beta = w , such that A - w *B is singular. It is usually represented as the pair ( alpha , beta ), as there is a reasonable interpretation for beta =0 or both being zero.
For real flavors:
A pair of matrices ( S , T ) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be “standardized” by making the corresponding elements of T have the form:
and the pair of corresponding 2-by-2 blocks in S and T have a complex conjugate pair of generalized eigenvalues.
For complex flavors:
A pair of matrices ( S , T ) is in generalized complex Schur form if S and T are upper triangular and, in addition, the diagonal elements of T are non-negative real numbers.
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
jobvsl
= ‘N’: do not compute the left Schur vectors;
jobvsr
= ‘N’: do not compute the right Schur vectors;
= ‘V’: compute the right Schur vectors.
sort
Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.
= ‘N’: Eigenvalues are not ordered; = ‘S’: Eigenvalues are ordered (see selctg ).
selctg
selctg is a function of three arguments for real flavors or two arguments for complex flavors. selctg must be declared EXTERNAL in the calling subroutine. If sort = ‘N’, selctg is not referenced. If sort = ‘S’, selctg is used to select eigenvalues to sort to the top left of the Schur form.
For real flavors: An eigenvalue ( alphar(j)[j - 1] + alphai(j)[j - 1] )/ beta(j)[j - 1] is selected if selctg ( alphar(j)[j - 1] , alphai(j)[j - 1] , beta(j)[j - 1] ) is true. In other words, if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected.
Note that in the ill-conditioned case, a selected complex eigenvalue may no longer satisfy selctg ( alphar(j)[j - 1] , alphai(j)[j - 1] , beta(j)[j - 1] ) = .TRUE. ≠ 0 after ordering. info is to be set to n +2 in this case.
For complex flavors: An eigenvalue alpha(j)[j - 1] / beta(j)[j - 1] is selected if selctg ( alpha(j)[j - 1] , beta(j)[j - 1] ) is true.
Note that a selected complex eigenvalue may no longer satisfy selctg ( alpha(j)[j - 1] , beta(j)[j - 1] ) = .TRUE. ≠ 0 after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned), in this case ?gges3 returns n + 2 .
n
The order of the matrices A , B , VSL , and VSR . n ≥ 0.
- a
-
REAL for sgges3 DOUBLE PRECISION for dgges3 COMPLEX for cgges3 DOUBLE COMPLEX for zgges3
Array, size ( lda * n ) . On entry, the first of the pair of matrices.
lda
The leading dimension of a . lda ≥ max(1, n ).
- b
-
REAL for sgges3 DOUBLE PRECISION for dgges3 COMPLEX for cgges3 DOUBLE COMPLEX for zgges3
Array, size ( ldb * n ) . On entry, the second of the pair of matrices.
ldb
The leading dimension of b . ldb ≥ max(1, n ).
ldvsl
The leading dimension of the matrix VSL . ldvsl ≥ 1, and if jobvsl = ‘V’, ldvsl ≥ n.
ldvsr
The leading dimension of the matrix VSR . ldvsr ≥ 1, and if jobvsr = ‘V’, ldvsr ≥ n.
lwork
The size of the array work . If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
- work
-
REAL for sgges3 DOUBLE PRECISION for dgges3 COMPLEX for cgges3 DOUBLE COMPLEX for zgges3 Array, size (MAX(1, lwork )). On exit, if info = 0, work (1) returns the optimal lwork.
- rwork
-
REAL for cgges3 DOUBLE PRECISION for zgges3 Array, size (8* n ).
bwork
Array, size ( n ). Not referenced if sort = ‘N’.
Output Parameters
- a
-
On exit, a is overwritten by its generalized Schur form S.
- b
-
On exit, b is overwritten by its generalized Schur form T.
sdim
If sort = ‘N’, sdim = 0. If sort = ‘S’, sdim = number of eigenvalues (after sorting) for which selctg is true.
- alpha
-
COMPLEX for cgges3 DOUBLE COMPLEX for zgges3 Array, size ( n ).
- alphar
-
REAL for sgges3 DOUBLE PRECISION for dgges3 Array, size ( n ).
- alphai
-
REAL for sgges3 DOUBLE PRECISION for dgges3 Array, size ( n ).
- beta
-
REAL for sgges3 DOUBLE PRECISION for dgges3 COMPLEX for cgges3 DOUBLE COMPLEX for zgges3 Array, size ( n ).
For real flavors:
On exit, (alphar[j] + alphai[j]*i)/beta[j], j=0,...,n-1 , are the generalized eigenvalues. alphar[j] + alphai[j]*i and beta[j], j=0,...,n-1 are the diagonals of the complex Schur form ( S , T ) that would result if the 2-by-2 diagonal blocks of the real Schur form of ( a , b ) were further reduced to triangular form using 2-by-2 complex unitary transformations. If alphai[j-1] is zero, then the j -th eigenvalue is real; if positive, then the j -th and ( j +1)-st eigenvalues are a complex conjugate pair, with alphai[j+1] negative. Note: the quotients alphar[j]/beta[j] and alphai[j]/beta[j] can easily over- or underflow, and beta[j] might even be zero. Thus, you should avoid computing the ratio alpha / beta by simply dividing alpha by beta . However, alphar and alphai is always less than and usually comparable with norm( a ) in magnitude, and beta is always less than and usually comparable with norm( b ).
For complex flavors:
On exit, alpha[j]/beta[j], j=0,...,n-1 , are the generalized eigenvalues. alpha[j], j=0,...,n-1 and beta[j], j=0,...,n-1 are the diagonals of the complex Schur form ( a , b ) output by ?gges3. The beta[j] will be non-negative real. Note: the quotient alpha[j]/beta[j] can easily over- or underflow, and beta[j] might even be zero. Thus, you should avoid computing the ratio alpha / beta by simply dividing alpha by beta . However, alpha is always less than and usually comparable with norm( a ) in magnitude, and beta is always less than and usually comparable with norm( b ).
- vsl
-
REAL for sgges3 DOUBLE PRECISION for dgges3 COMPLEX for cgges3 DOUBLE COMPLEX for zgges3
Array, size ( ldvsl * n ) .
If jobvsl = ‘V’, vsl contains the left Schur vectors. Not referenced if jobvsl = ‘N’.
- vsr
-
REAL for sgges3 DOUBLE PRECISION for dgges3 COMPLEX for cgges3 DOUBLE COMPLEX for zgges3
Array, size ( ldvsr * n ) .
If jobvsr = ‘V’, vsr contains the right Schur vectors. Not referenced if jobvsr = ‘N’.
Return Values
This function returns a value info .
= 0: successful exit.
< 0: if info = - i , the i -th argument had an illegal value.
=1,…, n :
for real flavors:
The QZ iteration failed. ( a , b ) are not in Schur form, but alphar[j] , alphai[j] and beta[j] should be correct for j = info ,…, n - 1.
The QZ iteration failed. ( a , b ) are not in Schur form, but alpha[j] and beta[j] should be correct for j = info ,…, n - 1.
for complex flavors:
> n :
= n +1: other than QZ iteration failed in ?hgeqz .
= n +2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfy selctg ≠ 0 This could also be caused due to scaling.
= n +3: reordering failed in ?tgsen .