XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zgges_r()

void zgges_r ( char  jobvsl,
char  jobvsr,
char  sort,
int  n,
int  lda,
doublecomplex  a[],
int  ldb,
doublecomplex  b[],
int *  sdim,
doublecomplex  alpha[],
doublecomplex  beta[],
int  ldvsl,
doublecomplex  vsl[],
int  ldvsr,
doublecomplex  vsr[],
doublecomplex  work[],
int  lwork,
double  rwork[],
int  bwork[],
int *  info,
int *  irev 
)

(Simple driver) Generalized Schur factorization of complex matrices (Reverse communication version)

Purpose
This routine computes for a pair of n x n complex nonsymmetric matrices (A, B), the generalized eigenvalues, the generalized complex Schur form (S, T), and optionally the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization
(A, B) = ((VSL)*S*(VSR)^H, (VSL)*T*(VSR)^H)
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 elements of the upper triangular matrix S and the upper triangular matrix T. The leading columns of VSL and VSR then form an unitary basis for the corresponding left and right eigenspaces (deflating subspaces).
(If only the generalized eigenvalues are needed, use the driver zggev 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, and even for both being zero.

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.

This routine is the reverse communication version of zgges.
Parameters
[in]jobvsl= 'N': Do not compute the left Schur vectors.
= 'V': Compute the left Schur vectors.
[in]jobvsr= 'N': Do not compute the right Schur vectors.
= 'V': Compute the right Schur vectors.
[in]sortSpecifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.
= 'N': Eigenvalues are not ordered.
= 'S': Eigenvalues are ordered.
[in]nOrder of the matrices A, B, VSL and VSR. (n >= 0) (If n = 0, returns without
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] The first of the pair of matrices.
[out] a[][] has been overwritten by its generalized Schur form S.
[in]ldbLeading dimension of the two dimensional array b[][]. (ldb >= max(1, n))
[in,out]b[][]Array b[lb][ldb] (lb >= n)
[in] The second of the pair of matrices.
[out] b[][] has been overwritten by its generalized Schur form T.
[out]sdimsort = 'N': sdim = 0.
sort = 'S': sdim = number of eigenvalues (after sorting) for which bwork[i] is true.
[out]alpha[]
[out]beta[]Array beta[lbeta] (lbeta >= n)
alpha[j]/beta[j], j = 0, ..., n-1, will be the generalized eigenvalues. alpha[j] and beta[j], j = 0, ..., n-1 are the diagonals of the complex Schur form (S, T). The beta[j] will be non-negative real.

Note: The quotients alpha[j]/beta[j] may easily over- or underflow, and beta[j] may even be zero. Thus, the user should avoid naively computing the ratio alpha/beta. However, alpha will be always less than and usually comparable with norm(A) in magnitude, and beta always less than and usually comparable with norm(B).
[in]ldvslLeading dimension of the two dimensional array vsl[][]. (ldvsl >= 1 if jobvsl = 'N', ldvsl >= n if jobvsl = 'V')
[out]vsl[][]Array vsl[lvsl][ldvsl] (lvsl >= n)
jobvsl = 'V': vsl[][] will contain the left Schur vectors.
jobvsl = 'N': Not referenced.
[in]ldvsrLeading dimension of the two dimensional array vsr[][]. (ldvsr >= 1 if jobvsr = 'N', ldvsr >= n if jobvsr = 'V')
[out]vsr[][]Array vsr[lvsr][ldvsr] (lvsr >= n)
jobvsr = 'V': vsl[][] will contain the right Schur vectors.
jobvsr = 'N': Not referenced.
[out]work[]Array work[lwork]
Complex work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork >= max(1, 2*n))
For good performance, lwork must generally be larger.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0].
[out]rwork[]Array rwork[lrwork] (lrwork >= 8*n)
Work array.
[out]bwork[]Array bwork[lbwork] (lbwork >= n)
Logical work array.
Not referenced if sort = 'N'.
[out]info= 0: Successful exit
= -1: The argument jobvsl had an illegal value (jobvsl != 'V' nor 'N')
= -2: The argument jobvsr had an illegal value (jobvsr != 'V' nor 'N')
= -3: The argument sort had an illegal value (sort != 'S' nor 'N')
= -4: The argument n had an illegal value (n < 0)
= -5: The argument lda had an illegal value (lda < max(1, n))
= -7: The argument ldb had an illegal value (ldb < max(1, n))
= -12: The argument ldvsl had an illegal value (ldvsl too small)
= -14: The argument ldvsr had an illegal value (ldvsr too small)
= -17: The argument lwork had an illegal value (lwork too small)
= i (0 < i <= n): The QZ iteration failed. (A, B) are not in Schur form, but alpha[j] and beta[j] should be correct for j = i, ..., n-1.
= n+1: Other than QZ iteration failed in zhgeqz.
= n+2: After reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the generalized Schur form no longer satisfy selctg = true. This could also be caused due to scaling.
= n+3: Reordering failed in ztgsen.
[in,out]irevControl variable for reverse communication.
[in] Before first call, irev should be initialized to zero. On succeeding calls, irev should not be altered.
[out] If irev is not zero, complete the following process and call this routine again.
= 0: Normal exit. See return code in info.
= 1, 2: In the case of sort = 'S', to select eigenvalues to sort to the top left of the Schur form, the user should set bwork[i] (i = 0 to n-1). Decision should be made based on the value in alpha[i] and beta[i] (alpha[i]/beta[i] is the eigenvalue). Set bwork[i] = 1 to select or bwork[i] = 0 not to select. Do not alter any variables other than bwork[].
Always irev = 0 if sort = 'N'.
Reference
LAPACK