chgeqz.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 783 行 · 第 1/4 页
HTML
783 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>chgeqz.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
SUBROUTINE <a name="CHGEQZ.1"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</a>( JOB, COMPQ, COMPZ, N, ILO, IHI, H, LDH, T, LDT,
$ ALPHA, BETA, Q, LDQ, Z, LDZ, WORK, LWORK,
$ RWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> CHARACTER COMPQ, COMPZ, JOB
INTEGER IHI, ILO, INFO, LDH, LDQ, LDT, LDZ, LWORK, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL RWORK( * )
COMPLEX ALPHA( * ), BETA( * ), H( LDH, * ),
$ Q( LDQ, * ), T( LDT, * ), WORK( * ),
$ Z( LDZ, * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="CHGEQZ.23"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</a> computes the eigenvalues of a complex matrix pair (H,T),
</span><span class="comment">*</span><span class="comment"> where H is an upper Hessenberg matrix and T is upper triangular,
</span><span class="comment">*</span><span class="comment"> using the single-shift QZ method.
</span><span class="comment">*</span><span class="comment"> Matrix pairs of this type are produced by the reduction to
</span><span class="comment">*</span><span class="comment"> generalized upper Hessenberg form of a complex matrix pair (A,B):
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A = Q1*H*Z1**H, B = Q1*T*Z1**H,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> as computed by <a name="CGGHRD.31"></a><a href="cgghrd.f.html#CGGHRD.1">CGGHRD</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If JOB='S', then the Hessenberg-triangular pair (H,T) is
</span><span class="comment">*</span><span class="comment"> also reduced to generalized Schur form,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H = Q*S*Z**H, T = Q*P*Z**H,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> where Q and Z are unitary matrices and S and P are upper triangular.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Optionally, the unitary matrix Q from the generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization may be postmultiplied into an input matrix Q1, and the
</span><span class="comment">*</span><span class="comment"> unitary matrix Z may be postmultiplied into an input matrix Z1.
</span><span class="comment">*</span><span class="comment"> If Q1 and Z1 are the unitary matrices from <a name="CGGHRD.43"></a><a href="cgghrd.f.html#CGGHRD.1">CGGHRD</a> that reduced
</span><span class="comment">*</span><span class="comment"> the matrix pair (A,B) to generalized Hessenberg form, then the output
</span><span class="comment">*</span><span class="comment"> matrices Q1*Q and Z1*Z are the unitary factors from the generalized
</span><span class="comment">*</span><span class="comment"> Schur factorization of (A,B):
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A = (Q1*Q)*S*(Z1*Z)**H, B = (Q1*Q)*P*(Z1*Z)**H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> To avoid overflow, eigenvalues of the matrix pair (H,T)
</span><span class="comment">*</span><span class="comment"> (equivalently, of (A,B)) are computed as a pair of complex values
</span><span class="comment">*</span><span class="comment"> (alpha,beta). If beta is nonzero, lambda = alpha / beta is an
</span><span class="comment">*</span><span class="comment"> eigenvalue of the generalized nonsymmetric eigenvalue problem (GNEP)
</span><span class="comment">*</span><span class="comment"> A*x = lambda*B*x
</span><span class="comment">*</span><span class="comment"> and if alpha is nonzero, mu = beta / alpha is an eigenvalue of the
</span><span class="comment">*</span><span class="comment"> alternate form of the GNEP
</span><span class="comment">*</span><span class="comment"> mu*A*y = B*y.
</span><span class="comment">*</span><span class="comment"> The values of alpha and beta for the i-th eigenvalue can be read
</span><span class="comment">*</span><span class="comment"> directly from the generalized Schur form: alpha = S(i,i),
</span><span class="comment">*</span><span class="comment"> beta = P(i,i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Ref: C.B. Moler & G.W. Stewart, "An Algorithm for Generalized Matrix
</span><span class="comment">*</span><span class="comment"> Eigenvalue Problems", SIAM J. Numer. Anal., 10(1973),
</span><span class="comment">*</span><span class="comment"> pp. 241--256.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> JOB (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'E': Compute eigenvalues only;
</span><span class="comment">*</span><span class="comment"> = 'S': Computer eigenvalues and the Schur form.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> COMPQ (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': Left Schur vectors (Q) are not computed;
</span><span class="comment">*</span><span class="comment"> = 'I': Q is initialized to the unit matrix and the matrix Q
</span><span class="comment">*</span><span class="comment"> of left Schur vectors of (H,T) is returned;
</span><span class="comment">*</span><span class="comment"> = 'V': Q must contain a unitary matrix Q1 on entry and
</span><span class="comment">*</span><span class="comment"> the product Q1*Q is returned.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> COMPZ (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': Right Schur vectors (Z) are not computed;
</span><span class="comment">*</span><span class="comment"> = 'I': Q is initialized to the unit matrix and the matrix Z
</span><span class="comment">*</span><span class="comment"> of right Schur vectors of (H,T) is returned;
</span><span class="comment">*</span><span class="comment"> = 'V': Z must contain a unitary matrix Z1 on entry and
</span><span class="comment">*</span><span class="comment"> the product Z1*Z is returned.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The order of the matrices H, T, Q, and Z. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ILO (input) INTEGER
</span><span class="comment">*</span><span class="comment"> IHI (input) INTEGER
</span><span class="comment">*</span><span class="comment"> ILO and IHI mark the rows and columns of H which are in
</span><span class="comment">*</span><span class="comment"> Hessenberg form. It is assumed that A is already upper
</span><span class="comment">*</span><span class="comment"> triangular in rows and columns 1:ILO-1 and IHI+1:N.
</span><span class="comment">*</span><span class="comment"> If N > 0, 1 <= ILO <= IHI <= N; if N = 0, ILO=1 and IHI=0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> H (input/output) COMPLEX array, dimension (LDH, N)
</span><span class="comment">*</span><span class="comment"> On entry, the N-by-N upper Hessenberg matrix H.
</span><span class="comment">*</span><span class="comment"> On exit, if JOB = 'S', H contains the upper triangular
</span><span class="comment">*</span><span class="comment"> matrix S from the generalized Schur factorization.
</span><span class="comment">*</span><span class="comment"> If JOB = 'E', the diagonal of H matches that of S, but
</span><span class="comment">*</span><span class="comment"> the rest of H is unspecified.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDH (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array H. LDH >= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> T (input/output) COMPLEX array, dimension (LDT, N)
</span><span class="comment">*</span><span class="comment"> On entry, the N-by-N upper triangular matrix T.
</span><span class="comment">*</span><span class="comment"> On exit, if JOB = 'S', T contains the upper triangular
</span><span class="comment">*</span><span class="comment"> matrix P from the generalized Schur factorization.
</span><span class="comment">*</span><span class="comment"> If JOB = 'E', the diagonal of T matches that of P, but
</span><span class="comment">*</span><span class="comment"> the rest of T is unspecified.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDT (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array T. LDT >= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ALPHA (output) COMPLEX array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The complex scalars alpha that define the eigenvalues of
</span><span class="comment">*</span><span class="comment"> GNEP. ALPHA(i) = S(i,i) in the generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> BETA (output) COMPLEX array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The real non-negative scalars beta that define the
</span><span class="comment">*</span><span class="comment"> eigenvalues of GNEP. BETA(i) = P(i,i) in the generalized
</span><span class="comment">*</span><span class="comment"> Schur factorization.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Together, the quantities alpha = ALPHA(j) and beta = BETA(j)
</span><span class="comment">*</span><span class="comment"> represent the j-th eigenvalue of the matrix pair (A,B), in
</span><span class="comment">*</span><span class="comment"> one of the forms lambda = alpha/beta or mu = beta/alpha.
</span><span class="comment">*</span><span class="comment"> Since either lambda or mu may overflow, they should not,
</span><span class="comment">*</span><span class="comment"> in general, be computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Q (input/output) COMPLEX array, dimension (LDQ, N)
</span><span class="comment">*</span><span class="comment"> On entry, if COMPZ = 'V', the unitary matrix Q1 used in the
</span><span class="comment">*</span><span class="comment"> reduction of (A,B) to generalized Hessenberg form.
</span><span class="comment">*</span><span class="comment"> On exit, if COMPZ = 'I', the unitary matrix of left Schur
</span><span class="comment">*</span><span class="comment"> vectors of (H,T), and if COMPZ = 'V', the unitary matrix of
</span><span class="comment">*</span><span class="comment"> left Schur vectors of (A,B).
</span><span class="comment">*</span><span class="comment"> Not referenced if COMPZ = 'N'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDQ (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array Q. LDQ >= 1.
</span><span class="comment">*</span><span class="comment"> If COMPQ='V' or 'I', then LDQ >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (input/output) COMPLEX array, dimension (LDZ, N)
</span><span class="comment">*</span><span class="comment"> On entry, if COMPZ = 'V', the unitary matrix Z1 used in the
</span><span class="comment">*</span><span class="comment"> reduction of (A,B) to generalized Hessenberg form.
</span><span class="comment">*</span><span class="comment"> On exit, if COMPZ = 'I', the unitary matrix of right Schur
</span><span class="comment">*</span><span class="comment"> vectors of (H,T), and if COMPZ = 'V', the unitary matrix of
</span><span class="comment">*</span><span class="comment"> right Schur vectors of (A,B).
</span><span class="comment">*</span><span class="comment"> Not referenced if COMPZ = 'N'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDZ (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array Z. LDZ >= 1.
</span><span class="comment">*</span><span class="comment"> If COMPZ='V' or 'I', then LDZ >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace/output) COMPLEX array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment"> On exit, if INFO >= 0, WORK(1) returns the optimal LWORK.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The dimension of the array WORK. LWORK >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If LWORK = -1, then a workspace query is assumed; the routine
</span><span class="comment">*</span><span class="comment"> only calculates the optimal size of the WORK array, returns
</span><span class="comment">*</span><span class="comment"> this value as the first entry of the WORK array, and no error
</span><span class="comment">*</span><span class="comment"> message related to LWORK is issued by <a name="XERBLA.166"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RWORK (workspace) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INFO (output) INTEGER
</span><span class="comment">*</span><span class="comment"> = 0: successful exit
</span><span class="comment">*</span><span class="comment"> < 0: if INFO = -i, the i-th argument had an illegal value
</span><span class="comment">*</span><span class="comment"> = 1,...,N: the QZ iteration did not converge. (H,T) is not
</span><span class="comment">*</span><span class="comment"> in Schur form, but ALPHA(i) and BETA(i),
</span><span class="comment">*</span><span class="comment"> i=INFO+1,...,N should be correct.
</span><span class="comment">*</span><span class="comment"> = N+1,...,2*N: the shift calculation failed. (H,T) is not
</span><span class="comment">*</span><span class="comment"> in Schur form, but ALPHA(i) and BETA(i),
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?