dlasd1.f.html

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

HTML
257
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dlasd1.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="DLASD1.1"></a><a href="dlasd1.f.html#DLASD1.1">DLASD1</a>( NL, NR, SQRE, D, ALPHA, BETA, U, LDU, VT, LDVT,
     $                   IDXQ, IWORK, 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>      INTEGER            INFO, LDU, LDVT, NL, NR, SQRE
      DOUBLE PRECISION   ALPHA, BETA
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            IDXQ( * ), IWORK( * )
      DOUBLE PRECISION   D( * ), 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="DLASD1.20"></a><a href="dlasd1.f.html#DLASD1.1">DLASD1</a> computes the SVD of an upper bidiagonal N-by-M matrix B,
</span><span class="comment">*</span><span class="comment">  where N = NL + NR + 1 and M = N + SQRE. <a name="DLASD1.21"></a><a href="dlasd1.f.html#DLASD1.1">DLASD1</a> is called from <a name="DLASD0.21"></a><a href="dlasd0.f.html#DLASD0.1">DLASD0</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  A related subroutine <a name="DLASD7.23"></a><a href="dlasd7.f.html#DLASD7.1">DLASD7</a> handles the case in which the singular
</span><span class="comment">*</span><span class="comment">  values (and the singular vectors in factored form) are desired.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="DLASD1.26"></a><a href="dlasd1.f.html#DLASD1.1">DLASD1</a> computes the SVD as follows:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">                ( D1(in)  0    0     0 )
</span><span class="comment">*</span><span class="comment">    B = U(in) * (   Z1'   a   Z2'    b ) * VT(in)
</span><span class="comment">*</span><span class="comment">                (   0     0   D2(in) 0 )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">      = U(out) * ( D(out) 0) * VT(out)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  where Z' = (Z1' a Z2' b) = u' VT', and u is a vector of dimension M
</span><span class="comment">*</span><span class="comment">  with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros
</span><span class="comment">*</span><span class="comment">  elsewhere; and the entry b is empty if SQRE = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The left singular vectors of the original matrix are stored in U, and
</span><span class="comment">*</span><span class="comment">  the transpose of the right singular vectors are stored in VT, and the
</span><span class="comment">*</span><span class="comment">  singular values are in D.  The algorithm consists of three stages:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     The first stage consists of deflating the size of the problem
</span><span class="comment">*</span><span class="comment">     when there are multiple singular values or when there are zeros in
</span><span class="comment">*</span><span class="comment">     the Z vector.  For each such occurence the dimension of the
</span><span class="comment">*</span><span class="comment">     secular equation problem is reduced by one.  This stage is
</span><span class="comment">*</span><span class="comment">     performed by the routine <a name="DLASD2.46"></a><a href="dlasd2.f.html#DLASD2.1">DLASD2</a>.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     The second stage consists of calculating the updated
</span><span class="comment">*</span><span class="comment">     singular values. This is done by finding the square roots of the
</span><span class="comment">*</span><span class="comment">     roots of the secular equation via the routine <a name="DLASD4.50"></a><a href="dlasd4.f.html#DLASD4.1">DLASD4</a> (as called
</span><span class="comment">*</span><span class="comment">     by <a name="DLASD3.51"></a><a href="dlasd3.f.html#DLASD3.1">DLASD3</a>). This routine also calculates the singular vectors of
</span><span class="comment">*</span><span class="comment">     the current problem.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">     The final stage consists of computing the updated singular vectors
</span><span class="comment">*</span><span class="comment">     directly using the updated singular values.  The singular vectors
</span><span class="comment">*</span><span class="comment">     for the current problem are multiplied with the singular vectors
</span><span class="comment">*</span><span class="comment">     from the overall problem.
</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">  NL     (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The row dimension of the upper block.  NL &gt;= 1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  NR     (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The row dimension of the lower block.  NR &gt;= 1.
</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: the lower block is an NR-by-NR square matrix.
</span><span class="comment">*</span><span class="comment">         = 1: the lower block is an NR-by-(NR+1) rectangular matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">         The bidiagonal matrix has row dimension N = NL + NR + 1,
</span><span class="comment">*</span><span class="comment">         and column dimension M = N + SQRE.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  D      (input/output) DOUBLE PRECISION array,
</span><span class="comment">*</span><span class="comment">                        dimension (N = NL+NR+1).
</span><span class="comment">*</span><span class="comment">         On entry D(1:NL,1:NL) contains the singular values of the
</span><span class="comment">*</span><span class="comment">         upper block; and D(NL+2:N) contains the singular values of
</span><span class="comment">*</span><span class="comment">         the lower block. On exit D(1:N) contains the singular values
</span><span class="comment">*</span><span class="comment">         of the modified matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  ALPHA  (input/output) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">         Contains the diagonal element associated with the added row.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  BETA   (input/output) DOUBLE PRECISION
</span><span class="comment">*</span><span class="comment">         Contains the off-diagonal element associated with the added
</span><span class="comment">*</span><span class="comment">         row.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  U      (input/output) DOUBLE PRECISION array, dimension(LDU,N)
</span><span class="comment">*</span><span class="comment">         On entry U(1:NL, 1:NL) contains the left singular vectors of
</span><span class="comment">*</span><span class="comment">         the upper block; U(NL+2:N, NL+2:N) contains the left singular
</span><span class="comment">*</span><span class="comment">         vectors of the lower block. On exit U contains the left
</span><span class="comment">*</span><span class="comment">         singular vectors of the bidiagonal matrix.
</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">         The leading dimension of the array U.  LDU &gt;= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  VT     (input/output) DOUBLE PRECISION array, dimension(LDVT,M)
</span><span class="comment">*</span><span class="comment">         where M = N + SQRE.
</span><span class="comment">*</span><span class="comment">         On entry VT(1:NL+1, 1:NL+1)' contains the right singular
</span><span class="comment">*</span><span class="comment">         vectors of the upper block; VT(NL+2:M, NL+2:M)' contains
</span><span class="comment">*</span><span class="comment">         the right singular vectors of the lower block. On exit
</span><span class="comment">*</span><span class="comment">         VT' contains the right singular vectors of the
</span><span class="comment">*</span><span class="comment">         bidiagonal matrix.
</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">         The leading dimension of the array VT.  LDVT &gt;= max( 1, M ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  IDXQ  (output) INTEGER array, dimension(N)
</span><span class="comment">*</span><span class="comment">         This contains the permutation which will reintegrate the

⌨️ 快捷键说明

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