cgegv.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 627 行 · 第 1/3 页
HTML
627 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>cgegv.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="CGEGV.1"></a><a href="cgegv.f.html#CGEGV.1">CGEGV</a>( JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA,
$ VL, LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK driver 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 JOBVL, JOBVR
INTEGER INFO, LDA, LDB, LDVL, LDVR, LWORK, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> REAL RWORK( * )
COMPLEX A( LDA, * ), ALPHA( * ), B( LDB, * ),
$ BETA( * ), VL( LDVL, * ), VR( LDVR, * ),
$ WORK( * )
<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"> This routine is deprecated and has been replaced by routine <a name="CGGEV.22"></a><a href="cggev.f.html#CGGEV.1">CGGEV</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="CGEGV.24"></a><a href="cgegv.f.html#CGEGV.1">CGEGV</a> computes the eigenvalues and, optionally, the left and/or right
</span><span class="comment">*</span><span class="comment"> eigenvectors of a complex matrix pair (A,B).
</span><span class="comment">*</span><span class="comment"> Given two square matrices A and B,
</span><span class="comment">*</span><span class="comment"> the generalized nonsymmetric eigenvalue problem (GNEP) is to find the
</span><span class="comment">*</span><span class="comment"> eigenvalues lambda and corresponding (non-zero) eigenvectors x such
</span><span class="comment">*</span><span class="comment"> that
</span><span class="comment">*</span><span class="comment"> A*x = lambda*B*x.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> An alternate form is to find the eigenvalues mu and corresponding
</span><span class="comment">*</span><span class="comment"> eigenvectors y such that
</span><span class="comment">*</span><span class="comment"> mu*A*y = B*y.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> These two forms are equivalent with mu = 1/lambda and x = y if
</span><span class="comment">*</span><span class="comment"> neither lambda nor mu is zero. In order to deal with the case that
</span><span class="comment">*</span><span class="comment"> lambda or mu is zero or small, two values alpha and beta are returned
</span><span class="comment">*</span><span class="comment"> for each eigenvalue, such that lambda = alpha/beta and
</span><span class="comment">*</span><span class="comment"> mu = beta/alpha.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The vectors x and y in the above equations are right eigenvectors of
</span><span class="comment">*</span><span class="comment"> the matrix pair (A,B). Vectors u and v satisfying
</span><span class="comment">*</span><span class="comment"> u**H*A = lambda*u**H*B or mu*v**H*A = v**H*B
</span><span class="comment">*</span><span class="comment"> are left eigenvectors of (A,B).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Note: this routine performs "full balancing" on A and B -- see
</span><span class="comment">*</span><span class="comment"> "Further Details", below.
</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"> JOBVL (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': do not compute the left generalized eigenvectors;
</span><span class="comment">*</span><span class="comment"> = 'V': compute the left generalized eigenvectors (returned
</span><span class="comment">*</span><span class="comment"> in VL).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> JOBVR (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': do not compute the right generalized eigenvectors;
</span><span class="comment">*</span><span class="comment"> = 'V': compute the right generalized eigenvectors (returned
</span><span class="comment">*</span><span class="comment"> in VR).
</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 A, B, VL, and VR. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A (input/output) COMPLEX array, dimension (LDA, N)
</span><span class="comment">*</span><span class="comment"> On entry, the matrix A.
</span><span class="comment">*</span><span class="comment"> If JOBVL = 'V' or JOBVR = 'V', then on exit A
</span><span class="comment">*</span><span class="comment"> contains the Schur form of A from the generalized Schur
</span><span class="comment">*</span><span class="comment"> factorization of the pair (A,B) after balancing. If no
</span><span class="comment">*</span><span class="comment"> eigenvectors were computed, then only the diagonal elements
</span><span class="comment">*</span><span class="comment"> of the Schur form will be correct. See <a name="CGGHRD.72"></a><a href="cgghrd.f.html#CGGHRD.1">CGGHRD</a> and <a name="CHGEQZ.72"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</a>
</span><span class="comment">*</span><span class="comment"> for details.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDA (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of A. LDA >= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> B (input/output) COMPLEX array, dimension (LDB, N)
</span><span class="comment">*</span><span class="comment"> On entry, the matrix B.
</span><span class="comment">*</span><span class="comment"> If JOBVL = 'V' or JOBVR = 'V', then on exit B contains the
</span><span class="comment">*</span><span class="comment"> upper triangular matrix obtained from B in the generalized
</span><span class="comment">*</span><span class="comment"> Schur factorization of the pair (A,B) after balancing.
</span><span class="comment">*</span><span class="comment"> If no eigenvectors were computed, then only the diagonal
</span><span class="comment">*</span><span class="comment"> elements of B will be correct. See <a name="CGGHRD.84"></a><a href="cgghrd.f.html#CGGHRD.1">CGGHRD</a> and <a name="CHGEQZ.84"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</a> for
</span><span class="comment">*</span><span class="comment"> details.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDB (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of B. LDB >= 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.
</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 complex scalars beta that define the eigenvalues of GNEP.
</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"> VL (output) COMPLEX array, dimension (LDVL,N)
</span><span class="comment">*</span><span class="comment"> If JOBVL = 'V', the left eigenvectors u(j) are stored
</span><span class="comment">*</span><span class="comment"> in the columns of VL, in the same order as their eigenvalues.
</span><span class="comment">*</span><span class="comment"> Each eigenvector is scaled so that its largest component has
</span><span class="comment">*</span><span class="comment"> abs(real part) + abs(imag. part) = 1, except for eigenvectors
</span><span class="comment">*</span><span class="comment"> corresponding to an eigenvalue with alpha = beta = 0, which
</span><span class="comment">*</span><span class="comment"> are set to zero.
</span><span class="comment">*</span><span class="comment"> Not referenced if JOBVL = 'N'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVL (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the matrix VL. LDVL >= 1, and
</span><span class="comment">*</span><span class="comment"> if JOBVL = 'V', LDVL >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VR (output) COMPLEX array, dimension (LDVR,N)
</span><span class="comment">*</span><span class="comment"> If JOBVR = 'V', the right eigenvectors x(j) are stored
</span><span class="comment">*</span><span class="comment"> in the columns of VR, in the same order as their eigenvalues.
</span><span class="comment">*</span><span class="comment"> Each eigenvector is scaled so that its largest component has
</span><span class="comment">*</span><span class="comment"> abs(real part) + abs(imag. part) = 1, except for eigenvectors
</span><span class="comment">*</span><span class="comment"> corresponding to an eigenvalue with alpha = beta = 0, which
</span><span class="comment">*</span><span class="comment"> are set to zero.
</span><span class="comment">*</span><span class="comment"> Not referenced if JOBVR = 'N'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVR (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the matrix VR. LDVR >= 1, and
</span><span class="comment">*</span><span class="comment"> if JOBVR = 'V', LDVR >= 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,2*N).
</span><span class="comment">*</span><span class="comment"> For good performance, LWORK must generally be larger.
</span><span class="comment">*</span><span class="comment"> To compute the optimal value of LWORK, call <a name="ILAENV.136"></a><a href="hfy-index.html#ILAENV">ILAENV</a> to get
</span><span class="comment">*</span><span class="comment"> blocksizes (for <a name="CGEQRF.137"></a><a href="cgeqrf.f.html#CGEQRF.1">CGEQRF</a>, <a name="CUNMQR.137"></a><a href="cunmqr.f.html#CUNMQR.1">CUNMQR</a>, and <a name="CUNGQR.137"></a><a href="cungqr.f.html#CUNGQR.1">CUNGQR</a>.) Then compute:
</span><span class="comment">*</span><span class="comment"> NB -- MAX of the blocksizes for <a name="CGEQRF.138"></a><a href="cgeqrf.f.html#CGEQRF.1">CGEQRF</a>, <a name="CUNMQR.138"></a><a href="cunmqr.f.html#CUNMQR.1">CUNMQR</a>, and <a name="CUNGQR.138"></a><a href="cungqr.f.html#CUNGQR.1">CUNGQR</a>;
</span><span class="comment">*</span><span class="comment"> The optimal LWORK is MAX( 2*N, N*(NB+1) ).
</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.144"></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/output) REAL array, dimension (8*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:
</span><span class="comment">*</span><span class="comment"> The QZ iteration failed. No eigenvectors have been
</span><span class="comment">*</span><span class="comment"> calculated, but ALPHA(j) and BETA(j) should be
</span><span class="comment">*</span><span class="comment"> correct for j=INFO+1,...,N.
</span><span class="comment">*</span><span class="comment"> > N: errors that usually indicate LAPACK problems:
</span><span class="comment">*</span><span class="comment"> =N+1: error return from <a name="CGGBAL.156"></a><a href="cggbal.f.html#CGGBAL.1">CGGBAL</a>
</span><span class="comment">*</span><span class="comment"> =N+2: error return from <a name="CGEQRF.157"></a><a href="cgeqrf.f.html#CGEQRF.1">CGEQRF</a>
</span><span class="comment">*</span><span class="comment"> =N+3: error return from <a name="CUNMQR.158"></a><a href="cunmqr.f.html#CUNMQR.1">CUNMQR</a>
</span><span class="comment">*</span><span class="comment"> =N+4: error return from <a name="CUNGQR.159"></a><a href="cungqr.f.html#CUNGQR.1">CUNGQR</a>
</span><span class="comment">*</span><span class="comment"> =N+5: error return from <a name="CGGHRD.160"></a><a href="cgghrd.f.html#CGGHRD.1">CGGHRD</a>
</span><span class="comment">*</span><span class="comment"> =N+6: error return from <a name="CHGEQZ.161"></a><a href="chgeqz.f.html#CHGEQZ.1">CHGEQZ</a> (other than failed
</span><span class="comment">*</span><span class="comment"> iteration)
</span><span class="comment">*</span><span class="comment"> =N+7: error return from <a name="CTGEVC.163"></a><a href="ctgevc.f.html#CTGEVC.1">CTGEVC</a>
</span><span class="comment">*</span><span class="comment"> =N+8: error return from <a name="CGGBAK.164"></a><a href="cggbak.f.html#CGGBAK.1">CGGBAK</a> (computing VL)
</span><span class="comment">*</span><span class="comment"> =N+9: error return from <a name="CGGBAK.165"></a><a href="cggbak.f.html#CGGBAK.1">CGGBAK</a> (computing VR)
</span><span class="comment">*</span><span class="comment"> =N+10: error return from <a name="CLASCL.166"></a><a href="clascl.f.html#CLASCL.1">CLASCL</a> (various calls)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Further Details
</span><span class="comment">*</span><span class="comment"> ===============
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Balancing
</span><span class="comment">*</span><span class="comment"> ---------
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This driver calls <a name="CGGBAL.174"></a><a href="cggbal.f.html#CGGBAL.1">CGGBAL</a> to both permute and scale rows and columns
</span><span class="comment">*</span><span class="comment"> of A and B. The permutations PL and PR are chosen so that PL*A*PR
</span><span class="comment">*</span><span class="comment"> and PL*B*R will be upper triangular except for the diagonal blocks
</span><span class="comment">*</span><span class="comment"> A(i:j,i:j) and B(i:j,i:j), with i and j as close together as
</span><span class="comment">*</span><span class="comment"> possible. The diagonal scaling matrices DL and DR are chosen so
</span><span class="comment">*</span><span class="comment"> that the pair DL*PL*A*PR*DR, DL*PL*B*PR*DR have elements close to
</span><span class="comment">*</span><span class="comment"> one (except for the elements that start out zero.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> After the eigenvalues and eigenvectors of the balanced matrices
</span><span class="comment">*</span><span class="comment"> have been computed, <a name="CGGBAK.183"></a><a href="cggbak.f.html#CGGBAK.1">CGGBAK</a> transforms the eigenvectors back to what
</span><span class="comment">*</span><span class="comment"> they would have been (in perfect arithmetic) if they had not been
</span><span class="comment">*</span><span class="comment"> balanced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Contents of A and B on Exit
</span><span class="comment">*</span><span class="comment"> -------- -- - --- - -- ----
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If any eigenvectors are computed (either JOBVL='V' or JOBVR='V' or
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?