dlasd6.f.html

来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 330 行 · 第 1/2 页

HTML
330
字号
</span><span class="comment">*</span><span class="comment">  POLES  (output) DOUBLE PRECISION 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) DOUBLE PRECISION 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) DOUBLE PRECISION 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="DLASD8.168"></a><a href="dlasd8.f.html#DLASD8.1">DLASD8</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) DOUBLE PRECISION 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 &lt;= K &lt;=N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  C      (output) DOUBLE PRECISION
</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) DOUBLE PRECISION
</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) DOUBLE PRECISION 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">          &lt; 0:  if INFO = -i, the i-th argument had an illegal value.
</span><span class="comment">*</span><span class="comment">          &gt; 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>      DOUBLE PRECISION   ONE, ZERO
      PARAMETER          ( ONE = 1.0D+0, ZERO = 0.0D+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
      DOUBLE PRECISION   ORGNRM
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           DCOPY, <a name="DLAMRG.214"></a><a href="dlamrg.f.html#DLAMRG.1">DLAMRG</a>, <a name="DLASCL.214"></a><a href="dlascl.f.html#DLASCL.1">DLASCL</a>, <a name="DLASD7.214"></a><a href="dlasd7.f.html#DLASD7.1">DLASD7</a>, <a name="DLASD8.214"></a><a href="dlasd8.f.html#DLASD8.1">DLASD8</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="DLASD6.241"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</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="DLASD7.247"></a><a href="dlasd7.f.html#DLASD7.1">DLASD7</a> and <a name="DLASD8.247"></a><a href="dlasd8.f.html#DLASD8.1">DLASD8</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="DLASCL.267"></a><a href="dlascl.f.html#DLASCL.1">DLASCL</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="DLASD7.273"></a><a href="dlasd7.f.html#DLASD7.1">DLASD7</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="DLASD8.281"></a><a href="dlasd8.f.html#DLASD8.1">DLASD8</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 DCOPY( K, D, 1, POLES( 1, 1 ), 1 )
         CALL DCOPY( 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="DLASCL.293"></a><a href="dlascl.f.html#DLASCL.1">DLASCL</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="DLAMRG.299"></a><a href="dlamrg.f.html#DLAMRG.1">DLAMRG</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="DLASD6.303"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</a>
</span><span class="comment">*</span><span class="comment">
</span>      END

</pre>

 </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?