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

◆ zgees_r()

void zgees_r ( char  jobvs,
char  sort,
int  n,
int  lda,
doublecomplex  a[],
int *  sdim,
doublecomplex  w[],
int  ldvs,
doublecomplex  vs[],
doublecomplex  work[],
int  lwork,
double  rwork[],
int  bwork[],
int *  info,
int *  irev 
)

(Simple driver) Schur factorization of a complex matrix (reverse communication version)

Purpose
This routine computes for an n x n complex nonsymmetric matrix A, the eigenvalues, the Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*Z^H.

Optionally, it also orders the eigenvalues on the diagonal of the Schur form so that selected eigenvalues are at the top left. The leading columns of Z then form an orthonormal basis for the invariant subspace corresponding to the selected eigenvalues.

A complex matrix is in Schur form if it is upper triangular.

The matrix A is reduced to upper Hessenberg form first. Then the eigenvalues and the Schur factorization are computed by QR method.

This routine is the reverse communication version of zgees.
Parameters
[in]jobvs= 'N': Schur vectors are not computed.
= 'V': Schur vectors are computed.
[in]sortSpecifies whether or not to order the eigenvalues on the diagonal of the Schur form.
= 'N': Eigenvalues are not ordered.
= 'S': Eigenvalues are ordered (see irev).
[in]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] n x n matrix A.
[out] a[][] has been overwritten by its Schur form T.
[out]sdimsort = 'N': sdim = 0.
sort = 'S': sdim = number of eigenvalues for which bwork[i] is true.
[out]w[]Array w[lw] (lw >= n)
w[] contains the computed eigenvalues, in the same order that they appear on the diagonal of the output Schur form T.
[in]ldvsLeading dimension of the two dimensional array vs[][]. (ldvs >= 1 if jobvs = 'N', ldvs >= n if jobvs = 'V')
[out]vs[][]Array vs[lvs][ldvs] (lvs >= n)
jobvs = 'V': vs[][] contains the unitary matrix Z of Schur vectors.
jobvs = 'N': vs[][] is not referenced.
[out]work[]Array work[lwork]
Complex work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe length of 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 >= n)
Work array.
[out]bwork[]Array bwork[lbwork] (lbwork >= n)
Logical type (integer) work array.
Not referenced if sort = 'N'.
[out]info= 0: Successful exit
= -1: The argument jobvs had an illegal value (jobvs != 'V' nor 'N')
= -2: The argument sort had an illegal value (sort != 'S' nor 'N')
= -3: The argument n had an illegal value (n < 0)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -8: The argument ldvs had an illegal value (ldvs too small)
= -11: The argument lwork had an illegal value (lwork too small)
= i (0 < i <= n): The QR algorithm failed to compute all the eigenvalues. Elements 0 to ilo-2 and i to n-1 of w[] contain those eigenvalues which have converged. If jobvs = 'V', vs[][] contains the matrix which reduces A to its partially converged Schur form.
= n+1: The eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned).
= n+2: After reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfy select = true. This could also be caused by underflow due to scaling.
[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: 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 w[i] (the eigenvalue). Set bwork[i] = true (1) to select or bwork[i] = false (0) not to select. Do not alter any variables other than bwork[].
Always irev = 0 if sort = 'N'.
Reference
LAPACK