zhbgvx.f.html

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

HTML
415
字号
     $   RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Form a split Cholesky factorization of B.
</span><span class="comment">*</span><span class="comment">
</span>      CALL <a name="ZPBSTF.264"></a><a href="zpbstf.f.html#ZPBSTF.1">ZPBSTF</a>( UPLO, N, KB, BB, LDBB, INFO )
      IF( INFO.NE.0 ) THEN
         INFO = N + INFO
         RETURN
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Transform problem to standard eigenvalue problem.
</span><span class="comment">*</span><span class="comment">
</span>      CALL <a name="ZHBGST.272"></a><a href="zhbgst.f.html#ZHBGST.1">ZHBGST</a>( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, Q, LDQ,
     $             WORK, RWORK, IINFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Solve the standard eigenvalue problem.
</span><span class="comment">*</span><span class="comment">     Reduce Hermitian band matrix to tridiagonal form.
</span><span class="comment">*</span><span class="comment">
</span>      INDD = 1
      INDE = INDD + N
      INDRWK = INDE + N
      INDWRK = 1
      IF( WANTZ ) THEN
         VECT = <span class="string">'U'</span>
      ELSE
         VECT = <span class="string">'N'</span>
      END IF
      CALL <a name="ZHBTRD.287"></a><a href="zhbtrd.f.html#ZHBTRD.1">ZHBTRD</a>( VECT, UPLO, N, KA, AB, LDAB, RWORK( INDD ),
     $             RWORK( INDE ), Q, LDQ, WORK( INDWRK ), IINFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     If all eigenvalues are desired and ABSTOL is less than or equal
</span><span class="comment">*</span><span class="comment">     to zero, then call <a name="DSTERF.291"></a><a href="dsterf.f.html#DSTERF.1">DSTERF</a> or <a name="ZSTEQR.291"></a><a href="zsteqr.f.html#ZSTEQR.1">ZSTEQR</a>.  If this fails for some
</span><span class="comment">*</span><span class="comment">     eigenvalue, then try <a name="DSTEBZ.292"></a><a href="dstebz.f.html#DSTEBZ.1">DSTEBZ</a>.
</span><span class="comment">*</span><span class="comment">
</span>      TEST = .FALSE.
      IF( INDEIG ) THEN
         IF( IL.EQ.1 .AND. IU.EQ.N ) THEN
            TEST = .TRUE.
         END IF
      END IF
      IF( ( ALLEIG .OR. TEST ) .AND. ( ABSTOL.LE.ZERO ) ) THEN
         CALL DCOPY( N, RWORK( INDD ), 1, W, 1 )
         INDEE = INDRWK + 2*N
         CALL DCOPY( N-1, RWORK( INDE ), 1, RWORK( INDEE ), 1 )
         IF( .NOT.WANTZ ) THEN
            CALL <a name="DSTERF.305"></a><a href="dsterf.f.html#DSTERF.1">DSTERF</a>( N, W, RWORK( INDEE ), INFO )
         ELSE
            CALL <a name="ZLACPY.307"></a><a href="zlacpy.f.html#ZLACPY.1">ZLACPY</a>( <span class="string">'A'</span>, N, N, Q, LDQ, Z, LDZ )
            CALL <a name="ZSTEQR.308"></a><a href="zsteqr.f.html#ZSTEQR.1">ZSTEQR</a>( JOBZ, N, W, RWORK( INDEE ), Z, LDZ,
     $                   RWORK( INDRWK ), INFO )
            IF( INFO.EQ.0 ) THEN
               DO 10 I = 1, N
                  IFAIL( I ) = 0
   10          CONTINUE
            END IF
         END IF
         IF( INFO.EQ.0 ) THEN
            M = N
            GO TO 30
         END IF
         INFO = 0
      END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     Otherwise, call <a name="DSTEBZ.323"></a><a href="dstebz.f.html#DSTEBZ.1">DSTEBZ</a> and, if eigenvectors are desired,
</span><span class="comment">*</span><span class="comment">     call <a name="ZSTEIN.324"></a><a href="zstein.f.html#ZSTEIN.1">ZSTEIN</a>.
</span><span class="comment">*</span><span class="comment">
</span>      IF( WANTZ ) THEN
         ORDER = <span class="string">'B'</span>
      ELSE
         ORDER = <span class="string">'E'</span>
      END IF
      INDIBL = 1
      INDISP = INDIBL + N
      INDIWK = INDISP + N
      CALL <a name="DSTEBZ.334"></a><a href="dstebz.f.html#DSTEBZ.1">DSTEBZ</a>( RANGE, ORDER, N, VL, VU, IL, IU, ABSTOL,
     $             RWORK( INDD ), RWORK( INDE ), M, NSPLIT, W,
     $             IWORK( INDIBL ), IWORK( INDISP ), RWORK( INDRWK ),
     $             IWORK( INDIWK ), INFO )
<span class="comment">*</span><span class="comment">
</span>      IF( WANTZ ) THEN
         CALL <a name="ZSTEIN.340"></a><a href="zstein.f.html#ZSTEIN.1">ZSTEIN</a>( N, RWORK( INDD ), RWORK( INDE ), M, W,
     $                IWORK( INDIBL ), IWORK( INDISP ), Z, LDZ,
     $                RWORK( INDRWK ), IWORK( INDIWK ), IFAIL, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        Apply unitary matrix used in reduction to tridiagonal
</span><span class="comment">*</span><span class="comment">        form to eigenvectors returned by <a name="ZSTEIN.345"></a><a href="zstein.f.html#ZSTEIN.1">ZSTEIN</a>.
</span><span class="comment">*</span><span class="comment">
</span>         DO 20 J = 1, M
            CALL ZCOPY( N, Z( 1, J ), 1, WORK( 1 ), 1 )
            CALL ZGEMV( <span class="string">'N'</span>, N, N, CONE, Q, LDQ, WORK, 1, CZERO,
     $                  Z( 1, J ), 1 )
   20    CONTINUE
      END IF
<span class="comment">*</span><span class="comment">
</span>   30 CONTINUE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     If eigenvalues are not in order, then sort them, along with
</span><span class="comment">*</span><span class="comment">     eigenvectors.
</span><span class="comment">*</span><span class="comment">
</span>      IF( WANTZ ) THEN
         DO 50 J = 1, M - 1
            I = 0
            TMP1 = W( J )
            DO 40 JJ = J + 1, M
               IF( W( JJ ).LT.TMP1 ) THEN
                  I = JJ
                  TMP1 = W( JJ )
               END IF
   40       CONTINUE
<span class="comment">*</span><span class="comment">
</span>            IF( I.NE.0 ) THEN
               ITMP1 = IWORK( INDIBL+I-1 )
               W( I ) = W( J )
               IWORK( INDIBL+I-1 ) = IWORK( INDIBL+J-1 )
               W( J ) = TMP1
               IWORK( INDIBL+J-1 ) = ITMP1
               CALL ZSWAP( N, Z( 1, I ), 1, Z( 1, J ), 1 )
               IF( INFO.NE.0 ) THEN
                  ITMP1 = IFAIL( I )
                  IFAIL( I ) = IFAIL( J )
                  IFAIL( J ) = ITMP1
               END IF
            END IF
   50    CONTINUE
      END IF
<span class="comment">*</span><span class="comment">
</span>      RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     End of <a name="ZHBGVX.388"></a><a href="zhbgvx.f.html#ZHBGVX.1">ZHBGVX</a>
</span><span class="comment">*</span><span class="comment">
</span>      END

</pre>

 </body>
</html>

⌨️ 快捷键说明

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