clahqr.f.html

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

HTML
494
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>clahqr.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="CLAHQR.1"></a><a href="clahqr.f.html#CLAHQR.1">CLAHQR</a>( WANTT, WANTZ, N, ILO, IHI, H, LDH, W, 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>      COMPLEX            H( LDH, * ), W( * ), 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="CLAHQR.19"></a><a href="clahqr.f.html#CLAHQR.1">CLAHQR</a> is an auxiliary routine called by <a name="CHSEQR.19"></a><a href="chseqr.f.html#CHSEQR.1">CHSEQR</a> to update the
</span><span class="comment">*</span><span class="comment">     eigenvalues and Schur decomposition already computed by <a name="CHSEQR.20"></a><a href="chseqr.f.html#CHSEQR.1">CHSEQR</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 triangular in rows and
</span><span class="comment">*</span><span class="comment">          columns IHI+1:N, and that H(ILO,ILO-1) = 0 (unless ILO = 1).
</span><span class="comment">*</span><span class="comment">          <a name="CLAHQR.42"></a><a href="clahqr.f.html#CLAHQR.1">CLAHQR</a> works primarily with the Hessenberg submatrix in rows
</span><span class="comment">*</span><span class="comment">          and columns ILO to IHI, but applies transformations to all of
</span><span class="comment">*</span><span class="comment">          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) COMPLEX 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., then H
</span><span class="comment">*</span><span class="comment">          is upper triangular in rows and columns ILO:IHI.  If INFO
</span><span class="comment">*</span><span class="comment">          is zero and if WANTT is .FALSE., then the contents of H
</span><span class="comment">*</span><span class="comment">          are unspecified on exit.  The output state of H in case
</span><span class="comment">*</span><span class="comment">          INF is positive is 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">     W       (output) COMPLEX array, dimension (N)
</span><span class="comment">*</span><span class="comment">          The computed eigenvalues ILO to IHI are stored in the
</span><span class="comment">*</span><span class="comment">          corresponding elements of W. 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 W(i) = H(i,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) COMPLEX 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="CHSEQR.72"></a><a href="chseqr.f.html#CHSEQR.1">CHSEQR</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="CLAHQR.82"></a><a href="clahqr.f.html#CLAHQR.1">CLAHQR</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 W contain
</span><span class="comment">*</span><span class="comment">                  those eigenvalues which have been successfully
</span><span class="comment">*</span><span class="comment">                  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
</span><span class="comment">*</span><span class="comment">                  rows and columns ILO thorugh INFO of the final,
</span><span class="comment">*</span><span class="comment">                  output 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="CLAHQR.114"></a><a href="clahqr.f.html#CLAHQR.1">CLAHQR</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 )
      COMPLEX            ZERO, ONE
      PARAMETER          ( ZERO = ( 0.0e0, 0.0e0 ),
     $                   ONE = ( 1.0e0, 0.0e0 ) )
      REAL               RZERO, RONE, HALF
      PARAMETER          ( RZERO = 0.0e0, RONE = 1.0e0, HALF = 0.5e0 )
      REAL               DAT1
      PARAMETER          ( DAT1 = 3.0e0 / 4.0e0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      COMPLEX            CDUM, H11, H11S, H22, SC, SUM, T, T1, TEMP, U,
     $                   V2, X, Y
      REAL               AA, AB, BA, BB, H10, H21, RTEMP, S, SAFMAX,
     $                   SAFMIN, SMLNUM, SX, T2, TST, ULP
      INTEGER            I, I1, I2, ITS, J, JHI, JLO, K, L, M, NH, NZ
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      COMPLEX            V( 2 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      COMPLEX            <a name="CLADIV.143"></a><a href="cladiv.f.html#CLADIV.1">CLADIV</a>
      REAL               <a name="SLAMCH.144"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
      EXTERNAL           <a name="CLADIV.145"></a><a href="cladiv.f.html#CLADIV.1">CLADIV</a>, <a name="SLAMCH.145"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>
<span class="comment">*</span><span class="comment">     ..

⌨️ 快捷键说明

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