dgghrd.f.html

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

HTML
289
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dgghrd.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="DGGHRD.1"></a><a href="dgghrd.f.html#DGGHRD.1">DGGHRD</a>( COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB, Q,
     $                   LDQ, Z, LDZ, 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>      CHARACTER          COMPQ, COMPZ
      INTEGER            IHI, ILO, INFO, LDA, LDB, LDQ, LDZ, N
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      DOUBLE PRECISION   A( LDA, * ), B( LDB, * ), Q( LDQ, * ),
     $                   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="DGGHRD.20"></a><a href="dgghrd.f.html#DGGHRD.1">DGGHRD</a> reduces a pair of real matrices (A,B) to generalized upper
</span><span class="comment">*</span><span class="comment">  Hessenberg form using orthogonal transformations, where A is a
</span><span class="comment">*</span><span class="comment">  general matrix and B is upper triangular.  The form of the
</span><span class="comment">*</span><span class="comment">  generalized eigenvalue problem is
</span><span class="comment">*</span><span class="comment">     A*x = lambda*B*x,
</span><span class="comment">*</span><span class="comment">  and B is typically made upper triangular by computing its QR
</span><span class="comment">*</span><span class="comment">  factorization and moving the orthogonal matrix Q to the left side
</span><span class="comment">*</span><span class="comment">  of the equation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  This subroutine simultaneously reduces A to a Hessenberg matrix H:
</span><span class="comment">*</span><span class="comment">     Q**T*A*Z = H
</span><span class="comment">*</span><span class="comment">  and transforms B to another upper triangular matrix T:
</span><span class="comment">*</span><span class="comment">     Q**T*B*Z = T
</span><span class="comment">*</span><span class="comment">  in order to reduce the problem to its standard form
</span><span class="comment">*</span><span class="comment">     H*y = lambda*T*y
</span><span class="comment">*</span><span class="comment">  where y = Z**T*x.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The orthogonal matrices Q and Z are determined as products of Givens
</span><span class="comment">*</span><span class="comment">  rotations.  They may either be formed explicitly, or they may be
</span><span class="comment">*</span><span class="comment">  postmultiplied into input matrices Q1 and Z1, so that
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">       Q1 * A * Z1**T = (Q1*Q) * H * (Z1*Z)**T
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">       Q1 * B * Z1**T = (Q1*Q) * T * (Z1*Z)**T
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  If Q1 is the orthogonal matrix from the QR factorization of B in the
</span><span class="comment">*</span><span class="comment">  original equation A*x = lambda*B*x, then <a name="DGGHRD.46"></a><a href="dgghrd.f.html#DGGHRD.1">DGGHRD</a> reduces the original
</span><span class="comment">*</span><span class="comment">  problem to generalized Hessenberg form.
</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">  COMPQ   (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'N': do not compute Q;
</span><span class="comment">*</span><span class="comment">          = 'I': Q is initialized to the unit matrix, and the
</span><span class="comment">*</span><span class="comment">                 orthogonal matrix Q is returned;
</span><span class="comment">*</span><span class="comment">          = 'V': Q must contain an orthogonal matrix Q1 on entry,
</span><span class="comment">*</span><span class="comment">                 and the product Q1*Q is returned.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  COMPZ   (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'N': do not compute Z;
</span><span class="comment">*</span><span class="comment">          = 'I': Z is initialized to the unit matrix, and the
</span><span class="comment">*</span><span class="comment">                 orthogonal matrix Z is returned;
</span><span class="comment">*</span><span class="comment">          = 'V': Z must contain an orthogonal matrix Z1 on entry,
</span><span class="comment">*</span><span class="comment">                 and the product Z1*Z is returned.
</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 matrices A and B.  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">          ILO and IHI mark the rows and columns of A which are to be
</span><span class="comment">*</span><span class="comment">          reduced.  It is assumed that A is already upper triangular
</span><span class="comment">*</span><span class="comment">          in rows and columns 1:ILO-1 and IHI+1:N.  ILO and IHI are
</span><span class="comment">*</span><span class="comment">          normally set by a previous call to <a name="SGGBAL.74"></a><a href="sggbal.f.html#SGGBAL.1">SGGBAL</a>; otherwise they
</span><span class="comment">*</span><span class="comment">          should be set to 1 and N respectively.
</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">          rest is set to zero.
</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">  B       (input/output) DOUBLE PRECISION array, dimension (LDB, N)
</span><span class="comment">*</span><span class="comment">          On entry, the N-by-N upper triangular matrix B.
</span><span class="comment">*</span><span class="comment">          On exit, the upper triangular matrix T = Q**T B Z.  The
</span><span class="comment">*</span><span class="comment">          elements below the diagonal are set to zero.
</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">  Q       (input/output) DOUBLE PRECISION array, dimension (LDQ, N)
</span><span class="comment">*</span><span class="comment">          On entry, if COMPQ = 'V', the orthogonal matrix Q1,
</span><span class="comment">*</span><span class="comment">          typically from the QR factorization of B.
</span><span class="comment">*</span><span class="comment">          On exit, if COMPQ='I', the orthogonal matrix Q, and if
</span><span class="comment">*</span><span class="comment">          COMPQ = 'V', the product Q1*Q.
</span><span class="comment">*</span><span class="comment">          Not referenced if COMPQ='N'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDQ     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array Q.
</span><span class="comment">*</span><span class="comment">          LDQ &gt;= N if COMPQ='V' or 'I'; LDQ &gt;= 1 otherwise.
</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">          On entry, if COMPZ = 'V', the orthogonal matrix Z1.
</span><span class="comment">*</span><span class="comment">          On exit, if COMPZ='I', the orthogonal matrix Z, and if
</span><span class="comment">*</span><span class="comment">          COMPZ = 'V', the product Z1*Z.
</span><span class="comment">*</span><span class="comment">          Not referenced if COMPZ='N'.
</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.
</span><span class="comment">*</span><span class="comment">          LDZ &gt;= N if COMPZ='V' or 'I'; LDZ &gt;= 1 otherwise.
</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">  This routine reduces A to Hessenberg and B to triangular form by
</span><span class="comment">*</span><span class="comment">  an unblocked reduction, as described in _Matrix_Computations_,
</span><span class="comment">*</span><span class="comment">  by Golub and Van Loan (Johns Hopkins Press.)
</span><span class="comment">*</span><span class="comment">

⌨️ 快捷键说明

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