zlaed7.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 289 行 · 第 1/2 页
HTML
289 行
</span><span class="comment">*</span><span class="comment"> Contains the permutations (from deflation and sorting) to be
</span><span class="comment">*</span><span class="comment"> applied to each eigenblock.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GIVPTR (input) INTEGER array, dimension (N lg N)
</span><span class="comment">*</span><span class="comment"> Contains a list of pointers which indicate where in GIVCOL a
</span><span class="comment">*</span><span class="comment"> level's Givens rotations are stored. GIVPTR(i+1) - GIVPTR(i)
</span><span class="comment">*</span><span class="comment"> indicates the number of Givens rotations.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GIVCOL (input) INTEGER array, dimension (2, N lg N)
</span><span class="comment">*</span><span class="comment"> Each pair of numbers indicates a pair of columns to take place
</span><span class="comment">*</span><span class="comment"> in a Givens rotation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GIVNUM (input) DOUBLE PRECISION array, dimension (2, N lg N)
</span><span class="comment">*</span><span class="comment"> Each number indicates the S value to be used in the
</span><span class="comment">*</span><span class="comment"> corresponding Givens rotation.
</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 = 1, an eigenvalue did not converge
</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, CURR, I, IDLMDA, INDX,
$ INDXC, INDXP, IQ, IW, IZ, K, N1, N2, PTR
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL <a name="DLAED9.155"></a><a href="dlaed9.f.html#DLAED9.1">DLAED9</a>, <a name="DLAEDA.155"></a><a href="dlaeda.f.html#DLAEDA.1">DLAEDA</a>, <a name="DLAMRG.155"></a><a href="dlamrg.f.html#DLAMRG.1">DLAMRG</a>, <a name="XERBLA.155"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>, <a name="ZLACRM.155"></a><a href="zlacrm.f.html#ZLACRM.1">ZLACRM</a>, <a name="ZLAED8.155"></a><a href="zlaed8.f.html#ZLAED8.1">ZLAED8</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><span class="comment">*</span><span class="comment"> IF( ICOMPQ.LT.0 .OR. ICOMPQ.GT.1 ) THEN
</span><span class="comment">*</span><span class="comment"> INFO = -1
</span><span class="comment">*</span><span class="comment"> ELSE IF( N.LT.0 ) THEN
</span> IF( N.LT.0 ) THEN
INFO = -1
ELSE IF( MIN( 1, N ).GT.CUTPNT .OR. N.LT.CUTPNT ) THEN
INFO = -2
ELSE IF( QSIZ.LT.N ) THEN
INFO = -3
ELSE IF( LDQ.LT.MAX( 1, N ) ) THEN
INFO = -9
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.179"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="ZLAED7.179"></a><a href="zlaed7.f.html#ZLAED7.1">ZLAED7</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 for bookkeeping purposes only. They are
</span><span class="comment">*</span><span class="comment"> integer pointers which indicate the portion of the workspace
</span><span class="comment">*</span><span class="comment"> used by a particular array in <a name="DLAED2.190"></a><a href="dlaed2.f.html#DLAED2.1">DLAED2</a> and <a name="SLAED3.190"></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
IQ = 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"> 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> PTR = 1 + 2**TLVLS
DO 10 I = 1, CURLVL - 1
PTR = PTR + 2**( TLVLS-I )
10 CONTINUE
CURR = PTR + CURPBM
CALL <a name="DLAEDA.210"></a><a href="dlaeda.f.html#DLAEDA.1">DLAEDA</a>( N, TLVLS, CURLVL, CURPBM, PRMPTR, PERM, GIVPTR,
$ GIVCOL, GIVNUM, QSTORE, QPTR, RWORK( IZ ),
$ RWORK( IZ+N ), INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> When solving the final problem, we no longer need the stored data,
</span><span class="comment">*</span><span class="comment"> so we will overwrite the data from this level onto the previously
</span><span class="comment">*</span><span class="comment"> used storage space.
</span><span class="comment">*</span><span class="comment">
</span> IF( CURLVL.EQ.TLVLS ) THEN
QPTR( CURR ) = 1
PRMPTR( CURR ) = 1
GIVPTR( CURR ) = 1
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Sort and Deflate eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="ZLAED8.226"></a><a href="zlaed8.f.html#ZLAED8.1">ZLAED8</a>( K, N, QSIZ, Q, LDQ, D, RHO, CUTPNT, RWORK( IZ ),
$ RWORK( IDLMDA ), WORK, QSIZ, RWORK( IW ),
$ IWORK( INDXP ), IWORK( INDX ), INDXQ,
$ PERM( PRMPTR( CURR ) ), GIVPTR( CURR+1 ),
$ GIVCOL( 1, GIVPTR( CURR ) ),
$ GIVNUM( 1, GIVPTR( CURR ) ), INFO )
PRMPTR( CURR+1 ) = PRMPTR( CURR ) + N
GIVPTR( CURR+1 ) = GIVPTR( CURR+1 ) + GIVPTR( CURR )
<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
CALL <a name="DLAED9.238"></a><a href="dlaed9.f.html#DLAED9.1">DLAED9</a>( K, 1, K, N, D, RWORK( IQ ), K, RHO,
$ RWORK( IDLMDA ), RWORK( IW ),
$ QSTORE( QPTR( CURR ) ), K, INFO )
CALL <a name="ZLACRM.241"></a><a href="zlacrm.f.html#ZLACRM.1">ZLACRM</a>( QSIZ, K, WORK, QSIZ, QSTORE( QPTR( CURR ) ), K, Q,
$ LDQ, RWORK( IQ ) )
QPTR( CURR+1 ) = QPTR( CURR ) + K**2
IF( INFO.NE.0 ) THEN
RETURN
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Prepare the INDXQ sorting premutation.
</span><span class="comment">*</span><span class="comment">
</span> N1 = K
N2 = N - K
CALL <a name="DLAMRG.252"></a><a href="dlamrg.f.html#DLAMRG.1">DLAMRG</a>( N1, N2, D, 1, -1, INDXQ )
ELSE
QPTR( CURR+1 ) = QPTR( CURR )
DO 20 I = 1, N
INDXQ( I ) = I
20 CONTINUE
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="ZLAED7.262"></a><a href="zlaed7.f.html#ZLAED7.1">ZLAED7</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?