dlahqr.f.html

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

HTML
526
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dlahqr.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="DLAHQR.1"></a><a href="dlahqr.f.html#DLAHQR.1">DLAHQR</a>( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
     $                   ILOZ, IHIZ, Z, LDZ, 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, N
      LOGICAL            WANTT, WANTZ
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      DOUBLE PRECISION   H( LDH, * ), WI( * ), 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="DLAHQR.19"></a><a href="dlahqr.f.html#DLAHQR.1">DLAHQR</a> is an auxiliary routine called by <a name="DHSEQR.19"></a><a href="dhseqr.f.html#DHSEQR.1">DHSEQR</a> to update the
</span><span class="comment">*</span><span class="comment">     eigenvalues and Schur decomposition already computed by <a name="DHSEQR.20"></a><a href="dhseqr.f.html#DHSEQR.1">DHSEQR</a>, by
</span><span class="comment">*</span><span class="comment">     dealing with the Hessenberg submatrix in rows and columns ILO to
</span><span class="comment">*</span><span class="comment">     IHI.
</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 &gt;= 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 quasi-triangular in
</span><span class="comment">*</span><span class="comment">          rows and columns IHI+1:N, and that H(ILO,ILO-1) = 0 (unless
</span><span class="comment">*</span><span class="comment">          ILO = 1). <a name="DLAHQR.42"></a><a href="dlahqr.f.html#DLAHQR.1">DLAHQR</a> works primarily with the Hessenberg
</span><span class="comment">*</span><span class="comment">          submatrix in rows and columns ILO to IHI, but applies
</span><span class="comment">*</span><span class="comment">          transformations to all of H if WANTT is .TRUE..
</span><span class="comment">*</span><span class="comment">          1 &lt;= ILO &lt;= max(1,IHI); IHI &lt;= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     H       (input/output) DOUBLE PRECISION 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 is zero and if WANTT is .TRUE., H is upper
</span><span class="comment">*</span><span class="comment">          quasi-triangular in rows and columns ILO:IHI, with any
</span><span class="comment">*</span><span class="comment">          2-by-2 diagonal blocks in standard form. If INFO is zero
</span><span class="comment">*</span><span class="comment">          and WANTT is .FALSE., the contents of H are unspecified on
</span><span class="comment">*</span><span class="comment">          exit.  The output state of H if INFO is nonzero is given
</span><span class="comment">*</span><span class="comment">          below under the description of INFO.
</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 &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     WR      (output) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment">     WI      (output) DOUBLE PRECISION array, dimension (N)
</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 ILO to IHI are stored in the corresponding
</span><span class="comment">*</span><span class="comment">          elements of WR and WI. 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., the
</span><span class="comment">*</span><span class="comment">          eigenvalues are stored in the same order as on the diagonal
</span><span class="comment">*</span><span class="comment">          of the Schur form returned in H, with WR(i) = H(i,i), and, if
</span><span class="comment">*</span><span class="comment">          H(i:i+1,i:i+1) is a 2-by-2 diagonal block,
</span><span class="comment">*</span><span class="comment">          WI(i) = sqrt(H(i+1,i)*H(i,i+1)) and 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 &lt;= ILOZ &lt;= ILO; IHI &lt;= IHIZ &lt;= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Z       (input/output) DOUBLE PRECISION array, dimension (LDZ,N)
</span><span class="comment">*</span><span class="comment">          If WANTZ is .TRUE., on entry Z must contain the current
</span><span class="comment">*</span><span class="comment">          matrix Z of transformations accumulated by <a name="DHSEQR.80"></a><a href="dhseqr.f.html#DHSEQR.1">DHSEQR</a>, and on
</span><span class="comment">*</span><span class="comment">          exit Z has been updated; transformations are applied only to
</span><span class="comment">*</span><span class="comment">          the submatrix Z(ILOZ:IHIZ,ILO:IHI).
</span><span class="comment">*</span><span class="comment">          If WANTZ is .FALSE., Z is not referenced.
</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 &gt;= max(1,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">          .GT. 0: If INFO = i, <a name="DLAHQR.90"></a><a href="dlahqr.f.html#DLAHQR.1">DLAHQR</a> failed to compute all the
</span><span class="comment">*</span><span class="comment">                  eigenvalues ILO to IHI in a total of 30 iterations
</span><span class="comment">*</span><span class="comment">                  per eigenvalue; elements i+1:ihi of WR and WI
</span><span class="comment">*</span><span class="comment">                  contain those eigenvalues which have been
</span><span class="comment">*</span><span class="comment">                  successfully computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                  If INFO .GT. 0 and WANTT is .FALSE., then on exit,
</span><span class="comment">*</span><span class="comment">                  the remaining unconverged eigenvalues are the
</span><span class="comment">*</span><span class="comment">                  eigenvalues of the upper Hessenberg matrix rows
</span><span class="comment">*</span><span class="comment">                  and columns ILO thorugh 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">          (*)       (initial value of H)*U  = U*(final value of H)
</span><span class="comment">*</span><span class="comment">                  where U is an orthognal matrix.    The final
</span><span class="comment">*</span><span class="comment">                  value of H is upper Hessenberg and triangular in
</span><span class="comment">*</span><span class="comment">                  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">                      (final value of Z)  = (initial value of Z)*U
</span><span class="comment">*</span><span class="comment">                  where U is the orthogonal matrix in (*)
</span><span class="comment">*</span><span class="comment">                  (regardless of the value of WANTT.)
</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">     02-96 Based on modifications by
</span><span class="comment">*</span><span class="comment">     David Day, Sandia National Laboratory, USA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     12-04 Further modifications by
</span><span class="comment">*</span><span class="comment">     Ralph Byers, University of Kansas, USA
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">       This is a modified version of <a name="DLAHQR.122"></a><a href="dlahqr.f.html#DLAHQR.1">DLAHQR</a> from LAPACK version 3.0.
</span><span class="comment">*</span><span class="comment">       It is (1) more robust against overflow and underflow and
</span><span class="comment">*</span><span class="comment">       (2) adopts the more conservative Ahues &amp; Tisseur stopping
</span><span class="comment">*</span><span class="comment">       criterion (LAWN 122, 1997).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     =========================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Parameters ..
</span>      INTEGER            ITMAX
      PARAMETER          ( ITMAX = 30 )
      DOUBLE PRECISION   ZERO, ONE, TWO
      PARAMETER          ( ZERO = 0.0d0, ONE = 1.0d0, TWO = 2.0d0 )
      DOUBLE PRECISION   DAT1, DAT2
      PARAMETER          ( DAT1 = 3.0d0 / 4.0d0, DAT2 = -0.4375d0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      DOUBLE PRECISION   AA, AB, BA, BB, CS, DET, H11, H12, H21, H21S,
     $                   H22, RT1I, RT1R, RT2I, RT2R, RTDISC, S, SAFMAX,
     $                   SAFMIN, SMLNUM, SN, SUM, T1, T2, T3, TR, TST,
     $                   ULP, V2, V3
      INTEGER            I, I1, I2, ITS, J, K, L, M, NH, NR, NZ
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      DOUBLE PRECISION   V( 3 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      DOUBLE PRECISION   <a name="DLAMCH.148"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
      EXTERNAL           <a name="DLAMCH.149"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           DCOPY, <a name="DLABAD.152"></a><a href="dlabad.f.html#DLABAD.1">DLABAD</a>, <a name="DLANV2.152"></a><a href="dlanv2.f.html#DLANV2.1">DLANV2</a>, <a name="DLARFG.152"></a><a href="dlarfg.f.html#DLARFG.1">DLARFG</a>, DROT
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          ABS, DBLE, MAX, MIN, SQRT
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Executable Statements ..

⌨️ 快捷键说明

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