chbgst.f.html

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

HTML
1,017
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>chbgst.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="CHBGST.1"></a><a href="chbgst.f.html#CHBGST.1">CHBGST</a>( VECT, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, X,
     $                   LDX, WORK, RWORK, 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          UPLO, VECT
      INTEGER            INFO, KA, KB, LDAB, LDBB, LDX, N
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      REAL               RWORK( * )
      COMPLEX            AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
     $                   X( LDX, * )
<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="CHBGST.21"></a><a href="chbgst.f.html#CHBGST.1">CHBGST</a> reduces a complex Hermitian-definite banded generalized
</span><span class="comment">*</span><span class="comment">  eigenproblem  A*x = lambda*B*x  to standard form  C*y = lambda*y,
</span><span class="comment">*</span><span class="comment">  such that C has the same bandwidth as A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B must have been previously factorized as S**H*S by <a name="CPBSTF.25"></a><a href="cpbstf.f.html#CPBSTF.1">CPBSTF</a>, using a
</span><span class="comment">*</span><span class="comment">  split Cholesky factorization. A is overwritten by C = X**H*A*X, where
</span><span class="comment">*</span><span class="comment">  X = S**(-1)*Q and Q is a unitary matrix chosen to preserve the
</span><span class="comment">*</span><span class="comment">  bandwidth of A.
</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">  VECT    (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'N':  do not form the transformation matrix X;
</span><span class="comment">*</span><span class="comment">          = 'V':  form X.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  UPLO    (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">          = 'U':  Upper triangle of A is stored;
</span><span class="comment">*</span><span class="comment">          = 'L':  Lower triangle of A is stored.
</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">  KA      (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of superdiagonals of the matrix A if UPLO = 'U',
</span><span class="comment">*</span><span class="comment">          or the number of subdiagonals if UPLO = 'L'.  KA &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  KB      (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The number of superdiagonals of the matrix B if UPLO = 'U',
</span><span class="comment">*</span><span class="comment">          or the number of subdiagonals if UPLO = 'L'.  KA &gt;= KB &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  AB      (input/output) COMPLEX array, dimension (LDAB,N)
</span><span class="comment">*</span><span class="comment">          On entry, the upper or lower triangle of the Hermitian band
</span><span class="comment">*</span><span class="comment">          matrix A, stored in the first ka+1 rows of the array.  The
</span><span class="comment">*</span><span class="comment">          j-th column of A is stored in the j-th column of the array AB
</span><span class="comment">*</span><span class="comment">          as follows:
</span><span class="comment">*</span><span class="comment">          if UPLO = 'U', AB(ka+1+i-j,j) = A(i,j) for max(1,j-ka)&lt;=i&lt;=j;
</span><span class="comment">*</span><span class="comment">          if UPLO = 'L', AB(1+i-j,j)    = A(i,j) for j&lt;=i&lt;=min(n,j+ka).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">          On exit, the transformed matrix X**H*A*X, stored in the same
</span><span class="comment">*</span><span class="comment">          format as A.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDAB    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array AB.  LDAB &gt;= KA+1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  BB      (input) COMPLEX array, dimension (LDBB,N)
</span><span class="comment">*</span><span class="comment">          The banded factor S from the split Cholesky factorization of
</span><span class="comment">*</span><span class="comment">          B, as returned by <a name="CPBSTF.68"></a><a href="cpbstf.f.html#CPBSTF.1">CPBSTF</a>, stored in the first kb+1 rows of
</span><span class="comment">*</span><span class="comment">          the array.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDBB    (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array BB.  LDBB &gt;= KB+1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  X       (output) COMPLEX array, dimension (LDX,N)
</span><span class="comment">*</span><span class="comment">          If VECT = 'V', the n-by-n matrix X.
</span><span class="comment">*</span><span class="comment">          If VECT = 'N', the array X is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDX     (input) INTEGER
</span><span class="comment">*</span><span class="comment">          The leading dimension of the array X.
</span><span class="comment">*</span><span class="comment">          LDX &gt;= max(1,N) if VECT = 'V'; LDX &gt;= 1 otherwise.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK    (workspace) COMPLEX array, dimension (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">  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">  =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Parameters ..
</span>      COMPLEX            CZERO, CONE
      REAL               ONE
      PARAMETER          ( CZERO = ( 0.0E+0, 0.0E+0 ),
     $                   CONE = ( 1.0E+0, 0.0E+0 ), ONE = 1.0E+0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      LOGICAL            UPDATE, UPPER, WANTX
      INTEGER            I, I0, I1, I2, INCA, J, J1, J1T, J2, J2T, K,
     $                   KA1, KB1, KBT, L, M, NR, NRT, NX
      REAL               BII
      COMPLEX            RA, RA1, T
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      LOGICAL            <a name="LSAME.106"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      EXTERNAL           <a name="LSAME.107"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           CGERC, CGERU, <a name="CLACGV.110"></a><a href="clacgv.f.html#CLACGV.1">CLACGV</a>, <a name="CLAR2V.110"></a><a href="clar2v.f.html#CLAR2V.1">CLAR2V</a>, <a name="CLARGV.110"></a><a href="clargv.f.html#CLARGV.1">CLARGV</a>, <a name="CLARTG.110"></a><a href="clartg.f.html#CLARTG.1">CLARTG</a>,
     $                   <a name="CLARTV.111"></a><a href="clartv.f.html#CLARTV.1">CLARTV</a>, <a name="CLASET.111"></a><a href="claset.f.html#CLASET.1">CLASET</a>, <a name="CROT.111"></a><a href="crot.f.html#CROT.1">CROT</a>, CSSCAL, <a name="XERBLA.111"></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          CONJG, MAX, MIN, REAL
<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><span class="comment">*</span><span class="comment">     Test the input parameters
</span><span class="comment">*</span><span class="comment">
</span>      WANTX = <a name="LSAME.120"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( VECT, <span class="string">'V'</span> )
      UPPER = <a name="LSAME.121"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> )
      KA1 = KA + 1
      KB1 = KB + 1
      INFO = 0
      IF( .NOT.WANTX .AND. .NOT.<a name="LSAME.125"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( VECT, <span class="string">'N'</span> ) ) THEN
         INFO = -1
      ELSE IF( .NOT.UPPER .AND. .NOT.<a name="LSAME.127"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'L'</span> ) ) THEN
         INFO = -2
      ELSE IF( N.LT.0 ) THEN
         INFO = -3
      ELSE IF( KA.LT.0 ) THEN
         INFO = -4
      ELSE IF( KB.LT.0 .OR. KB.GT.KA ) THEN
         INFO = -5
      ELSE IF( LDAB.LT.KA+1 ) THEN
         INFO = -7
      ELSE IF( LDBB.LT.KB+1 ) THEN
         INFO = -9
      ELSE IF( LDX.LT.1 .OR. WANTX .AND. LDX.LT.MAX( 1, N ) ) THEN
         INFO = -11
      END IF
      IF( INFO.NE.0 ) THEN
         CALL <a name="XERBLA.143"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="CHBGST.143"></a><a href="chbgst.f.html#CHBGST.1">CHBGST</a>'</span>, -INFO )
         RETURN
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Quick return if possible
</span><span class="comment">*</span><span class="comment">
</span>      IF( N.EQ.0 )
     $   RETURN
<span class="comment">*</span><span class="comment">
</span>      INCA = LDAB*KA1
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Initialize X to the unit matrix, if needed
</span><span class="comment">*</span><span class="comment">
</span>      IF( WANTX )
     $   CALL <a name="CLASET.157"></a><a href="claset.f.html#CLASET.1">CLASET</a>( <span class="string">'Full'</span>, N, N, CZERO, CONE, X, LDX )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Set M to the splitting point m. It must be the same value as is
</span><span class="comment">*</span><span class="comment">     used in <a name="CPBSTF.160"></a><a href="cpbstf.f.html#CPBSTF.1">CPBSTF</a>. The chosen value allows the arrays WORK and RWORK
</span><span class="comment">*</span><span class="comment">     to be of dimension (N).
</span><span class="comment">*</span><span class="comment">
</span>      M = ( N+KB ) / 2
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     The routine works in two phases, corresponding to the two halves
</span><span class="comment">*</span><span class="comment">     of the split Cholesky factorization of B as S**H*S where
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     S = ( U    )
</span><span class="comment">*</span><span class="comment">         ( M  L )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     with U upper triangular of order m, and L lower triangular of
</span><span class="comment">*</span><span class="comment">     order n-m. S has the same bandwidth as B.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     S is treated as a product of elementary matrices:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     S = S(m)*S(m-1)*...*S(2)*S(1)*S(m+1)*S(m+2)*...*S(n-1)*S(n)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     where S(i) is determined by the i-th row of S.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     In phase 1, the index i takes the values n, n-1, ... , m+1;
</span><span class="comment">*</span><span class="comment">     in phase 2, it takes the values 1, 2, ... , m.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     For each value of i, the current matrix A is updated by forming
</span><span class="comment">*</span><span class="comment">     inv(S(i))**H*A*inv(S(i)). This creates a triangular bulge outside
</span><span class="comment">*</span><span class="comment">     the band of A. The bulge is then pushed down toward the bottom of

⌨️ 快捷键说明

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