slasdq.f.html

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

HTML
341
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>slasdq.f</title>
 <meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!-- 
body { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default   { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.default a { background: rgb(255, 255, 255);  color: rgb(0, 0, 0);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.string   { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.string a { color: rgb(188, 143, 143);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
span.comment   { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: none; }
span.comment a { color: rgb(178, 34, 34);  background: rgb(255, 255, 255);  font-style: normal;  font-weight: 500;  font-stretch: normal;  font-family: adobe-courier;  font-size: 11pt;  text-decoration: underline; }
 --></style>

 </head>
  <body>

<pre>
      SUBROUTINE <a name="SLASDQ.1"></a><a href="slasdq.f.html#SLASDQ.1">SLASDQ</a>( UPLO, SQRE, N, NCVT, NRU, NCC, D, E, VT, LDVT,
     $                   U, LDU, C, LDC, WORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK auxiliary routine (version 3.1) --
</span><span class="comment">*</span><span class="comment">     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment">     November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     .. Scalar Arguments ..
</span>      CHARACTER          UPLO
      INTEGER            INFO, LDC, LDU, LDVT, N, NCC, NCVT, NRU, SQRE
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      REAL               C( LDC, * ), D( * ), E( * ), U( LDU, * ),
     $                   VT( LDVT, * ), WORK( * )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Purpose
</span><span class="comment">*</span><span class="comment">  =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="SLASDQ.20"></a><a href="slasdq.f.html#SLASDQ.1">SLASDQ</a> computes the singular value decomposition (SVD) of a real
</span><span class="comment">*</span><span class="comment">  (upper or lower) bidiagonal matrix with diagonal D and offdiagonal
</span><span class="comment">*</span><span class="comment">  E, accumulating the transformations if desired. Letting B denote
</span><span class="comment">*</span><span class="comment">  the input bidiagonal matrix, the algorithm computes orthogonal
</span><span class="comment">*</span><span class="comment">  matrices Q and P such that B = Q * S * P' (P' denotes the transpose
</span><span class="comment">*</span><span class="comment">  of P). The singular values S are overwritten on D.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The input matrix U  is changed to U  * Q  if desired.
</span><span class="comment">*</span><span class="comment">  The input matrix VT is changed to P' * VT if desired.
</span><span class="comment">*</span><span class="comment">  The input matrix C  is changed to Q' * C  if desired.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  See &quot;Computing  Small Singular Values of Bidiagonal Matrices With
</span><span class="comment">*</span><span class="comment">  Guaranteed High Relative Accuracy,&quot; by J. Demmel and W. Kahan,
</span><span class="comment">*</span><span class="comment">  LAPACK Working Note #3, for a detailed description of the algorithm.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Arguments
</span><span class="comment">*</span><span class="comment">  =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  UPLO  (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment">        On entry, UPLO specifies whether the input bidiagonal matrix
</span><span class="comment">*</span><span class="comment">        is upper or lower bidiagonal, and wether it is square are
</span><span class="comment">*</span><span class="comment">        not.
</span><span class="comment">*</span><span class="comment">           UPLO = 'U' or 'u'   B is upper bidiagonal.
</span><span class="comment">*</span><span class="comment">           UPLO = 'L' or 'l'   B is lower bidiagonal.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SQRE  (input) INTEGER
</span><span class="comment">*</span><span class="comment">        = 0: then the input matrix is N-by-N.
</span><span class="comment">*</span><span class="comment">        = 1: then the input matrix is N-by-(N+1) if UPLU = 'U' and
</span><span class="comment">*</span><span class="comment">             (N+1)-by-N if UPLU = 'L'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">        The bidiagonal matrix has
</span><span class="comment">*</span><span class="comment">        N = NL + NR + 1 rows and
</span><span class="comment">*</span><span class="comment">        M = N + SQRE &gt;= N columns.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  N     (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, N specifies the number of rows and columns
</span><span class="comment">*</span><span class="comment">        in the matrix. N must be at least 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NCVT  (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, NCVT specifies the number of columns of
</span><span class="comment">*</span><span class="comment">        the matrix VT. NCVT must be at least 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NRU   (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, NRU specifies the number of rows of
</span><span class="comment">*</span><span class="comment">        the matrix U. NRU must be at least 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NCC   (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, NCC specifies the number of columns of
</span><span class="comment">*</span><span class="comment">        the matrix C. NCC must be at least 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  D     (input/output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment">        On entry, D contains the diagonal entries of the
</span><span class="comment">*</span><span class="comment">        bidiagonal matrix whose SVD is desired. On normal exit,
</span><span class="comment">*</span><span class="comment">        D contains the singular values in ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  E     (input/output) REAL array.
</span><span class="comment">*</span><span class="comment">        dimension is (N-1) if SQRE = 0 and N if SQRE = 1.
</span><span class="comment">*</span><span class="comment">        On entry, the entries of E contain the offdiagonal entries
</span><span class="comment">*</span><span class="comment">        of the bidiagonal matrix whose SVD is desired. On normal
</span><span class="comment">*</span><span class="comment">        exit, E will contain 0. If the algorithm does not converge,
</span><span class="comment">*</span><span class="comment">        D and E will contain the diagonal and superdiagonal entries
</span><span class="comment">*</span><span class="comment">        of a bidiagonal matrix orthogonally equivalent to the one
</span><span class="comment">*</span><span class="comment">        given as input.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  VT    (input/output) REAL array, dimension (LDVT, NCVT)
</span><span class="comment">*</span><span class="comment">        On entry, contains a matrix which on exit has been
</span><span class="comment">*</span><span class="comment">        premultiplied by P', dimension N-by-NCVT if SQRE = 0
</span><span class="comment">*</span><span class="comment">        and (N+1)-by-NCVT if SQRE = 1 (not referenced if NCVT=0).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDVT  (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, LDVT specifies the leading dimension of VT as
</span><span class="comment">*</span><span class="comment">        declared in the calling (sub) program. LDVT must be at
</span><span class="comment">*</span><span class="comment">        least 1. If NCVT is nonzero LDVT must also be at least N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  U     (input/output) REAL array, dimension (LDU, N)
</span><span class="comment">*</span><span class="comment">        On entry, contains a  matrix which on exit has been
</span><span class="comment">*</span><span class="comment">        postmultiplied by Q, dimension NRU-by-N if SQRE = 0
</span><span class="comment">*</span><span class="comment">        and NRU-by-(N+1) if SQRE = 1 (not referenced if NRU=0).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDU   (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, LDU  specifies the leading dimension of U as
</span><span class="comment">*</span><span class="comment">        declared in the calling (sub) program. LDU must be at
</span><span class="comment">*</span><span class="comment">        least max( 1, NRU ) .
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  C     (input/output) REAL array, dimension (LDC, NCC)
</span><span class="comment">*</span><span class="comment">        On entry, contains an N-by-NCC matrix which on exit
</span><span class="comment">*</span><span class="comment">        has been premultiplied by Q'  dimension N-by-NCC if SQRE = 0
</span><span class="comment">*</span><span class="comment">        and (N+1)-by-NCC if SQRE = 1 (not referenced if NCC=0).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDC   (input) INTEGER
</span><span class="comment">*</span><span class="comment">        On entry, LDC  specifies the leading dimension of C as
</span><span class="comment">*</span><span class="comment">        declared in the calling (sub) program. LDC must be at
</span><span class="comment">*</span><span class="comment">        least 1. If NCC is nonzero, LDC must also be at least N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK  (workspace) REAL array, dimension (4*N)
</span><span class="comment">*</span><span class="comment">        Workspace. Only referenced if one of NCVT, NRU, or NCC is
</span><span class="comment">*</span><span class="comment">        nonzero, and if N is at least 2.
</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">        On exit, a value of 0 indicates a successful exit.
</span><span class="comment">*</span><span class="comment">        If INFO &lt; 0, argument number -INFO is illegal.
</span><span class="comment">*</span><span class="comment">        If INFO &gt; 0, the algorithm did not converge, and INFO
</span><span class="comment">*</span><span class="comment">        specifies how many superdiagonals 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               ZERO
      PARAMETER          ( ZERO = 0.0E+0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      LOGICAL            ROTATE
      INTEGER            I, ISUB, IUPLO, J, NP1, SQRE1
      REAL               CS, R, SMIN, SN
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           <a name="SBDSQR.143"></a><a href="sbdsqr.f.html#SBDSQR.1">SBDSQR</a>, <a name="SLARTG.143"></a><a href="slartg.f.html#SLARTG.1">SLARTG</a>, <a name="SLASR.143"></a><a href="slasr.f.html#SLASR.1">SLASR</a>, SSWAP, <a name="XERBLA.143"></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">     .. External Functions ..
</span>      LOGICAL            <a name="LSAME.146"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
      EXTERNAL           <a name="LSAME.147"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          MAX
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Executable Statements ..

⌨️ 快捷键说明

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