dlals0.f.html

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

HTML
402
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <title>dlals0.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="DLALS0.1"></a><a href="dlals0.f.html#DLALS0.1">DLALS0</a>( ICOMPQ, NL, NR, SQRE, NRHS, B, LDB, BX, LDBX,
     $                   PERM, GIVPTR, GIVCOL, LDGCOL, GIVNUM, LDGNUM,
     $                   POLES, DIFL, DIFR, Z, K, C, S, WORK, 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>      INTEGER            GIVPTR, ICOMPQ, INFO, K, LDB, LDBX, LDGCOL,
     $                   LDGNUM, NL, NR, NRHS, SQRE
      DOUBLE PRECISION   C, S
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Array Arguments ..
</span>      INTEGER            GIVCOL( LDGCOL, * ), PERM( * )
      DOUBLE PRECISION   B( LDB, * ), BX( LDBX, * ), DIFL( * ),
     $                   DIFR( LDGNUM, * ), GIVNUM( LDGNUM, * ),
     $                   POLES( LDGNUM, * ), 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="DLALS0.24"></a><a href="dlals0.f.html#DLALS0.1">DLALS0</a> applies back the multiplying factors of either the left or the
</span><span class="comment">*</span><span class="comment">  right singular vector matrix of a diagonal matrix appended by a row
</span><span class="comment">*</span><span class="comment">  to the right hand side matrix B in solving the least squares problem
</span><span class="comment">*</span><span class="comment">  using the divide-and-conquer SVD approach.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  For the left singular vector matrix, three types of orthogonal
</span><span class="comment">*</span><span class="comment">  matrices are involved:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (1L) Givens rotations: the number of such rotations is GIVPTR; the
</span><span class="comment">*</span><span class="comment">       pairs of columns/rows they were applied to are stored in GIVCOL;
</span><span class="comment">*</span><span class="comment">       and the C- and S-values of these rotations are stored in GIVNUM.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (2L) Permutation. The (NL+1)-st row of B is to be moved to the first
</span><span class="comment">*</span><span class="comment">       row, and for J=2:N, PERM(J)-th row of B is to be moved to the
</span><span class="comment">*</span><span class="comment">       J-th row.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (3L) The left singular vector matrix of the remaining matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  For the right singular vector matrix, four types of orthogonal
</span><span class="comment">*</span><span class="comment">  matrices are involved:
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (1R) The right singular vector matrix of the remaining matrix.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (2R) If SQRE = 1, one extra Givens rotation to generate the right
</span><span class="comment">*</span><span class="comment">       null space.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (3R) The inverse transformation of (2L).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  (4R) The inverse transformation of (1L).
</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: Left singular vector matrix.
</span><span class="comment">*</span><span class="comment">         = 1: Right singular vector matrix.
</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">  NRHS   (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The number of columns of B and BX. NRHS must be at least 1.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  B      (input/output) DOUBLE PRECISION 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 in rows 1 through M. On output, B contains
</span><span class="comment">*</span><span class="comment">         the solution X in rows 1 through N.
</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. LDB must be at least
</span><span class="comment">*</span><span class="comment">         max(1,MAX( M, N ) ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  BX     (workspace) DOUBLE PRECISION array, dimension ( LDBX, NRHS )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  LDBX   (input) INTEGER
</span><span class="comment">*</span><span class="comment">         The leading dimension of BX.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  PERM   (input) INTEGER array, dimension ( N )
</span><span class="comment">*</span><span class="comment">         The permutations (from deflation and sorting) applied
</span><span class="comment">*</span><span class="comment">         to the two blocks.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVPTR (input) 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.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  GIVCOL (input) INTEGER array, dimension ( LDGCOL, 2 )
</span><span class="comment">*</span><span class="comment">         Each pair of numbers indicates a pair of rows/columns
</span><span class="comment">*</span><span class="comment">         involved in a Givens rotation.
</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">         The 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 (input) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
</span><span class="comment">*</span><span class="comment">         Each number indicates the C or S value used in the
</span><span class="comment">*</span><span class="comment">         corresponding Givens rotation.
</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 arrays DIFR, POLES and
</span><span class="comment">*</span><span class="comment">         GIVNUM, must be at least K.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  POLES  (input) DOUBLE PRECISION array, dimension ( LDGNUM, 2 )
</span><span class="comment">*</span><span class="comment">         On entry, POLES(1:K, 1) contains 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(1:K, 2) is an array containing the poles in the secular
</span><span class="comment">*</span><span class="comment">         equation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  DIFL   (input) DOUBLE PRECISION array, dimension ( K ).
</span><span class="comment">*</span><span class="comment">         On entry, 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   (input) DOUBLE PRECISION array, dimension ( LDGNUM, 2 ).
</span><span class="comment">*</span><span class="comment">         On entry, DIFR(I, 1) contains the distances between I-th
</span><span class="comment">*</span><span class="comment">         updated (undeflated) singular value and the I+1-th
</span><span class="comment">*</span><span class="comment">         (undeflated) old singular value. And DIFR(I, 2) is the
</span><span class="comment">*</span><span class="comment">         normalizing factor for the I-th right singular vector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  Z      (input) DOUBLE PRECISION array, dimension ( K )
</span><span class="comment">*</span><span class="comment">         Contain the components of the deflation-adjusted updating row
</span><span class="comment">*</span><span class="comment">         vector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment">  K      (input) 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      (input) 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      (input) 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 ( K )
</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">
</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>      DOUBLE PRECISION   ONE, ZERO, NEGONE
      PARAMETER          ( ONE = 1.0D0, ZERO = 0.0D0, NEGONE = -1.0D0 )
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Local Scalars ..
</span>      INTEGER            I, J, M, N, NLP1
      DOUBLE PRECISION   DIFLJ, DIFRJ, DJ, DSIGJ, DSIGJP, TEMP
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. External Subroutines ..
</span>      EXTERNAL           DCOPY, DGEMV, <a name="DLACPY.174"></a><a href="dlacpy.f.html#DLACPY.1">DLACPY</a>, <a name="DLASCL.174"></a><a href="dlascl.f.html#DLASCL.1">DLASCL</a>, DROT, DSCAL,
     $                   <a name="XERBLA.175"></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>      DOUBLE PRECISION   <a name="DLAMC3.178"></a><a href="dlamch.f.html#DLAMC3.574">DLAMC3</a>, DNRM2
      EXTERNAL           <a name="DLAMC3.179"></a><a href="dlamch.f.html#DLAMC3.574">DLAMC3</a>, DNRM2
<span class="comment">*</span><span class="comment">     ..
</span><span class="comment">*</span><span class="comment">     .. Intrinsic Functions ..
</span>      INTRINSIC          MAX

⌨️ 快捷键说明

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