dsbgvd.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 296 行 · 第 1/2 页
HTML
296 行
</span><span class="comment">*</span><span class="comment"> <= N: the algorithm failed to converge:
</span><span class="comment">*</span><span class="comment"> i off-diagonal elements of an intermediate
</span><span class="comment">*</span><span class="comment"> tridiagonal form did not converge to zero;
</span><span class="comment">*</span><span class="comment"> > N: if INFO = N + i, for 1 <= i <= N, then <a name="DPBSTF.133"></a><a href="dpbstf.f.html#DPBSTF.1">DPBSTF</a>
</span><span class="comment">*</span><span class="comment"> returned INFO = i: B is not positive definite.
</span><span class="comment">*</span><span class="comment"> The factorization of B could not be completed and
</span><span class="comment">*</span><span class="comment"> no eigenvalues or eigenvectors were computed.
</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"> Based on contributions by
</span><span class="comment">*</span><span class="comment"> Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
</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> DOUBLE PRECISION ONE, ZERO
PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL LQUERY, UPPER, WANTZ
CHARACTER VECT
INTEGER IINFO, INDE, INDWK2, INDWRK, LIWMIN, LLWRK2,
$ LWMIN
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.157"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
EXTERNAL <a name="LSAME.158"></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 DGEMM, <a name="DLACPY.161"></a><a href="dlacpy.f.html#DLACPY.1">DLACPY</a>, <a name="DPBSTF.161"></a><a href="dpbstf.f.html#DPBSTF.1">DPBSTF</a>, <a name="DSBGST.161"></a><a href="dsbgst.f.html#DSBGST.1">DSBGST</a>, <a name="DSBTRD.161"></a><a href="dsbtrd.f.html#DSBTRD.1">DSBTRD</a>, <a name="DSTEDC.161"></a><a href="dstedc.f.html#DSTEDC.1">DSTEDC</a>,
$ <a name="DSTERF.162"></a><a href="dsterf.f.html#DSTERF.1">DSTERF</a>, <a name="XERBLA.162"></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"> .. 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> WANTZ = <a name="LSAME.168"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'V'</span> )
UPPER = <a name="LSAME.169"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> )
LQUERY = ( LWORK.EQ.-1 .OR. LIWORK.EQ.-1 )
<span class="comment">*</span><span class="comment">
</span> INFO = 0
IF( N.LE.1 ) THEN
LIWMIN = 1
LWMIN = 1
ELSE IF( WANTZ ) THEN
LIWMIN = 3 + 5*N
LWMIN = 1 + 5*N + 2*N**2
ELSE
LIWMIN = 1
LWMIN = 2*N
END IF
<span class="comment">*</span><span class="comment">
</span> IF( .NOT.( WANTZ .OR. <a name="LSAME.184"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'N'</span> ) ) ) THEN
INFO = -1
ELSE IF( .NOT.( UPPER .OR. <a name="LSAME.186"></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( LDZ.LT.1 .OR. ( WANTZ .AND. LDZ.LT.N ) ) THEN
INFO = -12
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.EQ.0 ) THEN
WORK( 1 ) = LWMIN
IWORK( 1 ) = LIWMIN
<span class="comment">*</span><span class="comment">
</span> IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY ) THEN
INFO = -14
ELSE IF( LIWORK.LT.LIWMIN .AND. .NOT.LQUERY ) THEN
INFO = -16
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.214"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="DSBGVD.214"></a><a href="dsbgvd.f.html#DSBGVD.1">DSBGVD</a>'</span>, -INFO )
RETURN
ELSE IF( LQUERY ) THEN
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><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="DPBSTF.227"></a><a href="dpbstf.f.html#DPBSTF.1">DPBSTF</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> INDE = 1
INDWRK = INDE + N
INDWK2 = INDWRK + N*N
LLWRK2 = LWORK - INDWK2 + 1
CALL <a name="DSBGST.239"></a><a href="dsbgst.f.html#DSBGST.1">DSBGST</a>( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, Z, LDZ,
$ WORK( INDWRK ), IINFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Reduce to tridiagonal form.
</span><span class="comment">*</span><span class="comment">
</span> IF( WANTZ ) THEN
VECT = <span class="string">'U'</span>
ELSE
VECT = <span class="string">'N'</span>
END IF
CALL <a name="DSBTRD.249"></a><a href="dsbtrd.f.html#DSBTRD.1">DSBTRD</a>( VECT, UPLO, N, KA, AB, LDAB, W, WORK( INDE ), Z, LDZ,
$ WORK( INDWRK ), IINFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> For eigenvalues only, call <a name="DSTERF.252"></a><a href="dsterf.f.html#DSTERF.1">DSTERF</a>. For eigenvectors, call <a name="SSTEDC.252"></a><a href="sstedc.f.html#SSTEDC.1">SSTEDC</a>.
</span><span class="comment">*</span><span class="comment">
</span> IF( .NOT.WANTZ ) THEN
CALL <a name="DSTERF.255"></a><a href="dsterf.f.html#DSTERF.1">DSTERF</a>( N, W, WORK( INDE ), INFO )
ELSE
CALL <a name="DSTEDC.257"></a><a href="dstedc.f.html#DSTEDC.1">DSTEDC</a>( <span class="string">'I'</span>, N, W, WORK( INDE ), WORK( INDWRK ), N,
$ WORK( INDWK2 ), LLWRK2, IWORK, LIWORK, INFO )
CALL DGEMM( <span class="string">'N'</span>, <span class="string">'N'</span>, N, N, N, ONE, Z, LDZ, WORK( INDWRK ), N,
$ ZERO, WORK( INDWK2 ), N )
CALL <a name="DLACPY.261"></a><a href="dlacpy.f.html#DLACPY.1">DLACPY</a>( <span class="string">'A'</span>, N, N, WORK( INDWK2 ), N, Z, LDZ )
END IF
<span class="comment">*</span><span class="comment">
</span> WORK( 1 ) = LWMIN
IWORK( 1 ) = LIWMIN
<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="DSBGVD.269"></a><a href="dsbgvd.f.html#DSBGVD.1">DSBGVD</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?