ssyevr.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 587 行 · 第 1/4 页
HTML
587 行
</span> INFO = 0
IF( .NOT.( WANTZ .OR. <a name="LSAME.277"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( JOBZ, <span class="string">'N'</span> ) ) ) THEN
INFO = -1
ELSE IF( .NOT.( ALLEIG .OR. VALEIG .OR. INDEIG ) ) THEN
INFO = -2
ELSE IF( .NOT.( LOWER .OR. <a name="LSAME.281"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( UPLO, <span class="string">'U'</span> ) ) ) THEN
INFO = -3
ELSE IF( N.LT.0 ) THEN
INFO = -4
ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
INFO = -6
ELSE
IF( VALEIG ) THEN
IF( N.GT.0 .AND. VU.LE.VL )
$ INFO = -8
ELSE IF( INDEIG ) THEN
IF( IL.LT.1 .OR. IL.GT.MAX( 1, N ) ) THEN
INFO = -9
ELSE IF( IU.LT.MIN( N, IL ) .OR. IU.GT.N ) THEN
INFO = -10
END IF
END IF
END IF
IF( INFO.EQ.0 ) THEN
IF( LDZ.LT.1 .OR. ( WANTZ .AND. LDZ.LT.N ) ) THEN
INFO = -15
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.EQ.0 ) THEN
NB = <a name="ILAENV.306"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="SSYTRD.306"></a><a href="ssytrd.f.html#SSYTRD.1">SSYTRD</a>'</span>, UPLO, N, -1, -1, -1 )
NB = MAX( NB, <a name="ILAENV.307"></a><a href="hfy-index.html#ILAENV">ILAENV</a>( 1, <span class="string">'<a name="SORMTR.307"></a><a href="sormtr.f.html#SORMTR.1">SORMTR</a>'</span>, UPLO, N, -1, -1, -1 ) )
LWKOPT = MAX( ( NB+1 )*N, LWMIN )
WORK( 1 ) = LWKOPT
IWORK( 1 ) = LIWMIN
<span class="comment">*</span><span class="comment">
</span> IF( LWORK.LT.LWMIN .AND. .NOT.LQUERY ) THEN
INFO = -18
ELSE IF( LIWORK.LT.LIWMIN .AND. .NOT.LQUERY ) THEN
INFO = -20
END IF
END IF
<span class="comment">*</span><span class="comment">
</span> IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.320"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="SSYEVR.320"></a><a href="ssyevr.f.html#SSYEVR.1">SSYEVR</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> M = 0
IF( N.EQ.0 ) THEN
WORK( 1 ) = 1
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span> IF( N.EQ.1 ) THEN
WORK( 1 ) = 26
IF( ALLEIG .OR. INDEIG ) THEN
M = 1
W( 1 ) = A( 1, 1 )
ELSE
IF( VL.LT.A( 1, 1 ) .AND. VU.GE.A( 1, 1 ) ) THEN
M = 1
W( 1 ) = A( 1, 1 )
END IF
END IF
IF( WANTZ )
$ Z( 1, 1 ) = ONE
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Get machine constants.
</span><span class="comment">*</span><span class="comment">
</span> SAFMIN = <a name="SLAMCH.352"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Safe minimum'</span> )
EPS = <a name="SLAMCH.353"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>( <span class="string">'Precision'</span> )
SMLNUM = SAFMIN / EPS
BIGNUM = ONE / SMLNUM
RMIN = SQRT( SMLNUM )
RMAX = MIN( SQRT( BIGNUM ), ONE / SQRT( SQRT( SAFMIN ) ) )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale matrix to allowable range, if necessary.
</span><span class="comment">*</span><span class="comment">
</span> ISCALE = 0
ABSTLL = ABSTOL
IF (VALEIG) THEN
VLL = VL
VUU = VU
END IF
ANRM = <a name="SLANSY.367"></a><a href="slansy.f.html#SLANSY.1">SLANSY</a>( <span class="string">'M'</span>, UPLO, N, A, LDA, WORK )
IF( ANRM.GT.ZERO .AND. ANRM.LT.RMIN ) THEN
ISCALE = 1
SIGMA = RMIN / ANRM
ELSE IF( ANRM.GT.RMAX ) THEN
ISCALE = 1
SIGMA = RMAX / ANRM
END IF
IF( ISCALE.EQ.1 ) THEN
IF( LOWER ) THEN
DO 10 J = 1, N
CALL SSCAL( N-J+1, SIGMA, A( J, J ), 1 )
10 CONTINUE
ELSE
DO 20 J = 1, N
CALL SSCAL( J, SIGMA, A( 1, J ), 1 )
20 CONTINUE
END IF
IF( ABSTOL.GT.0 )
$ ABSTLL = ABSTOL*SIGMA
IF( VALEIG ) THEN
VLL = VL*SIGMA
VUU = VU*SIGMA
END IF
END IF
<span class="comment">*</span><span class="comment"> Initialize indices into workspaces. Note: The IWORK indices are
</span><span class="comment">*</span><span class="comment"> used only if <a name="SSTERF.394"></a><a href="ssterf.f.html#SSTERF.1">SSTERF</a> or <a name="SSTEMR.394"></a><a href="sstemr.f.html#SSTEMR.1">SSTEMR</a> fail.
</span>
<span class="comment">*</span><span class="comment"> WORK(INDTAU:INDTAU+N-1) stores the scalar factors of the
</span><span class="comment">*</span><span class="comment"> elementary reflectors used in <a name="SSYTRD.397"></a><a href="ssytrd.f.html#SSYTRD.1">SSYTRD</a>.
</span> INDTAU = 1
<span class="comment">*</span><span class="comment"> WORK(INDD:INDD+N-1) stores the tridiagonal's diagonal entries.
</span> INDD = INDTAU + N
<span class="comment">*</span><span class="comment"> WORK(INDE:INDE+N-1) stores the off-diagonal entries of the
</span><span class="comment">*</span><span class="comment"> tridiagonal matrix from <a name="SSYTRD.402"></a><a href="ssytrd.f.html#SSYTRD.1">SSYTRD</a>.
</span> INDE = INDD + N
<span class="comment">*</span><span class="comment"> WORK(INDDD:INDDD+N-1) is a copy of the diagonal entries over
</span><span class="comment">*</span><span class="comment"> -written by <a name="SSTEMR.405"></a><a href="sstemr.f.html#SSTEMR.1">SSTEMR</a> (the <a name="SSTERF.405"></a><a href="ssterf.f.html#SSTERF.1">SSTERF</a> path copies the diagonal to W).
</span> INDDD = INDE + N
<span class="comment">*</span><span class="comment"> WORK(INDEE:INDEE+N-1) is a copy of the off-diagonal entries over
</span><span class="comment">*</span><span class="comment"> -written while computing the eigenvalues in <a name="SSTERF.408"></a><a href="ssterf.f.html#SSTERF.1">SSTERF</a> and <a name="SSTEMR.408"></a><a href="sstemr.f.html#SSTEMR.1">SSTEMR</a>.
</span> INDEE = INDDD + N
<span class="comment">*</span><span class="comment"> INDWK is the starting offset of the left-over workspace, and
</span><span class="comment">*</span><span class="comment"> LLWORK is the remaining workspace size.
</span> INDWK = INDEE + N
LLWORK = LWORK - INDWK + 1
<span class="comment">*</span><span class="comment"> IWORK(INDIBL:INDIBL+M-1) corresponds to IBLOCK in <a name="SSTEBZ.415"></a><a href="sstebz.f.html#SSTEBZ.1">SSTEBZ</a> and
</span><span class="comment">*</span><span class="comment"> stores the block indices of each of the M<=N eigenvalues.
</span> INDIBL = 1
<span class="comment">*</span><span class="comment"> IWORK(INDISP:INDISP+NSPLIT-1) corresponds to ISPLIT in <a name="SSTEBZ.418"></a><a href="sstebz.f.html#SSTEBZ.1">SSTEBZ</a> and
</span><span class="comment">*</span><span class="comment"> stores the starting and finishing indices of each block.
</span> INDISP = INDIBL + N
<span class="comment">*</span><span class="comment"> IWORK(INDIFL:INDIFL+N-1) stores the indices of eigenvectors
</span><span class="comment">*</span><span class="comment"> that corresponding to eigenvectors that fail to converge in
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?