dlasd6.f.html

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

HTML
330
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dlasd6.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="DLASD6.1"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</a>( ICOMPQ, NL, NR, SQRE, D, VF, VL, ALPHA, BETA,
     $                   IDXQ, PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM,
     $                   LDGNUM, POLES, DIFL, DIFR, Z, K, C, S, WORK,
     $                   IWORK, 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            GIVPTR, ICOMPQ, INFO, K, LDGCOL, LDGNUM, NL,
     $                   NR, SQRE
      DOUBLE PRECISION   ALPHA, BETA, C, S
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            GIVCOL( LDGCOL, * ), IDXQ( * ), IWORK( * ),
     $                   PERM( * )
      DOUBLE PRECISION   D( * ), DIFL( * ), DIFR( * ),
     $                   GIVNUM( LDGNUM, * ), POLES( LDGNUM, * ),
     $                   VF( * ), VL( * ), WORK( * ), Z( * )
<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="DLASD6.26"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</a> computes the SVD of an updated upper bidiagonal matrix B
</span><span class="comment">*</span><span class="comment">  obtained by merging two smaller ones by appending a row. This
</span><span class="comment">*</span><span class="comment">  routine is used only for the problem which requires all singular
</span><span class="comment">*</span><span class="comment">  values and optionally singular vector matrices in factored form.
</span><span class="comment">*</span><span class="comment">  B is an N-by-M matrix with N = NL + NR + 1 and M = N + SQRE.
</span><span class="comment">*</span><span class="comment">  A related subroutine, <a name="DLASD1.31"></a><a href="dlasd1.f.html#DLASD1.1">DLASD1</a>, handles the case in which all singular
</span><span class="comment">*</span><span class="comment">  values and singular vectors of the bidiagonal matrix are desired.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="DLASD6.34"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</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 singular values of B can be computed using D1, D2, the first
</span><span class="comment">*</span><span class="comment">  components of all the right singular vectors of the lower block, and
</span><span class="comment">*</span><span class="comment">  the last components of all the right singular vectors of the upper
</span><span class="comment">*</span><span class="comment">  block. These components are stored and updated in VF and VL,
</span><span class="comment">*</span><span class="comment">  respectively, in <a name="DLASD6.50"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</a>. Hence U and VT are not explicitly
</span><span class="comment">*</span><span class="comment">  referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  The singular values are stored in D. The algorithm consists of two
</span><span class="comment">*</span><span class="comment">  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 if there is a zero
</span><span class="comment">*</span><span class="comment">        in 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="DLASD7.60"></a><a href="dlasd7.f.html#DLASD7.1">DLASD7</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 roots of the
</span><span class="comment">*</span><span class="comment">        secular equation via the routine <a name="DLASD4.64"></a><a href="dlasd4.f.html#DLASD4.1">DLASD4</a> (as called by <a name="DLASD8.64"></a><a href="dlasd8.f.html#DLASD8.1">DLASD8</a>).
</span><span class="comment">*</span><span class="comment">        This routine also updates VF and VL and computes the distances
</span><span class="comment">*</span><span class="comment">        between the updated singular values and the old singular
</span><span class="comment">*</span><span class="comment">        values.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  <a name="DLASD6.69"></a><a href="dlasd6.f.html#DLASD6.1">DLASD6</a> is called from <a name="DLASDA.69"></a><a href="dlasda.f.html#DLASDA.1">DLASDA</a>.
</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">  ICOMPQ (input) INTEGER
</span><span class="comment">*</span><span class="comment">         Specifies whether singular vectors are to be computed in
</span><span class="comment">*</span><span class="comment">         factored form:
</span><span class="comment">*</span><span class="comment">         = 0: Compute singular values only.
</span><span class="comment">*</span><span class="comment">         = 1: Compute singular vectors in factored form as well.
</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, dimension ( 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
</span><span class="comment">*</span><span class="comment">         of the lower block. On exit D(1:N) contains the singular
</span><span class="comment">*</span><span class="comment">         values of the modified matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  VF     (input/output) DOUBLE PRECISION array, dimension ( M )
</span><span class="comment">*</span><span class="comment">         On entry, VF(1:NL+1) contains the first components of all
</span><span class="comment">*</span><span class="comment">         right singular vectors of the upper block; and VF(NL+2:M)
</span><span class="comment">*</span><span class="comment">         contains the first components of all right singular vectors
</span><span class="comment">*</span><span class="comment">         of the lower block. On exit, VF contains the first components
</span><span class="comment">*</span><span class="comment">         of all right singular vectors of the bidiagonal matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  VL     (input/output) DOUBLE PRECISION array, dimension ( M )
</span><span class="comment">*</span><span class="comment">         On entry, VL(1:NL+1) contains the  last components of all
</span><span class="comment">*</span><span class="comment">         right singular vectors of the upper block; and VL(NL+2:M)
</span><span class="comment">*</span><span class="comment">         contains the last components of all right singular vectors of
</span><span class="comment">*</span><span class="comment">         the lower block. On exit, VL contains the last components of
</span><span class="comment">*</span><span class="comment">         all right singular vectors of the bidiagonal 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">  IDXQ   (output) INTEGER array, dimension ( N )
</span><span class="comment">*</span><span class="comment">         This contains the permutation which will reintegrate the
</span><span class="comment">*</span><span class="comment">         subproblem just solved back into sorted order, i.e.
</span><span class="comment">*</span><span class="comment">         D( IDXQ( I = 1, N ) ) will be in ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  PERM   (output) INTEGER array, dimension ( N )
</span><span class="comment">*</span><span class="comment">         The permutations (from deflation and sorting) to be applied
</span><span class="comment">*</span><span class="comment">         to each block. Not referenced if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVPTR (output) INTEGER
</span><span class="comment">*</span><span class="comment">         The number of Givens rotations which took place in this
</span><span class="comment">*</span><span class="comment">         subproblem. Not referenced if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVCOL (output) INTEGER array, dimension ( LDGCOL, 2 )
</span><span class="comment">*</span><span class="comment">         Each pair of numbers indicates a pair of columns to take place
</span><span class="comment">*</span><span class="comment">         in a Givens rotation. Not referenced if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDGCOL (input) INTEGER
</span><span class="comment">*</span><span class="comment">         leading dimension of GIVCOL, must be at least N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVNUM (output) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
</span><span class="comment">*</span><span class="comment">         Each number indicates the C or S value to be used in the
</span><span class="comment">*</span><span class="comment">         corresponding Givens rotation. Not referenced if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDGNUM (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The leading dimension of GIVNUM and POLES, must be at least N.
</span><span class="comment">*</span><span class="comment">

⌨️ 快捷键说明

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