claein.f.html

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

HTML
288
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>claein.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="CLAEIN.1"></a><a href="claein.f.html#CLAEIN.1">CLAEIN</a>( RIGHTV, NOINIT, N, H, LDH, W, V, B, LDB, RWORK,
     $                   EPS3, SMLNUM, 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>      LOGICAL            NOINIT, RIGHTV
      INTEGER            INFO, LDB, LDH, N
      REAL               EPS3, SMLNUM
      COMPLEX            W
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      REAL               RWORK( * )
      COMPLEX            B( LDB, * ), H( LDH, * ), V( * )
<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="CLAEIN.22"></a><a href="claein.f.html#CLAEIN.1">CLAEIN</a> uses inverse iteration to find a right or left eigenvector
</span><span class="comment">*</span><span class="comment">  corresponding to the eigenvalue W of a complex upper Hessenberg
</span><span class="comment">*</span><span class="comment">  matrix H.
</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">  RIGHTV   (input) LOGICAL
</span><span class="comment">*</span><span class="comment">          = .TRUE. : compute right eigenvector;
</span><span class="comment">*</span><span class="comment">          = .FALSE.: compute left eigenvector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NOINIT   (input) LOGICAL
</span><span class="comment">*</span><span class="comment">          = .TRUE. : no initial vector supplied in V
</span><span class="comment">*</span><span class="comment">          = .FALSE.: initial vector supplied in V.
</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">  H       (input) COMPLEX array, dimension (LDH,N)
</span><span class="comment">*</span><span class="comment">          The upper Hessenberg matrix H.
</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       (input) COMPLEX
</span><span class="comment">*</span><span class="comment">          The eigenvalue of H whose corresponding right or left
</span><span class="comment">*</span><span class="comment">          eigenvector is to be computed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  V       (input/output) COMPLEX array, dimension (N)
</span><span class="comment">*</span><span class="comment">          On entry, if NOINIT = .FALSE., V must contain a starting
</span><span class="comment">*</span><span class="comment">          vector for inverse iteration; otherwise V need not be set.
</span><span class="comment">*</span><span class="comment">          On exit, V contains the computed eigenvector, normalized so
</span><span class="comment">*</span><span class="comment">          that the component of largest magnitude has magnitude 1; here
</span><span class="comment">*</span><span class="comment">          the magnitude of a complex number (x,y) is taken to be
</span><span class="comment">*</span><span class="comment">          |x| + |y|.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B       (workspace) COMPLEX array, dimension (LDB,N)
</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 the array B.  LDB &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RWORK   (workspace) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  EPS3    (input) REAL
</span><span class="comment">*</span><span class="comment">          A small machine-dependent value which is used to perturb
</span><span class="comment">*</span><span class="comment">          close eigenvalues, and to replace zero pivots.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SMLNUM  (input) REAL
</span><span class="comment">*</span><span class="comment">          A machine-dependent value close to the underflow threshold.
</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">          = 1:  inverse iteration did not converge; V is set to the
</span><span class="comment">*</span><span class="comment">                last iterate.
</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>      REAL               ONE, TENTH
      PARAMETER          ( ONE = 1.0E+0, TENTH = 1.0E-1 )
      COMPLEX            ZERO
      PARAMETER          ( ZERO = ( 0.0E+0, 0.0E+0 ) )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      CHARACTER          NORMIN, TRANS
      INTEGER            I, IERR, ITS, J
      REAL               GROWTO, NRMSML, ROOTN, RTEMP, SCALE, VNORM
      COMPLEX            CDUM, EI, EJ, TEMP, X
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      INTEGER            ICAMAX
      REAL               SCASUM, SCNRM2
      COMPLEX            <a name="CLADIV.94"></a><a href="cladiv.f.html#CLADIV.1">CLADIV</a>
      EXTERNAL           ICAMAX, SCASUM, SCNRM2, <a name="CLADIV.95"></a><a href="cladiv.f.html#CLADIV.1">CLADIV</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="CLATRS.98"></a><a href="clatrs.f.html#CLATRS.1">CLATRS</a>, CSSCAL
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          ABS, AIMAG, MAX, REAL, SQRT
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Statement Functions ..
</span>      REAL               CABS1
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Statement Function definitions ..
</span>      CABS1( CDUM ) = ABS( REAL( CDUM ) ) + ABS( AIMAG( CDUM ) )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span>      INFO = 0
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     GROWTO is the threshold used in the acceptance test for an
</span><span class="comment">*</span><span class="comment">     eigenvector.
</span><span class="comment">*</span><span class="comment">
</span>      ROOTN = SQRT( REAL( N ) )
      GROWTO = TENTH / ROOTN
      NRMSML = MAX( ONE, EPS3*ROOTN )*SMLNUM
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Form B = H - W*I (except that the subdiagonal elements are not
</span><span class="comment">*</span><span class="comment">     stored).
</span><span class="comment">*</span><span class="comment">
</span>      DO 20 J = 1, N
         DO 10 I = 1, J - 1
            B( I, J ) = H( I, J )

⌨️ 快捷键说明

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