dhsein.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 436 行 · 第 1/3 页
HTML
436 行
</span><span class="comment">*</span><span class="comment"> store the eigenvectors; each selected real eigenvector
</span><span class="comment">*</span><span class="comment"> occupies one column and each selected complex eigenvector
</span><span class="comment">*</span><span class="comment"> occupies two columns.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) DOUBLE PRECISION array, dimension ((N+2)*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IFAILL (output) INTEGER array, dimension (MM)
</span><span class="comment">*</span><span class="comment"> If SIDE = 'L' or 'B', IFAILL(i) = j > 0 if the left
</span><span class="comment">*</span><span class="comment"> eigenvector in the i-th column of VL (corresponding to the
</span><span class="comment">*</span><span class="comment"> eigenvalue w(j)) failed to converge; IFAILL(i) = 0 if the
</span><span class="comment">*</span><span class="comment"> eigenvector converged satisfactorily. If the i-th and (i+1)th
</span><span class="comment">*</span><span class="comment"> columns of VL hold a complex eigenvector, then IFAILL(i) and
</span><span class="comment">*</span><span class="comment"> IFAILL(i+1) are set to the same value.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'R', IFAILL is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IFAILR (output) INTEGER array, dimension (MM)
</span><span class="comment">*</span><span class="comment"> If SIDE = 'R' or 'B', IFAILR(i) = j > 0 if the right
</span><span class="comment">*</span><span class="comment"> eigenvector in the i-th column of VR (corresponding to the
</span><span class="comment">*</span><span class="comment"> eigenvalue w(j)) failed to converge; IFAILR(i) = 0 if the
</span><span class="comment">*</span><span class="comment"> eigenvector converged satisfactorily. If the i-th and (i+1)th
</span><span class="comment">*</span><span class="comment"> columns of VR hold a complex eigenvector, then IFAILR(i) and
</span><span class="comment">*</span><span class="comment"> IFAILR(i+1) are set to the same value.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'L', IFAILR 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: if INFO = i, i is the number of eigenvectors which
</span><span class="comment">*</span><span class="comment"> failed to converge; see IFAILL and IFAILR for further
</span><span class="comment">*</span><span class="comment"> details.
</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"> Each eigenvector is normalized so that the element of largest
</span><span class="comment">*</span><span class="comment"> magnitude has magnitude 1; here the magnitude of a complex number
</span><span class="comment">*</span><span class="comment"> (x,y) is taken to be |x|+|y|.
</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 ZERO, ONE
PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> LOGICAL BOTHV, FROMQR, LEFTV, NOINIT, PAIR, RIGHTV
INTEGER I, IINFO, K, KL, KLN, KR, KSI, KSR, LDWORK
DOUBLE PRECISION BIGNUM, EPS3, HNORM, SMLNUM, ULP, UNFL, WKI,
$ WKR
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.179"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
DOUBLE PRECISION <a name="DLAMCH.180"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANHS.180"></a><a href="dlanhs.f.html#DLANHS.1">DLANHS</a>
EXTERNAL <a name="LSAME.181"></a><a href="lsame.f.html#LSAME.1">LSAME</a>, <a name="DLAMCH.181"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>, <a name="DLANHS.181"></a><a href="dlanhs.f.html#DLANHS.1">DLANHS</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="DLAEIN.184"></a><a href="dlaein.f.html#DLAEIN.1">DLAEIN</a>, <a name="XERBLA.184"></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 ABS, MAX
<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"> Decode and test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> BOTHV = <a name="LSAME.193"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'B'</span> )
RIGHTV = <a name="LSAME.194"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'R'</span> ) .OR. BOTHV
LEFTV = <a name="LSAME.195"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'L'</span> ) .OR. BOTHV
<span class="comment">*</span><span class="comment">
</span> FROMQR = <a name="LSAME.197"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( EIGSRC, <span class="string">'Q'</span> )
<span class="comment">*</span><span class="comment">
</span> NOINIT = <a name="LSAME.199"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( INITV, <span class="string">'N'</span> )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Set M to the number of columns required to store the selected
</span><span class="comment">*</span><span class="comment"> eigenvectors, and standardize the array SELECT.
</span><span class="comment">*</span><span class="comment">
</span> M = 0
PAIR = .FALSE.
DO 10 K = 1, N
IF( PAIR ) THEN
PAIR = .FALSE.
SELECT( K ) = .FALSE.
ELSE
IF( WI( K ).EQ.ZERO ) THEN
IF( SELECT( K ) )
$ M = M + 1
ELSE
PAIR = .TRUE.
IF( SELECT( K ) .OR. SELECT( K+1 ) ) THEN
SELECT( K ) = .TRUE.
M = M + 2
END IF
END IF
END IF
10 CONTINUE
<span class="comment">*</span><span class="comment">
</span> INFO = 0
IF( .NOT.RIGHTV .AND. .NOT.LEFTV ) THEN
INFO = -1
ELSE IF( .NOT.FROMQR .AND. .NOT.<a name="LSAME.227"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( EIGSRC, <span class="string">'N'</span> ) ) THEN
INFO = -2
ELSE IF( .NOT.NOINIT .AND. .NOT.<a name="LSAME.229"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( INITV, <span class="string">'U'</span> ) ) THEN
INFO = -3
ELSE IF( N.LT.0 ) THEN
INFO = -5
ELSE IF( LDH.LT.MAX( 1, N ) ) THEN
INFO = -7
ELSE IF( LDVL.LT.1 .OR. ( LEFTV .AND. LDVL.LT.N ) ) THEN
INFO = -11
ELSE IF( LDVR.LT.1 .OR. ( RIGHTV .AND. LDVR.LT.N ) ) THEN
INFO = -13
ELSE IF( MM.LT.M ) THEN
INFO = -14
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.243"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="DHSEIN.243"></a><a href="dhsein.f.html#DHSEIN.1">DHSEIN</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><span class="comment">*</span><span class="comment"> Set machine-dependent constants.
</span><span class="comment">*</span><span class="comment">
</span> UNFL = <a name="DLAMCH.254"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>( <span class="string">'Safe minimum'</span> )
ULP = <a name="DLAMCH.255"></a><a href="dlamch.f.html#DLAMCH.1">DLAMCH</a>( <span class="string">'Precision'</span> )
SMLNUM = UNFL*( N / ULP )
BIGNUM = ( ONE-ULP ) / SMLNUM
<span class="comment">*</span><span class="comment">
</span> LDWORK = N + 1
<span class="comment">*</span><span class="comment">
</span> KL = 1
KLN = 0
IF( FROMQR ) THEN
KR = 0
ELSE
KR = N
END IF
KSR = 1
<span class="comment">*</span><span class="comment">
</span> DO 120 K = 1, N
IF( SELECT( K ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Compute eigenvector(s) corresponding to W(K).
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?