slalsd.f.html

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

HTML
459
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>slalsd.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="SLALSD.1"></a><a href="slalsd.f.html#SLALSD.1">SLALSD</a>( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND,
     $                   RANK, WORK, IWORK, INFO )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  -- LAPACK 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, LDB, N, NRHS, RANK, SMLSIZ
      REAL               RCOND
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            IWORK( * )
      REAL               B( LDB, * ), D( * ), E( * ), 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="SLALSD.21"></a><a href="slalsd.f.html#SLALSD.1">SLALSD</a> uses the singular value decomposition of A to solve the least
</span><span class="comment">*</span><span class="comment">  squares problem of finding X to minimize the Euclidean norm of each
</span><span class="comment">*</span><span class="comment">  column of A*X-B, where A is N-by-N upper bidiagonal, and X and B
</span><span class="comment">*</span><span class="comment">  are N-by-NRHS. The solution X overwrites B.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The singular values of A smaller than RCOND times the largest
</span><span class="comment">*</span><span class="comment">  singular value are treated as zero in solving the least squares
</span><span class="comment">*</span><span class="comment">  problem; in this case a minimum norm solution is returned.
</span><span class="comment">*</span><span class="comment">  The actual singular values are returned in D in ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  This code makes very mild assumptions about floating point
</span><span class="comment">*</span><span class="comment">  arithmetic. It will work on machines with a guard digit in
</span><span class="comment">*</span><span class="comment">  add/subtract, or on those binary machines without guard digits
</span><span class="comment">*</span><span class="comment">  which subtract like the Cray XMP, Cray YMP, Cray C 90, or Cray 2.
</span><span class="comment">*</span><span class="comment">  It could conceivably fail on hexadecimal or decimal machines
</span><span class="comment">*</span><span class="comment">  without guard digits, but we know of none.
</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">         = 'U': D and E define an upper bidiagonal matrix.
</span><span class="comment">*</span><span class="comment">         = 'L': D and E define a  lower bidiagonal matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  SMLSIZ (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The maximum size of the subproblems at the bottom of the
</span><span class="comment">*</span><span class="comment">         computation tree.
</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">         The dimension of the  bidiagonal matrix.  N &gt;= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NRHS   (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The number of columns of B. NRHS must be at least 1.
</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 main diagonal of the bidiagonal
</span><span class="comment">*</span><span class="comment">         matrix. On exit, if INFO = 0, D contains its singular values.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  E      (input/output) REAL array, dimension (N-1)
</span><span class="comment">*</span><span class="comment">         Contains the super-diagonal entries of the bidiagonal matrix.
</span><span class="comment">*</span><span class="comment">         On exit, E has been destroyed.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B      (input/output) REAL array, dimension (LDB,NRHS)
</span><span class="comment">*</span><span class="comment">         On input, B contains the right hand sides of the least
</span><span class="comment">*</span><span class="comment">         squares problem. On output, B contains the solution X.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDB    (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The leading dimension of B in the calling subprogram.
</span><span class="comment">*</span><span class="comment">         LDB must be at least max(1,N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RCOND  (input) REAL
</span><span class="comment">*</span><span class="comment">         The singular values of A less than or equal to RCOND times
</span><span class="comment">*</span><span class="comment">         the largest singular value are treated as zero in solving
</span><span class="comment">*</span><span class="comment">         the least squares problem. If RCOND is negative,
</span><span class="comment">*</span><span class="comment">         machine precision is used instead.
</span><span class="comment">*</span><span class="comment">         For example, if diag(S)*X=B were the least squares problem,
</span><span class="comment">*</span><span class="comment">         where diag(S) is a diagonal matrix of singular values, the
</span><span class="comment">*</span><span class="comment">         solution would be X(i) = B(i) / S(i) if S(i) is greater than
</span><span class="comment">*</span><span class="comment">         RCOND*max(S), and X(i) = 0 if S(i) is less than or equal to
</span><span class="comment">*</span><span class="comment">         RCOND*max(S).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  RANK   (output) INTEGER
</span><span class="comment">*</span><span class="comment">         The number of singular values of A greater than RCOND times
</span><span class="comment">*</span><span class="comment">         the largest singular value.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  WORK   (workspace) REAL array, dimension at least
</span><span class="comment">*</span><span class="comment">         (9*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2),
</span><span class="comment">*</span><span class="comment">         where NLVL = max(0, INT(log_2 (N/(SMLSIZ+1))) + 1).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IWORK  (workspace) INTEGER array, dimension at least
</span><span class="comment">*</span><span class="comment">         (3*N*NLVL + 11*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:  The algorithm failed to compute an singular value while
</span><span class="comment">*</span><span class="comment">               working on the submatrix lying in rows and columns
</span><span class="comment">*</span><span class="comment">               INFO/(N+1) through MOD(INFO,N+1).
</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 Ren-Cang Li, 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">     Osni Marques, LBNL/NERSC, 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, ONE, TWO
      PARAMETER          ( ZERO = 0.0E0, ONE = 1.0E0, TWO = 2.0E0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      INTEGER            BX, BXST, C, DIFL, DIFR, GIVCOL, GIVNUM,
     $                   GIVPTR, I, ICMPQ1, ICMPQ2, IWK, J, K, NLVL,
     $                   NM1, NSIZE, NSUB, NWORK, PERM, POLES, S, SIZEI,
     $                   SMLSZP, SQRE, ST, ST1, U, VT, Z
      REAL               CS, EPS, ORGNRM, R, RCND, SN, TOL
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Functions ..
</span>      INTEGER            ISAMAX
      REAL               <a name="SLAMCH.123"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANST.123"></a><a href="slanst.f.html#SLANST.1">SLANST</a>
      EXTERNAL           ISAMAX, <a name="SLAMCH.124"></a><a href="slamch.f.html#SLAMCH.1">SLAMCH</a>, <a name="SLANST.124"></a><a href="slanst.f.html#SLANST.1">SLANST</a>
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           SCOPY, SGEMM, <a name="SLACPY.127"></a><a href="slacpy.f.html#SLACPY.1">SLACPY</a>, <a name="SLALSA.127"></a><a href="slalsa.f.html#SLALSA.1">SLALSA</a>, <a name="SLARTG.127"></a><a href="slartg.f.html#SLARTG.1">SLARTG</a>, <a name="SLASCL.127"></a><a href="slascl.f.html#SLASCL.1">SLASCL</a>,
     $                   <a name="SLASDA.128"></a><a href="slasda.f.html#SLASDA.1">SLASDA</a>, <a name="SLASDQ.128"></a><a href="slasdq.f.html#SLASDQ.1">SLASDQ</a>, <a name="SLASET.128"></a><a href="slaset.f.html#SLASET.1">SLASET</a>, <a name="SLASRT.128"></a><a href="slasrt.f.html#SLASRT.1">SLASRT</a>, SROT, <a name="XERBLA.128"></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, INT, LOG, REAL, SIGN
<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">

⌨️ 快捷键说明

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