cgehrd.f.html

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

HTML
298
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>cgehrd.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="CGEHRD.1"></a><a href="cgehrd.f.html#CGEHRD.1">CGEHRD</a>( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK 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, ILO, INFO, LDA, LWORK, N
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      COMPLEX            A( LDA, * ), TAU( * ), 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">  <a name="CGEHRD.17"></a><a href="cgehrd.f.html#CGEHRD.1">CGEHRD</a> reduces a complex general matrix A to upper Hessenberg form H by
</span><span class="comment">*</span><span class="comment">  an unitary similarity transformation:  Q' * A * Q = 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">  N       (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The order of the matrix A.  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 A is already upper triangular in rows
</span><span class="comment">*</span><span class="comment">          and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally
</span><span class="comment">*</span><span class="comment">          set by a previous call to <a name="CGEBAL.30"></a><a href="cgebal.f.html#CGEBAL.1">CGEBAL</a>; otherwise they should be
</span><span class="comment">*</span><span class="comment">          set to 1 and N respectively. See Further Details.
</span><span class="comment">*</span><span class="comment">          1 &lt;= ILO &lt;= IHI &lt;= N, if N &gt; 0; ILO=1 and IHI=0, if N=0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A       (input/output) COMPLEX array, dimension (LDA,N)
</span><span class="comment">*</span><span class="comment">          On entry, the N-by-N general matrix to be reduced.
</span><span class="comment">*</span><span class="comment">          On exit, the upper triangle and the first subdiagonal of A
</span><span class="comment">*</span><span class="comment">          are overwritten with the upper Hessenberg matrix H, and the
</span><span class="comment">*</span><span class="comment">          elements below the first subdiagonal, with the array TAU,
</span><span class="comment">*</span><span class="comment">          represent the unitary matrix Q as a product of elementary
</span><span class="comment">*</span><span class="comment">          reflectors. See Further 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 the array A.  LDA &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  TAU     (output) COMPLEX array, dimension (N-1)
</span><span class="comment">*</span><span class="comment">          The scalar factors of the elementary reflectors (see Further
</span><span class="comment">*</span><span class="comment">          Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to
</span><span class="comment">*</span><span class="comment">          zero.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace/output) COMPLEX array, dimension (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 length of the array WORK.  LWORK &gt;= max(1,N).
</span><span class="comment">*</span><span class="comment">          For optimum performance LWORK &gt;= N*NB, where NB is the
</span><span class="comment">*</span><span class="comment">          optimal blocksize.
</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.61"></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">  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">
</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">  The matrix Q is represented as a product of (ihi-ilo) elementary
</span><span class="comment">*</span><span class="comment">  reflectors
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Q = H(ilo) H(ilo+1) . . . H(ihi-1).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Each H(i) has the form
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     H(i) = I - tau * v * v'
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  where tau is a complex scalar, and v is a complex vector with
</span><span class="comment">*</span><span class="comment">  v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on
</span><span class="comment">*</span><span class="comment">  exit in A(i+2:ihi,i), and tau in TAU(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The contents of A are illustrated by the following example, with
</span><span class="comment">*</span><span class="comment">  n = 7, ilo = 2 and ihi = 6:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  on entry,                        on exit,
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  ( a   a   a   a   a   a   a )    (  a   a   h   h   h   h   a )
</span><span class="comment">*</span><span class="comment">  (     a   a   a   a   a   a )    (      a   h   h   h   h   a )
</span><span class="comment">*</span><span class="comment">  (     a   a   a   a   a   a )    (      h   h   h   h   h   h )
</span><span class="comment">*</span><span class="comment">  (     a   a   a   a   a   a )    (      v2  h   h   h   h   h )
</span><span class="comment">*</span><span class="comment">  (     a   a   a   a   a   a )    (      v2  v3  h   h   h   h )
</span><span class="comment">*</span><span class="comment">  (     a   a   a   a   a   a )    (      v2  v3  v4  h   h   h )
</span><span class="comment">*</span><span class="comment">  (                         a )    (                          a )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  where a denotes an element of the original matrix A, h denotes a
</span><span class="comment">*</span><span class="comment">  modified element of the upper Hessenberg matrix H, and vi denotes an
</span><span class="comment">*</span><span class="comment">  element of the vector defining H(i).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  This file is a slight modification of LAPACK-3.0's <a name="CGEHRD.100"></a><a href="cgehrd.f.html#CGEHRD.1">CGEHRD</a>
</span><span class="comment">*</span><span class="comment">  subroutine incorporating improvements proposed by Quintana-Orti and
</span><span class="comment">*</span><span class="comment">  Van de Geijn (2005). 
</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            NBMAX, LDT
      PARAMETER          ( NBMAX = 64, LDT = NBMAX+1 )
      COMPLEX            ZERO, ONE
      PARAMETER          ( ZERO = ( 0.0E+0, 0.0E+0 ), 
     $                     ONE = ( 1.0E+0, 0.0E+0 ) )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      LOGICAL            LQUERY
      INTEGER            I, IB, IINFO, IWS, J, LDWORK, LWKOPT, NB,
     $                   NBMIN, NH, NX
      COMPLEX            EI
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      COMPLEX            T( LDT, NBMAX )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           CAXPY, <a name="CGEHD2.123"></a><a href="cgehd2.f.html#CGEHD2.1">CGEHD2</a>, CGEMM, <a name="CLAHR2.123"></a><a href="clahr2.f.html#CLAHR2.1">CLAHR2</a>, <a name="CLARFB.123"></a><a href="clarfb.f.html#CLARFB.1">CLARFB</a>, CTRMM,
     $                   <a name="XERBLA.124"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          MAX, MIN
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      INTEGER            <a name="ILAENV.130"></a><a href="hfy-index.html#ILAENV">ILAENV</a>

⌨️ 快捷键说明

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