slaed1.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 220 行 · 第 1/2 页
HTML
220 行
</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"> Jeff Rutter, Computer Science Division, University of California
</span><span class="comment">*</span><span class="comment"> at Berkeley, USA
</span><span class="comment">*</span><span class="comment"> Modified by Francoise Tisseur, University of Tennessee.
</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> INTEGER COLTYP, CPP1, I, IDLMDA, INDX, INDXC, INDXP,
$ IQ2, IS, IW, IZ, K, N1, N2
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL SCOPY, <a name="SLAED2.108"></a><a href="slaed2.f.html#SLAED2.1">SLAED2</a>, <a name="SLAED3.108"></a><a href="slaed3.f.html#SLAED3.1">SLAED3</a>, <a name="SLAMRG.108"></a><a href="slamrg.f.html#SLAMRG.1">SLAMRG</a>, <a name="XERBLA.108"></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 MAX, 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> INFO = 0
<span class="comment">*</span><span class="comment">
</span> IF( N.LT.0 ) THEN
INFO = -1
ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
INFO = -4
ELSE IF( MIN( 1, N / 2 ).GT.CUTPNT .OR. ( N / 2 ).LT.CUTPNT ) THEN
INFO = -7
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.127"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="SLAED1.127"></a><a href="slaed1.f.html#SLAED1.1">SLAED1</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"> The following values are integer pointers which indicate
</span><span class="comment">*</span><span class="comment"> the portion of the workspace
</span><span class="comment">*</span><span class="comment"> used by a particular array in <a name="SLAED2.138"></a><a href="slaed2.f.html#SLAED2.1">SLAED2</a> and <a name="SLAED3.138"></a><a href="slaed3.f.html#SLAED3.1">SLAED3</a>.
</span><span class="comment">*</span><span class="comment">
</span> IZ = 1
IDLMDA = IZ + N
IW = IDLMDA + N
IQ2 = IW + N
<span class="comment">*</span><span class="comment">
</span> INDX = 1
INDXC = INDX + N
COLTYP = INDXC + N
INDXP = COLTYP + N
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Form the z-vector which consists of the last row of Q_1 and the
</span><span class="comment">*</span><span class="comment"> first row of Q_2.
</span><span class="comment">*</span><span class="comment">
</span> CALL SCOPY( CUTPNT, Q( CUTPNT, 1 ), LDQ, WORK( IZ ), 1 )
CPP1 = CUTPNT + 1
CALL SCOPY( N-CUTPNT, Q( CPP1, CPP1 ), LDQ, WORK( IZ+CUTPNT ), 1 )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Deflate eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="SLAED2.160"></a><a href="slaed2.f.html#SLAED2.1">SLAED2</a>( K, N, CUTPNT, D, Q, LDQ, INDXQ, RHO, WORK( IZ ),
$ WORK( IDLMDA ), WORK( IW ), WORK( IQ2 ),
$ IWORK( INDX ), IWORK( INDXC ), IWORK( INDXP ),
$ IWORK( COLTYP ), INFO )
<span class="comment">*</span><span class="comment">
</span> IF( INFO.NE.0 )
$ GO TO 20
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Solve Secular Equation.
</span><span class="comment">*</span><span class="comment">
</span> IF( K.NE.0 ) THEN
IS = ( IWORK( COLTYP )+IWORK( COLTYP+1 ) )*CUTPNT +
$ ( IWORK( COLTYP+1 )+IWORK( COLTYP+2 ) )*( N-CUTPNT ) + IQ2
CALL <a name="SLAED3.173"></a><a href="slaed3.f.html#SLAED3.1">SLAED3</a>( K, N, CUTPNT, D, Q, LDQ, RHO, WORK( IDLMDA ),
$ WORK( IQ2 ), IWORK( INDXC ), IWORK( COLTYP ),
$ WORK( IW ), WORK( IS ), INFO )
IF( INFO.NE.0 )
$ GO TO 20
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Prepare the INDXQ sorting permutation.
</span><span class="comment">*</span><span class="comment">
</span> N1 = K
N2 = N - K
CALL <a name="SLAMRG.183"></a><a href="slamrg.f.html#SLAMRG.1">SLAMRG</a>( N1, N2, D, 1, -1, INDXQ )
ELSE
DO 10 I = 1, N
INDXQ( I ) = I
10 CONTINUE
END IF
<span class="comment">*</span><span class="comment">
</span> 20 CONTINUE
RETURN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> End of <a name="SLAED1.193"></a><a href="slaed1.f.html#SLAED1.1">SLAED1</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?