slaqr0.f.html

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

HTML
665
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>slaqr0.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="SLAQR0.1"></a><a href="slaqr0.f.html#SLAQR0.1">SLAQR0</a>( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
     $                   ILOZ, IHIZ, Z, LDZ, WORK, LWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK auxiliary 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>      INTEGER            IHI, IHIZ, ILO, ILOZ, INFO, LDH, LDZ, LWORK, N
      LOGICAL            WANTT, WANTZ
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      REAL               H( LDH, * ), WI( * ), WORK( * ), WR( * ),
     $                   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="SLAQR0.20"></a><a href="slaqr0.f.html#SLAQR0.1">SLAQR0</a> computes the eigenvalues of a Hessenberg matrix H
</span><span class="comment">*</span><span class="comment">     and, optionally, the matrices T and Z from the Schur decomposition
</span><span class="comment">*</span><span class="comment">     H = Z T Z**T, where T is an upper quasi-triangular matrix (the
</span><span class="comment">*</span><span class="comment">     Schur form), and Z is the orthogonal matrix of Schur vectors.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Optionally Z may be postmultiplied into an input orthogonal
</span><span class="comment">*</span><span class="comment">     matrix Q so that this routine can give the Schur factorization
</span><span class="comment">*</span><span class="comment">     of a matrix A which has been reduced to the Hessenberg form H
</span><span class="comment">*</span><span class="comment">     by the orthogonal matrix Q:  A = Q*H*Q**T = (QZ)*T*(QZ)**T.
</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">     WANTT   (input) LOGICAL
</span><span class="comment">*</span><span class="comment">          = .TRUE. : the full Schur form T is required;
</span><span class="comment">*</span><span class="comment">          = .FALSE.: only eigenvalues are required.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     WANTZ   (input) LOGICAL
</span><span class="comment">*</span><span class="comment">          = .TRUE. : the matrix of Schur vectors Z is required;
</span><span class="comment">*</span><span class="comment">          = .FALSE.: Schur vectors are not required.
</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 matrix H.  N .GE. 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">           It is assumed that H is already upper triangular in rows
</span><span class="comment">*</span><span class="comment">           and columns 1:ILO-1 and IHI+1:N and, if ILO.GT.1,
</span><span class="comment">*</span><span class="comment">           H(ILO,ILO-1) is zero. ILO and IHI are normally set by a
</span><span class="comment">*</span><span class="comment">           previous call to <a name="SGEBAL.49"></a><a href="sgebal.f.html#SGEBAL.1">SGEBAL</a>, and then passed to <a name="SGEHRD.49"></a><a href="sgehrd.f.html#SGEHRD.1">SGEHRD</a> when the
</span><span class="comment">*</span><span class="comment">           matrix output by <a name="SGEBAL.50"></a><a href="sgebal.f.html#SGEBAL.1">SGEBAL</a> is reduced to Hessenberg form.
</span><span class="comment">*</span><span class="comment">           Otherwise, ILO and IHI should be set to 1 and N,
</span><span class="comment">*</span><span class="comment">           respectively.  If N.GT.0, then 1.LE.ILO.LE.IHI.LE.N.
</span><span class="comment">*</span><span class="comment">           If N = 0, then ILO = 1 and IHI = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     H     (input/output) REAL array, dimension (LDH,N)
</span><span class="comment">*</span><span class="comment">           On entry, the upper Hessenberg matrix H.
</span><span class="comment">*</span><span class="comment">           On exit, if INFO = 0 and WANTT is .TRUE., then H contains
</span><span class="comment">*</span><span class="comment">           the upper quasi-triangular matrix T from the Schur
</span><span class="comment">*</span><span class="comment">           decomposition (the Schur form); 2-by-2 diagonal blocks
</span><span class="comment">*</span><span class="comment">           (corresponding to complex conjugate pairs of eigenvalues)
</span><span class="comment">*</span><span class="comment">           are returned in standard form, with H(i,i) = H(i+1,i+1)
</span><span class="comment">*</span><span class="comment">           and H(i+1,i)*H(i,i+1).LT.0. If INFO = 0 and WANTT is
</span><span class="comment">*</span><span class="comment">           .FALSE., then the contents of H are unspecified on exit.
</span><span class="comment">*</span><span class="comment">           (The output value of H when INFO.GT.0 is given under the
</span><span class="comment">*</span><span class="comment">           description of INFO below.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           This subroutine may explicitly set H(i,j) = 0 for i.GT.j and
</span><span class="comment">*</span><span class="comment">           j = 1, 2, ... ILO-1 or j = IHI+1, IHI+2, ... N.
</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 .GE. max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     WR    (output) REAL array, dimension (IHI)
</span><span class="comment">*</span><span class="comment">     WI    (output) REAL array, dimension (IHI)
</span><span class="comment">*</span><span class="comment">           The real and imaginary parts, respectively, of the computed
</span><span class="comment">*</span><span class="comment">           eigenvalues of H(ILO:IHI,ILO:IHI) are stored WR(ILO:IHI)
</span><span class="comment">*</span><span class="comment">           and WI(ILO:IHI). If two eigenvalues are computed as a
</span><span class="comment">*</span><span class="comment">           complex conjugate pair, they are stored in consecutive
</span><span class="comment">*</span><span class="comment">           elements of WR and WI, say the i-th and (i+1)th, with
</span><span class="comment">*</span><span class="comment">           WI(i) .GT. 0 and WI(i+1) .LT. 0. If WANTT is .TRUE., then
</span><span class="comment">*</span><span class="comment">           the eigenvalues are stored in the same order as on the
</span><span class="comment">*</span><span class="comment">           diagonal of the Schur form returned in H, with
</span><span class="comment">*</span><span class="comment">           WR(i) = H(i,i) and, if H(i:i+1,i:i+1) is a 2-by-2 diagonal
</span><span class="comment">*</span><span class="comment">           block, WI(i) = sqrt(-H(i+1,i)*H(i,i+1)) and
</span><span class="comment">*</span><span class="comment">           WI(i+1) = -WI(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     ILOZ     (input) INTEGER
</span><span class="comment">*</span><span class="comment">     IHIZ     (input) INTEGER
</span><span class="comment">*</span><span class="comment">           Specify the rows of Z to which transformations must be
</span><span class="comment">*</span><span class="comment">           applied if WANTZ is .TRUE..
</span><span class="comment">*</span><span class="comment">           1 .LE. ILOZ .LE. ILO; IHI .LE. IHIZ .LE. N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Z     (input/output) REAL array, dimension (LDZ,IHI)
</span><span class="comment">*</span><span class="comment">           If WANTZ is .FALSE., then Z is not referenced.
</span><span class="comment">*</span><span class="comment">           If WANTZ is .TRUE., then Z(ILO:IHI,ILOZ:IHIZ) is
</span><span class="comment">*</span><span class="comment">           replaced by Z(ILO:IHI,ILOZ:IHIZ)*U where U is the
</span><span class="comment">*</span><span class="comment">           orthogonal Schur factor of H(ILO:IHI,ILO:IHI).
</span><span class="comment">*</span><span class="comment">           (The output value of Z when INFO.GT.0 is given under
</span><span class="comment">*</span><span class="comment">           the description of INFO below.)
</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.  if WANTZ is .TRUE.
</span><span class="comment">*</span><span class="comment">           then LDZ.GE.MAX(1,IHIZ).  Otherwize, LDZ.GE.1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     WORK  (workspace/output) REAL array, dimension LWORK
</span><span class="comment">*</span><span class="comment">           On exit, if LWORK = -1, WORK(1) returns an estimate of
</span><span class="comment">*</span><span class="comment">           the optimal value for 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 .GE. max(1,N)
</span><span class="comment">*</span><span class="comment">           is sufficient, but LWORK typically as large as 6*N may
</span><span class="comment">*</span><span class="comment">           be required for optimal performance.  A workspace query
</span><span class="comment">*</span><span class="comment">           to determine the optimal workspace size is recommended.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           If LWORK = -1, then <a name="SLAQR0.115"></a><a href="slaqr0.f.html#SLAQR0.1">SLAQR0</a> does a workspace query.
</span><span class="comment">*</span><span class="comment">           In this case, <a name="SLAQR0.116"></a><a href="slaqr0.f.html#SLAQR0.1">SLAQR0</a> checks the input parameters and
</span><span class="comment">*</span><span class="comment">           estimates the optimal workspace size for the given
</span><span class="comment">*</span><span class="comment">           values of N, ILO and IHI.  The estimate is returned
</span><span class="comment">*</span><span class="comment">           in WORK(1).  No error message related to LWORK is
</span><span class="comment">*</span><span class="comment">           issued by <a name="XERBLA.120"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>.  Neither H nor Z are accessed.
</span><span class="comment">*</span><span class="comment">
</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">           .GT. 0:  if INFO = i, <a name="SLAQR0.125"></a><a href="slaqr0.f.html#SLAQR0.1">SLAQR0</a> failed to compute all of
</span><span class="comment">*</span><span class="comment">                the eigenvalues.  Elements 1:ilo-1 and i+1:n of WR
</span><span class="comment">*</span><span class="comment">                and WI contain those eigenvalues which have been
</span><span class="comment">*</span><span class="comment">                successfully computed.  (Failures are rare.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                If INFO .GT. 0 and WANT is .FALSE., then on exit,
</span><span class="comment">*</span><span class="comment">                the remaining unconverged eigenvalues are the eigen-
</span><span class="comment">*</span><span class="comment">                values of the upper Hessenberg matrix rows and
</span><span class="comment">*</span><span class="comment">                columns ILO through INFO of the final, output
</span><span class="comment">*</span><span class="comment">                value of H.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                If INFO .GT. 0 and WANTT is .TRUE., then on exit
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">           (*)  (initial value of H)*U  = U*(final value of H)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                where U is an orthogonal matrix.  The final
</span><span class="comment">*</span><span class="comment">                value of H is upper Hessenberg and quasi-triangular
</span><span class="comment">*</span><span class="comment">                in rows and columns INFO+1 through IHI.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                If INFO .GT. 0 and WANTZ is .TRUE., then on exit
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                  (final value of Z(ILO:IHI,ILOZ:IHIZ)
</span><span class="comment">*</span><span class="comment">                   =  (initial value of Z(ILO:IHI,ILOZ:IHIZ)*U
</span><span class="comment">*</span><span class="comment">

⌨️ 快捷键说明

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