slasd6.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 330 行 · 第 1/2 页
HTML
330 行
</span><span class="comment">*</span><span class="comment"> POLES (output) REAL array, dimension ( LDGNUM, 2 )
</span><span class="comment">*</span><span class="comment"> On exit, POLES(1,*) is an array containing the new singular
</span><span class="comment">*</span><span class="comment"> values obtained from solving the secular equation, and
</span><span class="comment">*</span><span class="comment"> POLES(2,*) is an array containing the poles in the secular
</span><span class="comment">*</span><span class="comment"> equation. Not referenced if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIFL (output) REAL array, dimension ( N )
</span><span class="comment">*</span><span class="comment"> On exit, DIFL(I) is the distance between I-th updated
</span><span class="comment">*</span><span class="comment"> (undeflated) singular value and the I-th (undeflated) old
</span><span class="comment">*</span><span class="comment"> singular value.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIFR (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDGNUM, 2 ) if ICOMPQ = 1 and
</span><span class="comment">*</span><span class="comment"> dimension ( N ) if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment"> On exit, DIFR(I, 1) is the distance between I-th updated
</span><span class="comment">*</span><span class="comment"> (undeflated) singular value and the I+1-th (undeflated) old
</span><span class="comment">*</span><span class="comment"> singular value.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> If ICOMPQ = 1, DIFR(1:K,2) is an array containing the
</span><span class="comment">*</span><span class="comment"> normalizing factors for the right singular vector matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> See <a name="SLASD8.168"></a><a href="slasd8.f.html#SLASD8.1">SLASD8</a> for details on DIFL and DIFR.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (output) REAL array, dimension ( M )
</span><span class="comment">*</span><span class="comment"> The first elements of this array contain the components
</span><span class="comment">*</span><span class="comment"> of the deflation-adjusted updating row vector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> K (output) INTEGER
</span><span class="comment">*</span><span class="comment"> Contains the dimension of the non-deflated matrix,
</span><span class="comment">*</span><span class="comment"> This is the order of the related secular equation. 1 <= K <=N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> C (output) REAL
</span><span class="comment">*</span><span class="comment"> C contains garbage if SQRE =0 and the C-value of a Givens
</span><span class="comment">*</span><span class="comment"> rotation related to the right null space if SQRE = 1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> S (output) REAL
</span><span class="comment">*</span><span class="comment"> S contains garbage if SQRE =0 and the S-value of a Givens
</span><span class="comment">*</span><span class="comment"> rotation related to the right null space if SQRE = 1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) REAL array, dimension ( 4 * M )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IWORK (workspace) INTEGER array, dimension ( 3 * N )
</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 singular value did not converge
</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"> Ming Gu and Huan Ren, Computer Science Division, University of
</span><span class="comment">*</span><span class="comment"> California at Berkeley, 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"> .. Parameters ..
</span> REAL ONE, ZERO
PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER I, IDX, IDXC, IDXP, ISIGMA, IVFW, IVLW, IW, M,
$ N, N1, N2
REAL ORGNRM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL SCOPY, <a name="SLAMRG.214"></a><a href="slamrg.f.html#SLAMRG.1">SLAMRG</a>, <a name="SLASCL.214"></a><a href="slascl.f.html#SLASCL.1">SLASCL</a>, <a name="SLASD7.214"></a><a href="slasd7.f.html#SLASD7.1">SLASD7</a>, <a name="SLASD8.214"></a><a href="slasd8.f.html#SLASD8.1">SLASD8</a>, <a name="XERBLA.214"></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"> Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> INFO = 0
N = NL + NR + 1
M = N + SQRE
<span class="comment">*</span><span class="comment">
</span> IF( ( ICOMPQ.LT.0 ) .OR. ( ICOMPQ.GT.1 ) ) THEN
INFO = -1
ELSE IF( NL.LT.1 ) THEN
INFO = -2
ELSE IF( NR.LT.1 ) THEN
INFO = -3
ELSE IF( ( SQRE.LT.0 ) .OR. ( SQRE.GT.1 ) ) THEN
INFO = -4
ELSE IF( LDGCOL.LT.N ) THEN
INFO = -14
ELSE IF( LDGNUM.LT.N ) THEN
INFO = -16
END IF
IF( INFO.NE.0 ) THEN
CALL <a name="XERBLA.241"></a><a href="xerbla.f.html#XERBLA.1">XERBLA</a>( <span class="string">'<a name="SLASD6.241"></a><a href="slasd6.f.html#SLASD6.1">SLASD6</a>'</span>, -INFO )
RETURN
END IF
<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="SLASD7.247"></a><a href="slasd7.f.html#SLASD7.1">SLASD7</a> and <a name="SLASD8.247"></a><a href="slasd8.f.html#SLASD8.1">SLASD8</a>.
</span><span class="comment">*</span><span class="comment">
</span> ISIGMA = 1
IW = ISIGMA + N
IVFW = IW + M
IVLW = IVFW + M
<span class="comment">*</span><span class="comment">
</span> IDX = 1
IDXC = IDX + N
IDXP = IDXC + N
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Scale.
</span><span class="comment">*</span><span class="comment">
</span> ORGNRM = MAX( ABS( ALPHA ), ABS( BETA ) )
D( NL+1 ) = ZERO
DO 10 I = 1, N
IF( ABS( D( I ) ).GT.ORGNRM ) THEN
ORGNRM = ABS( D( I ) )
END IF
10 CONTINUE
CALL <a name="SLASCL.267"></a><a href="slascl.f.html#SLASCL.1">SLASCL</a>( <span class="string">'G'</span>, 0, 0, ORGNRM, ONE, N, 1, D, N, INFO )
ALPHA = ALPHA / ORGNRM
BETA = BETA / ORGNRM
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Sort and Deflate singular values.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="SLASD7.273"></a><a href="slasd7.f.html#SLASD7.1">SLASD7</a>( ICOMPQ, NL, NR, SQRE, K, D, Z, WORK( IW ), VF,
$ WORK( IVFW ), VL, WORK( IVLW ), ALPHA, BETA,
$ WORK( ISIGMA ), IWORK( IDX ), IWORK( IDXP ), IDXQ,
$ PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM, C, S,
$ INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Solve Secular Equation, compute DIFL, DIFR, and update VF, VL.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="SLASD8.281"></a><a href="slasd8.f.html#SLASD8.1">SLASD8</a>( ICOMPQ, K, D, Z, VF, VL, DIFL, DIFR, LDGNUM,
$ WORK( ISIGMA ), WORK( IW ), INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Save the poles if ICOMPQ = 1.
</span><span class="comment">*</span><span class="comment">
</span> IF( ICOMPQ.EQ.1 ) THEN
CALL SCOPY( K, D, 1, POLES( 1, 1 ), 1 )
CALL SCOPY( K, WORK( ISIGMA ), 1, POLES( 1, 2 ), 1 )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Unscale.
</span><span class="comment">*</span><span class="comment">
</span> CALL <a name="SLASCL.293"></a><a href="slascl.f.html#SLASCL.1">SLASCL</a>( <span class="string">'G'</span>, 0, 0, ONE, ORGNRM, N, 1, D, N, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Prepare the IDXQ sorting permutation.
</span><span class="comment">*</span><span class="comment">
</span> N1 = K
N2 = N - K
CALL <a name="SLAMRG.299"></a><a href="slamrg.f.html#SLAMRG.1">SLAMRG</a>( N1, N2, D, 1, -1, IDXQ )
<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="SLASD6.303"></a><a href="slasd6.f.html#SLASD6.1">SLASD6</a>
</span><span class="comment">*</span><span class="comment">
</span> END
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?