dspgvx.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 317 行 · 第 1/2 页
HTML
317 行
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IFAIL (output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment"> If JOBZ = 'V', then if INFO = 0, the first M elements of
</span><span class="comment">*</span><span class="comment"> IFAIL are zero. If INFO > 0, then IFAIL contains the
</span><span class="comment">*</span><span class="comment"> indices of the eigenvectors that failed to converge.
</span><span class="comment">*</span><span class="comment"> If JOBZ = 'N', then IFAIL is not referenced.
</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"> < 0: if INFO = -i, the i-th argument had an illegal value
</span><span class="comment">*</span><span class="comment"> > 0: <a name="DPPTRF.151"></a><a href="dpptrf.f.html#DPPTRF.1">DPPTRF</a> or <a name="DSPEVX.151"></a><a href="dspevx.f.html#DSPEVX.1">DSPEVX</a> returned an error code:
</span><span class="comment">*</span><span class="comment"> <= N: if INFO = i, <a name="DSPEVX.152"></a><a href="dspevx.f.html#DSPEVX.1">DSPEVX</a> failed to converge;
</span><span class="comment">*</span><span class="comment"> i eigenvectors failed to converge. Their indices
</span><span class="comment">*</span><span class="comment"> are stored in array IFAIL.
</span><span class="comment">*</span><span class="comment"> > N: if INFO = N + i, for 1 <= i <= N, then the leading
</span><span class="comment">*</span><span class="comment"> minor of order i of 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"> .. Local Scalars ..
</span> LOGICAL ALLEIG, INDEIG, UPPER, VALEIG, WANTZ
CHARACTER TRANS
INTEGER J
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.174"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
EXTERNAL <a name="LSAME.175"></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 <a name="DPPTRF.178"></a><a href="dpptrf.f.html#DPPTRF.1">DPPTRF</a>, <a name="DSPEVX.178"></a><a href="dspevx.f.html#DSPEVX.1">DSPEVX</a>, <a name="DSPGST.178"></a><a href="dspgst.f.html#DSPGST.1">DSPGST</a>, DTPMV, DTPSV, <a name="XERBLA.178"></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 MIN
<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> UPPER = <a name="LSAME.187"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> )
WANTZ = <a name="LSAME.188"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'V'</span> )
ALLEIG = <a name="LSAME.189"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'A'</span> )
VALEIG = <a name="LSAME.190"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'V'</span> )
INDEIG = <a name="LSAME.191"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( RANGE, <span class="string">'I'</span> )
<span class="comment">*</span><span class="comment">
</span> INFO = 0
IF( ITYPE.LT.1 .OR. ITYPE.GT.3 ) THEN
INFO = -1
ELSE IF( .NOT.( WANTZ .OR. <a name="LSAME.196"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'N'</span> ) ) ) THEN
INFO = -2
ELSE IF( .NOT.( ALLEIG .OR. VALEIG .OR. INDEIG ) ) THEN
INFO = -3
ELSE IF( .NOT.( UPPER .OR. <a name="LSAME.200"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'L'</span> ) ) ) THEN
INFO = -4
ELSE IF( N.LT.0 ) THEN
INFO = -5
ELSE
IF( VALEIG ) THEN
IF( N.GT.0 .AND. VU.LE.VL ) THEN
INFO = -9
END IF
ELSE IF( INDEIG ) THEN
IF( IL.LT.1 ) THEN
INFO = -10
ELSE IF( IU.LT.MIN( N, IL ) .OR. IU.GT.N ) THEN
INFO = -11
END IF
END IF
END IF
IF( INFO.EQ.0 ) THEN
IF( LDZ.LT.1 .OR. ( WANTZ .AND. LDZ.LT.N ) ) THEN
INFO = -16
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.224"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="DSPGVX.224"></a><a href="dspgvx.f.html#DSPGVX.1">DSPGVX</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> M = 0
IF( N.EQ.0 )
$ RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Form a Cholesky factorization of B.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DPPTRF.236"></a><a href="dpptrf.f.html#DPPTRF.1">DPPTRF</a>( UPLO, N, BP, 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 and solve.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="DSPGST.244"></a><a href="dspgst.f.html#DSPGST.1">DSPGST</a>( ITYPE, UPLO, N, AP, BP, INFO )
CALL <a name="DSPEVX.245"></a><a href="dspevx.f.html#DSPEVX.1">DSPEVX</a>( JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU, ABSTOL, M,
$ W, Z, LDZ, WORK, IWORK, IFAIL, INFO )
<span class="comment">*</span><span class="comment">
</span> IF( WANTZ ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Backtransform eigenvectors to the original problem.
</span><span class="comment">*</span><span class="comment">
</span> IF( INFO.GT.0 )
$ M = INFO - 1
IF( ITYPE.EQ.1 .OR. ITYPE.EQ.2 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> For A*x=(lambda)*B*x and A*B*x=(lambda)*x;
</span><span class="comment">*</span><span class="comment"> backtransform eigenvectors: x = inv(L)'*y or inv(U)*y
</span><span class="comment">*</span><span class="comment">
</span> IF( UPPER ) THEN
TRANS = <span class="string">'N'</span>
ELSE
TRANS = <span class="string">'T'</span>
END IF
<span class="comment">*</span><span class="comment">
</span> DO 10 J = 1, M
CALL DTPSV( UPLO, TRANS, <span class="string">'Non-unit'</span>, N, BP, Z( 1, J ),
$ 1 )
10 CONTINUE
<span class="comment">*</span><span class="comment">
</span> ELSE IF( ITYPE.EQ.3 ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> For B*A*x=(lambda)*x;
</span><span class="comment">*</span><span class="comment"> backtransform eigenvectors: x = L*y or U'*y
</span><span class="comment">*</span><span class="comment">
</span> IF( UPPER ) THEN
TRANS = <span class="string">'T'</span>
ELSE
TRANS = <span class="string">'N'</span>
END IF
<span class="comment">*</span><span class="comment">
</span> DO 20 J = 1, M
CALL DTPMV( UPLO, TRANS, <span class="string">'Non-unit'</span>, N, BP, Z( 1, J ),
$ 1 )
20 CONTINUE
END IF
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="DSPGVX.290"></a><a href="dspgvx.f.html#DSPGVX.1">DSPGVX</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?