?gges
?gges
Computes the generalized eigenvalues, Schur form, and the left and/or right Schur vectors for a pair of nonsymmetric matrices.
Syntax
lapack_int LAPACKE_sgges
(
int
matrix_layout
,
char
jobvsl
,
char
jobvsr
,
char
sort
,
LAPACK_S_SELECT3
select
,
lapack_int
n
,
float*
a
,
lapack_int
lda
,
float*
b
,
lapack_int
ldb
,
lapack_int*
sdim
,
float*
alphar
,
float*
alphai
,
float*
beta
,
float*
vsl
,
lapack_int
ldvsl
,
float*
vsr
,
lapack_int
ldvsr
);
lapack_int LAPACKE_dgges
(
int
matrix_layout
,
char
jobvsl
,
char
jobvsr
,
char
sort
,
LAPACK_D_SELECT3
select
,
lapack_int
n
,
double*
a
,
lapack_int
lda
,
double*
b
,
lapack_int
ldb
,
lapack_int*
sdim
,
double*
alphar
,
double*
alphai
,
double*
beta
,
double*
vsl
,
lapack_int
ldvsl
,
double*
vsr
,
lapack_int
ldvsr
);
lapack_int LAPACKE_cgges
(
int
matrix_layout
,
char
jobvsl
,
char
jobvsr
,
char
sort
,
LAPACK_C_SELECT2
select
,
lapack_int
n
,
lapack_complex_float*
a
,
lapack_int
lda
,
lapack_complex_float*
b
,
lapack_int
ldb
,
lapack_int*
sdim
,
lapack_complex_float*
alpha
,
lapack_complex_float*
beta
,
lapack_complex_float*
vsl
,
lapack_int
ldvsl
,
lapack_complex_float*
vsr
,
lapack_int
ldvsr
);
lapack_int LAPACKE_zgges
(
int
matrix_layout
,
char
jobvsl
,
char
jobvsr
,
char
sort
,
LAPACK_Z_SELECT2
select
,
lapack_int
n
,
lapack_complex_double*
a
,
lapack_int
lda
,
lapack_complex_double*
b
,
lapack_int
ldb
,
lapack_int*
sdim
,
lapack_complex_double*
alpha
,
lapack_complex_double*
beta
,
lapack_complex_double*
vsl
,
lapack_int
ldvsl
,
lapack_complex_double*
vsr
,
lapack_int
ldvsr
);
Include Files
- mkl.h
Description
The
?gges
routine computes the generalized eigenvalues, the generalized real/complex Schur form (S
,T
), optionally, the left and/or right matrices of Schur vectors (vsl
and vsr
) for a pair of n
-by-n
real/complex nonsymmetric matrices (A
,B
). This gives the generalized Schur factorization(, )
A
,B
) = ( vsl
*S
*vsr
H
vsl
*T
*vsr
H
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/unitary basis for the corresponding left and right eigenspaces (deflating subspaces).If only the generalized eigenvalues are needed, use the driver ggev instead, which is faster.
A generalized eigenvalue for a pair of matrices (, such that is singular. It is usually represented as the pair (), as there is a reasonable interpretation for or for both being zero. A pair of matrices (
A
,B
) is a scalar w
or a ratio alpha
/ beta
= w
A
- w
*B
alpha
, beta
beta
=0S
,T
) is in the 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
are "standardized" by making the corresponding elements of T
have the form:
and the pair of corresponding 2-by-2 blocks in
S
and T
will have a complex conjugate pair of generalized eigenvalues. A pair of matrices (S
,T
) is in generalized complex Schur form if S
and T
are upper triangular and, in addition, the diagonal of T
are non-negative real numbers.The
?gges
routine replaces the deprecated ?gegs
routine.Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- jobvsl
- Must be'N'or'V'.If, then the left Schur vectors are not computed.jobvsl='N'If, then the left Schur vectors are computed.jobvsl='V'
- jobvsr
- Must be'N'or'V'.If, then the right Schur vectors are not computed.jobvsr='N'If, then the right Schur vectors are computed.jobvsr='V'
- sort
- Must be'N'or'S'. Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.If, then eigenvalues are not ordered.sort='N'If, eigenvalues are ordered (seesort='S'select).
- select
- Theselectparameter is a pointer to a function returning a value oflapack_logicaltype. For different flavors the function has different arguments:LAPACKE_sgges:lapack_logical (*LAPACK_S_SELECT3) ( const float*, const float*, const float* );LAPACKE_dgges:lapack_logical (*LAPACK_D_SELECT3) ( const double*, const double*, const double* );LAPACKE_cgges:lapack_logical (*LAPACK_C_SELECT2) ( const lapack_complex_float*, const lapack_complex_float* );LAPACKE_zgges:lapack_logical (*LAPACK_Z_SELECT2) ( const lapack_complex_double*, const lapack_complex_double* );If,sort='S'selectis used to select eigenvalues to sort to the top left of the Schur form.If,sort='N'selectis not referenced.For real flavors:An eigenvalue(is selected ifalphar[j] +alphai[j])/beta[j]is true; that is, if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected.select(alphar[j],alphai[j],beta[j])Note that in the ill-conditioned case, a selected complex eigenvalue may no longer satisfyafter ordering. In this caseselect(alphar[j],alphai[j],beta[j]) = 1infois set ton+2 .For complex flavors:An eigenvalueis selected ifalpha[j] /beta[j]is true.select(alpha[j],beta[j])Note that a selected complex eigenvalue may no longer satisfyafter ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned); in this caseselect(alpha[j],beta[j]) = 1infois set ton+2 (seeinfobelow).
- n
- The order of the matricesA,B,vsl, andvsr().n≥0
- a,b
- Arrays:a(size at least max(1,is an array containing thelda*n))n-by-nmatrixA(first of the pair of matrices).b(size at least max(1,is an array containing theldb*n))n-by-nmatrixB(second of the pair of matrices).
- lda
- The leading dimension of the arraya. Must be at least max(1,n).
- ldb
- The leading dimension of the arrayb. Must be at least max(1,n).
- ldvsl,ldvsr
- The leading dimensions of the output matricesvslandvsr, respectively. Constraints:. Ifldvsl≥1,jobvsl='V'.ldvsl≥max(1,n). Ifldvsr≥1,jobvsr='V'.ldvsr≥max(1,n)
Output Parameters
- a
- On exit, this array has been overwritten by its generalized Schur formS.
- b
- On exit, this array has been overwritten by its generalized Schur formT.
- sdim
- If,sort='N'sdim= 0.If,sort='S'sdimis equal to the number of eigenvalues (after sorting) for whichselectis true.Note that for real flavors complex conjugate pairs for whichselectis true for either eigenvalue count as 2.
- alphar,alphai
- Arrays, size at least max(1,n) each. Contain values that form generalized eigenvalues in real flavors.Seebeta.
- alpha
- Array, size at least max(1,n). Contain values that form generalized eigenvalues in complex flavors. Seebeta.
- beta
- Array, size at least max(1,n).For real flavors:On exit,(, will be the generalized eigenvalues.alphar[j] +alphai[j]*i)/beta[j],j=0,...,n- 1are the diagonals of the complex Schur form (alphar[j] +alphai[j]*i andbeta[j],j=0,...,n- 1S,T) that would result if the 2-by-2 diagonal blocks of the real generalized Schur form of (A,B) were further reduced to triangular form using complex unitary transformations. Ifis zero, then thealphai[j]j-th eigenvalue is real; if positive, then thej-th and (j+1)-st eigenvalues are a complex conjugate pair, withnegative.alphai[j+1]For complex flavors:On exit,, will be the generalized eigenvalues.alpha[j]/beta[j],j=0,...,n- 1are the diagonals of the complex Schur form (alpha[j] andbeta[j],j=0,...,n- 1S,T) output bycgges/zgges. Thewill be non-negative real.beta[j]See alsoApplication Notesbelow.
- vsl,vsr
- Arrays:vsl(size at least max(1,.ldvsl*n))If, this array will contain the left Schur vectors.jobvsl='V'If,jobvsl='N'vslis not referenced.vsr(size at least max(1,.ldvsr*n))If, this array will contain the right Schur vectors.jobvsr='V'If,jobvsr='N'vsris not referenced.
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , the
info
= -i
i
-th parameter had an illegal value.If , and
info
= i
i
≤
n
the should be correct.
QZ
iteration failed. (A
, B
) is not in Schur form, but alphar
[j
], alphai
[j
] (for real flavors), or alpha
[j
] (for complex flavors), and beta
[j
], j
= info
,..., n
- 1i
> n
i
= n
+2select
= 1i
= n
+3Application Notes
The quotients and may easily over- or underflow, and may even be zero. Thus, you should avoid simply computing the ratio. However,
alphar
[j
]/beta
[j
]alphai
[j
]/beta
[j
]beta
[j
]alphar
and alphai
will be always less than and usually comparable with norm(A
) in magnitude, and beta
always less than and usually comparable with norm(B
).