zgegv.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 626 行 · 第 1/3 页

HTML
626
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>zgegv.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="ZGEGV.1"></a><a href="zgegv.f.html#ZGEGV.1">ZGEGV</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>      DOUBLE PRECISION   RWORK( * )
      COMPLEX*16         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="ZGGEV.22"></a><a href="zggev.f.html#ZGGEV.1">ZGGEV</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="ZGEGV.24"></a><a href="zgegv.f.html#ZGEGV.1">ZGEGV</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 &quot;full balancing&quot; on A and B -- see
</span><span class="comment">*</span><span class="comment">  &quot;Further Details&quot;, 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 &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A       (input/output) COMPLEX*16 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="ZGGHRD.72"></a><a href="zgghrd.f.html#ZGGHRD.1">ZGGHRD</a> and <a name="ZHGEQZ.72"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</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 &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B       (input/output) COMPLEX*16 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="ZGGHRD.84"></a><a href="zgghrd.f.html#ZGGHRD.1">ZGGHRD</a> and <a name="ZHGEQZ.84"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</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 &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  ALPHA   (output) COMPLEX*16 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*16 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*16 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 &gt;= 1, and
</span><span class="comment">*</span><span class="comment">          if JOBVL = 'V', LDVL &gt;= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  VR      (output) COMPLEX*16 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 &gt;= 1, and
</span><span class="comment">*</span><span class="comment">          if JOBVR = 'V', LDVR &gt;= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace/output) COMPLEX*16 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 &gt;= 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.135"></a><a href="hfy-index.html#ILAENV">ILAENV</a> to get
</span><span class="comment">*</span><span class="comment">          blocksizes (for <a name="ZGEQRF.136"></a><a href="zgeqrf.f.html#ZGEQRF.1">ZGEQRF</a>, <a name="ZUNMQR.136"></a><a href="zunmqr.f.html#ZUNMQR.1">ZUNMQR</a>, and <a name="ZUNGQR.136"></a><a href="zungqr.f.html#ZUNGQR.1">ZUNGQR</a>.)  Then compute:
</span><span class="comment">*</span><span class="comment">          NB  -- MAX of the blocksizes for <a name="ZGEQRF.137"></a><a href="zgeqrf.f.html#ZGEQRF.1">ZGEQRF</a>, <a name="ZUNMQR.137"></a><a href="zunmqr.f.html#ZUNMQR.1">ZUNMQR</a>, and <a name="ZUNGQR.137"></a><a href="zungqr.f.html#ZUNGQR.1">ZUNGQR</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.143"></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) DOUBLE PRECISION 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">          &lt; 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">          &gt; N:  errors that usually indicate LAPACK problems:
</span><span class="comment">*</span><span class="comment">                =N+1: error return from <a name="ZGGBAL.155"></a><a href="zggbal.f.html#ZGGBAL.1">ZGGBAL</a>
</span><span class="comment">*</span><span class="comment">                =N+2: error return from <a name="ZGEQRF.156"></a><a href="zgeqrf.f.html#ZGEQRF.1">ZGEQRF</a>
</span><span class="comment">*</span><span class="comment">                =N+3: error return from <a name="ZUNMQR.157"></a><a href="zunmqr.f.html#ZUNMQR.1">ZUNMQR</a>
</span><span class="comment">*</span><span class="comment">                =N+4: error return from <a name="ZUNGQR.158"></a><a href="zungqr.f.html#ZUNGQR.1">ZUNGQR</a>
</span><span class="comment">*</span><span class="comment">                =N+5: error return from <a name="ZGGHRD.159"></a><a href="zgghrd.f.html#ZGGHRD.1">ZGGHRD</a>
</span><span class="comment">*</span><span class="comment">                =N+6: error return from <a name="ZHGEQZ.160"></a><a href="zhgeqz.f.html#ZHGEQZ.1">ZHGEQZ</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="ZTGEVC.162"></a><a href="ztgevc.f.html#ZTGEVC.1">ZTGEVC</a>
</span><span class="comment">*</span><span class="comment">                =N+8: error return from <a name="ZGGBAK.163"></a><a href="zggbak.f.html#ZGGBAK.1">ZGGBAK</a> (computing VL)
</span><span class="comment">*</span><span class="comment">                =N+9: error return from <a name="ZGGBAK.164"></a><a href="zggbak.f.html#ZGGBAK.1">ZGGBAK</a> (computing VR)
</span><span class="comment">*</span><span class="comment">                =N+10: error return from <a name="ZLASCL.165"></a><a href="zlascl.f.html#ZLASCL.1">ZLASCL</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="ZGGBAL.173"></a><a href="zggbal.f.html#ZGGBAL.1">ZGGBAL</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="ZGGBAK.182"></a><a href="zggbak.f.html#ZGGBAK.1">ZGGBAK</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
</span><span class="comment">*</span><span class="comment">  both), then on exit the arrays A and B will contain the complex Schur

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?