dgehrd.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>dgehrd.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="DGEHRD.1"></a><a href="dgehrd.f.html#DGEHRD.1">DGEHRD</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>      DOUBLE PRECISION  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="DGEHRD.17"></a><a href="dgehrd.f.html#DGEHRD.1">DGEHRD</a> reduces a real general matrix A to upper Hessenberg form H by
</span><span class="comment">*</span><span class="comment">  an orthogonal 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="DGEBAL.30"></a><a href="dgebal.f.html#DGEBAL.1">DGEBAL</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) DOUBLE PRECISION 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 orthogonal 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) DOUBLE PRECISION 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) DOUBLE PRECISION 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 real scalar, and v is a real 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="DGEHRD.100"></a><a href="dgehrd.f.html#DGEHRD.1">DGEHRD</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 )
      DOUBLE PRECISION  ZERO, ONE
      PARAMETER          ( ZERO = 0.0D+0, 
     $                     ONE = 1.0D+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
      DOUBLE PRECISION  EI
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Arrays ..
</span>      DOUBLE PRECISION  T( LDT, NBMAX )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           DAXPY, <a name="DGEHD2.123"></a><a href="dgehd2.f.html#DGEHD2.1">DGEHD2</a>, DGEMM, <a name="DLAHR2.123"></a><a href="dlahr2.f.html#DLAHR2.1">DLAHR2</a>, <a name="DLARFB.123"></a><a href="dlarfb.f.html#DLARFB.1">DLARFB</a>, DTRMM,
     $                   <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 + -
显示快捷键?