Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?gges3

Computes generalized Schur factorization for a pair of matrices.

Syntax

lapack_int LAPACKE_sgges3 (int matrix_layout, char jobvsl, char jobvsr, char sort, LAPACK_S_SELECT3 selctg, 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_dgges3 (int matrix_layout, char jobvsl, char jobvsr, char sort, LAPACK_D_SELECT3 selctg, 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_cgges3 (int matrix_layout, char jobvsl, char jobvsr, char sort, LAPACK_C_SELECT2 selctg, 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_zgges3 (int matrix_layout, char jobvsl, char jobvsr, char sort, LAPACK_Z_SELECT2 selctg, 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

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).

NOTE:

If only the generalized eigenvalues are needed, use the driver ?ggev instead, which is faster.

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 - 1] + alphai[j - 1])/beta[j - 1] is selected if selctg(alphar[j - 1],alphai[j - 1],beta[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 - 1],alphai[j - 1], beta[j - 1]) 0 after ordering. info is to be set to n+2 in this case.

For complex flavors:

An eigenvalue alpha[j - 1]/beta[j - 1] is selected if selctg(alpha[j - 1],beta[j - 1]) is true.

Note that a selected complex eigenvalue may no longer satisfy selctg(alpha[j - 1],beta[j - 1]) 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

Array, size (lda*n). On entry, the first of the pair of matrices.

lda

The leading dimension of a. lda max(1,n).

b

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.

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

Array, size (n).

alphar

Array, size (n).

alphai

Array, size (n).

beta

Array, size (n).

For real flavors:

On exit, (alphar[j - 1] + alphai[j - 1]*i)/beta[j - 1], j=1,...,n, are the generalized eigenvalues. alphar[j - 1] + alphai[j - 1]*i, and beta[j - 1],j=1,...,n 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] negative.

Note: the quotients alphar[j - 1]/beta[j - 1] and alphai[j - 1]/beta[j - 1] can easily over- or underflow, and beta[j - 1] 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 - 1][j - 1]/beta[j - 1], j=1,...,n, are the generalized eigenvalues. alpha[j - 1], j=1,...,n and beta[j - 1], j=1,...,n are the diagonals of the complex Schur form (a,b) output by ?gges3. The beta[j - 1] is non-negative real.

Note: the quotient alpha[j - 1]/beta[j - 1] can easily over- or underflow, and beta[j - 1] 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

Array, size (ldvsl*n).

If jobvsl = 'V', vsl contains the left Schur vectors. Not referenced if jobvsl = 'N'.

vsr

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.