dlasd2.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 537 行 · 第 1/3 页
HTML
537 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>dlasd2.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="DLASD2.1"></a><a href="dlasd2.f.html#DLASD2.1">DLASD2</a>( NL, NR, SQRE, K, D, Z, ALPHA, BETA, U, LDU, VT,
$ LDVT, DSIGMA, U2, LDU2, VT2, LDVT2, IDXP, IDX,
$ IDXC, IDXQ, COLTYP, 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, K, LDU, LDU2, LDVT, LDVT2, 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 COLTYP( * ), IDX( * ), IDXC( * ), IDXP( * ),
$ IDXQ( * )
DOUBLE PRECISION D( * ), DSIGMA( * ), U( LDU, * ),
$ U2( LDU2, * ), VT( LDVT, * ), VT2( LDVT2, * ),
$ 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="DLASD2.24"></a><a href="dlasd2.f.html#DLASD2.1">DLASD2</a> merges the two sets of singular values together into a single
</span><span class="comment">*</span><span class="comment"> sorted set. Then it tries to deflate the size of the problem.
</span><span class="comment">*</span><span class="comment"> There are two ways in which deflation can occur: when two or more
</span><span class="comment">*</span><span class="comment"> singular values are close together or if there is a tiny entry in the
</span><span class="comment">*</span><span class="comment"> Z vector. For each such occurrence the order of the related secular
</span><span class="comment">*</span><span class="comment"> equation problem is reduced by one.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="DLASD2.31"></a><a href="dlasd2.f.html#DLASD2.1">DLASD2</a> is called from <a name="DLASD1.31"></a><a href="dlasd1.f.html#DLASD1.1">DLASD1</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"> NL (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The row dimension of the upper block. NL >= 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 >= 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 N = NL + NR + 1 rows and
</span><span class="comment">*</span><span class="comment"> M = N + SQRE >= N columns.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> K (output) 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 <= K <=N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> D (input/output) DOUBLE PRECISION array, dimension(N)
</span><span class="comment">*</span><span class="comment"> On entry D contains the singular values of the two submatrices
</span><span class="comment">*</span><span class="comment"> to be combined. On exit D contains the trailing (N-K) updated
</span><span class="comment">*</span><span class="comment"> singular values (those which were deflated) sorted into
</span><span class="comment">*</span><span class="comment"> increasing order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (output) DOUBLE PRECISION array, dimension(N)
</span><span class="comment">*</span><span class="comment"> On exit Z contains the updating row vector 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"> ALPHA (input) 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) 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 contains the left singular vectors of two
</span><span class="comment">*</span><span class="comment"> submatrices in the two square blocks with corners at (1,1),
</span><span class="comment">*</span><span class="comment"> (NL, NL), and (NL+2, NL+2), (N,N).
</span><span class="comment">*</span><span class="comment"> On exit U contains the trailing (N-K) updated left singular
</span><span class="comment">*</span><span class="comment"> vectors (those which were deflated) in its last N-K columns.
</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 >= 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"> On entry VT' contains the right singular vectors of two
</span><span class="comment">*</span><span class="comment"> submatrices in the two square blocks with corners at (1,1),
</span><span class="comment">*</span><span class="comment"> (NL+1, NL+1), and (NL+2, NL+2), (M,M).
</span><span class="comment">*</span><span class="comment"> On exit VT' contains the trailing (N-K) updated right singular
</span><span class="comment">*</span><span class="comment"> vectors (those which were deflated) in its last N-K columns.
</span><span class="comment">*</span><span class="comment"> In case SQRE =1, the last row of VT spans the right null
</span><span class="comment">*</span><span class="comment"> space.
</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 >= M.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DSIGMA (output) DOUBLE PRECISION array, dimension (N)
</span><span class="comment">*</span><span class="comment"> Contains a copy of the diagonal elements (K-1 singular values
</span><span class="comment">*</span><span class="comment"> and one zero) in the secular equation.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> U2 (output) DOUBLE PRECISION array, dimension(LDU2,N)
</span><span class="comment">*</span><span class="comment"> Contains a copy of the first K-1 left singular vectors which
</span><span class="comment">*</span><span class="comment"> will be used by <a name="DLASD3.98"></a><a href="dlasd3.f.html#DLASD3.1">DLASD3</a> in a matrix multiply (DGEMM) to solve
</span><span class="comment">*</span><span class="comment"> for the new left singular vectors. U2 is arranged into four
</span><span class="comment">*</span><span class="comment"> blocks. The first block contains a column with 1 at NL+1 and
</span><span class="comment">*</span><span class="comment"> zero everywhere else; the second block contains non-zero
</span><span class="comment">*</span><span class="comment"> entries only at and above NL; the third contains non-zero
</span><span class="comment">*</span><span class="comment"> entries only below NL+1; and the fourth is dense.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDU2 (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array U2. LDU2 >= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VT2 (output) DOUBLE PRECISION array, dimension(LDVT2,N)
</span><span class="comment">*</span><span class="comment"> VT2' contains a copy of the first K right singular vectors
</span><span class="comment">*</span><span class="comment"> which will be used by <a name="DLASD3.110"></a><a href="dlasd3.f.html#DLASD3.1">DLASD3</a> in a matrix multiply (DGEMM) to
</span><span class="comment">*</span><span class="comment"> solve for the new right singular vectors. VT2 is arranged into
</span><span class="comment">*</span><span class="comment"> three blocks. The first block contains a row that corresponds
</span><span class="comment">*</span><span class="comment"> to the special 0 diagonal element in SIGMA; the second block
</span><span class="comment">*</span><span class="comment"> contains non-zeros only at and before NL +1; the third block
</span><span class="comment">*</span><span class="comment"> contains non-zeros only at and after NL +2.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDVT2 (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array VT2. LDVT2 >= M.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IDXP (workspace) INTEGER array dimension(N)
</span><span class="comment">*</span><span class="comment"> This will contain the permutation used to place deflated
</span><span class="comment">*</span><span class="comment"> values of D at the end of the array. On output IDXP(2:K)
</span><span class="comment">*</span><span class="comment"> points to the nondeflated D-values and IDXP(K+1:N)
</span><span class="comment">*</span><span class="comment"> points to the deflated singular values.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IDX (workspace) INTEGER array dimension(N)
</span><span class="comment">*</span><span class="comment"> This will contain the permutation used to sort the contents of
</span><span class="comment">*</span><span class="comment"> D into ascending order.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IDXC (output) INTEGER array dimension(N)
</span><span class="comment">*</span><span class="comment"> This will contain the permutation used to arrange the columns
</span><span class="comment">*</span><span class="comment"> of the deflated U matrix into three groups: the first group
</span><span class="comment">*</span><span class="comment"> contains non-zero entries only at and above NL, the second
</span><span class="comment">*</span><span class="comment"> contains non-zero entries only below NL+2, and the third is
</span><span class="comment">*</span><span class="comment"> dense.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IDXQ (input/output) INTEGER array dimension(N)
</span><span class="comment">*</span><span class="comment"> This contains the permutation which separately sorts the two
</span><span class="comment">*</span><span class="comment"> sub-problems in D into ascending order. Note that entries in
</span><span class="comment">*</span><span class="comment"> the first hlaf of this permutation must first be moved one
</span><span class="comment">*</span><span class="comment"> position backward; and entries in the second half
</span><span class="comment">*</span><span class="comment"> must first have NL+1 added to their values.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> COLTYP (workspace/output) INTEGER array dimension(N)
</span><span class="comment">*</span><span class="comment"> As workspace, this will contain a label which will indicate
</span><span class="comment">*</span><span class="comment"> which of the following types a column in the U2 matrix or a
</span><span class="comment">*</span><span class="comment"> row in the VT2 matrix is:
</span><span class="comment">*</span><span class="comment"> 1 : non-zero in the upper half only
</span><span class="comment">*</span><span class="comment"> 2 : non-zero in the lower half only
</span><span class="comment">*</span><span class="comment"> 3 : dense
</span><span class="comment">*</span><span class="comment"> 4 : deflated
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> On exit, it is an array of dimension 4, with COLTYP(I) being
</span><span class="comment">*</span><span class="comment"> the dimension of the I-th type columns.
</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"> < 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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?