slasda.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 414 行 · 第 1/2 页
HTML
414 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slasda.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="SLASDA.1"></a><a href="slasda.f.html#SLASDA.1">SLASDA</a>( ICOMPQ, SMLSIZ, N, SQRE, D, E, U, LDU, VT, K,
$ DIFL, DIFR, Z, POLES, GIVPTR, GIVCOL, LDGCOL,
$ PERM, GIVNUM, 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 ICOMPQ, INFO, LDGCOL, LDU, N, SMLSIZ, SQRE
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> INTEGER GIVCOL( LDGCOL, * ), GIVPTR( * ), IWORK( * ),
$ K( * ), PERM( LDGCOL, * )
REAL C( * ), D( * ), DIFL( LDU, * ), DIFR( LDU, * ),
$ E( * ), GIVNUM( LDU, * ), POLES( LDU, * ),
$ S( * ), U( LDU, * ), VT( LDU, * ), WORK( * ),
$ Z( LDU, * )
<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"> Using a divide and conquer approach, <a name="SLASDA.24"></a><a href="slasda.f.html#SLASDA.1">SLASDA</a> computes the singular
</span><span class="comment">*</span><span class="comment"> value decomposition (SVD) of a real upper bidiagonal N-by-M matrix
</span><span class="comment">*</span><span class="comment"> B with diagonal D and offdiagonal E, where M = N + SQRE. The
</span><span class="comment">*</span><span class="comment"> algorithm computes the singular values in the SVD B = U * S * VT.
</span><span class="comment">*</span><span class="comment"> The orthogonal matrices U and VT are optionally computed in
</span><span class="comment">*</span><span class="comment"> compact form.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> A related subroutine, <a name="SLASD0.31"></a><a href="slasd0.f.html#SLASD0.1">SLASD0</a>, computes the singular values and
</span><span class="comment">*</span><span class="comment"> the singular vectors in explicit form.
</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
</span><span class="comment">*</span><span class="comment"> in compact form, as follows
</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 of upper bidiagonal
</span><span class="comment">*</span><span class="comment"> matrix in compact form.
</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 row dimension of the upper bidiagonal matrix. This is
</span><span class="comment">*</span><span class="comment"> also the dimension of the main diagonal array D.
</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"> Specifies the column dimension of the bidiagonal matrix.
</span><span class="comment">*</span><span class="comment"> = 0: The bidiagonal matrix has column dimension M = N;
</span><span class="comment">*</span><span class="comment"> = 1: The bidiagonal matrix has column dimension M = N + 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 D, if INFO = 0, contains its singular values.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> E (input) REAL array, dimension ( M-1 )
</span><span class="comment">*</span><span class="comment"> Contains the subdiagonal 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"> U (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDU, SMLSIZ ) if ICOMPQ = 1, and not referenced
</span><span class="comment">*</span><span class="comment"> if ICOMPQ = 0. If ICOMPQ = 1, on exit, U contains the left
</span><span class="comment">*</span><span class="comment"> singular vector matrices of all subproblems at the bottom
</span><span class="comment">*</span><span class="comment"> level.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDU (input) INTEGER, LDU = > N.
</span><span class="comment">*</span><span class="comment"> The leading dimension of arrays U, VT, DIFL, DIFR, POLES,
</span><span class="comment">*</span><span class="comment"> GIVNUM, and Z.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VT (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDU, SMLSIZ+1 ) if ICOMPQ = 1, and not referenced
</span><span class="comment">*</span><span class="comment"> if ICOMPQ = 0. If ICOMPQ = 1, on exit, VT' contains the right
</span><span class="comment">*</span><span class="comment"> singular vector matrices of all subproblems at the bottom
</span><span class="comment">*</span><span class="comment"> level.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> K (output) INTEGER array, dimension ( N )
</span><span class="comment">*</span><span class="comment"> if ICOMPQ = 1 and dimension 1 if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment"> If ICOMPQ = 1, on exit, K(I) is the dimension of the I-th
</span><span class="comment">*</span><span class="comment"> secular equation on the computation tree.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIFL (output) REAL array, dimension ( LDU, NLVL ),
</span><span class="comment">*</span><span class="comment"> where NLVL = floor(log_2 (N/SMLSIZ))).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIFR (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1 and
</span><span class="comment">*</span><span class="comment"> dimension ( N ) if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment"> If ICOMPQ = 1, on exit, DIFL(1:N, I) and DIFR(1:N, 2 * I - 1)
</span><span class="comment">*</span><span class="comment"> record distances between singular values on the I-th
</span><span class="comment">*</span><span class="comment"> level and singular values on the (I -1)-th level, and
</span><span class="comment">*</span><span class="comment"> DIFR(1:N, 2 * I ) contains the normalizing factors for
</span><span class="comment">*</span><span class="comment"> the right singular vector matrix. See <a name="SLASD8.96"></a><a href="slasd8.f.html#SLASD8.1">SLASD8</a> for details.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Z (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDU, NLVL ) if ICOMPQ = 1 and
</span><span class="comment">*</span><span class="comment"> dimension ( N ) if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment"> The first K elements of Z(1, I) contain the components of
</span><span class="comment">*</span><span class="comment"> the deflation-adjusted updating row vector for subproblems
</span><span class="comment">*</span><span class="comment"> on the I-th level.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> POLES (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not referenced
</span><span class="comment">*</span><span class="comment"> if ICOMPQ = 0. If ICOMPQ = 1, on exit, POLES(1, 2*I - 1) and
</span><span class="comment">*</span><span class="comment"> POLES(1, 2*I) contain the new and old singular values
</span><span class="comment">*</span><span class="comment"> involved in the secular equations on the I-th level.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GIVPTR (output) INTEGER array,
</span><span class="comment">*</span><span class="comment"> dimension ( N ) if ICOMPQ = 1, and not referenced if
</span><span class="comment">*</span><span class="comment"> ICOMPQ = 0. If ICOMPQ = 1, on exit, GIVPTR( I ) records
</span><span class="comment">*</span><span class="comment"> the number of Givens rotations performed on the I-th
</span><span class="comment">*</span><span class="comment"> problem on the computation tree.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GIVCOL (output) INTEGER array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDGCOL, 2 * NLVL ) if ICOMPQ = 1, and not
</span><span class="comment">*</span><span class="comment"> referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I,
</span><span class="comment">*</span><span class="comment"> GIVCOL(1, 2 *I - 1) and GIVCOL(1, 2 *I) record the locations
</span><span class="comment">*</span><span class="comment"> of Givens rotations performed on the I-th level on 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"> LDGCOL (input) INTEGER, LDGCOL = > N.
</span><span class="comment">*</span><span class="comment"> The leading dimension of arrays GIVCOL and PERM.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> PERM (output) INTEGER array, dimension ( LDGCOL, NLVL )
</span><span class="comment">*</span><span class="comment"> if ICOMPQ = 1, and not referenced
</span><span class="comment">*</span><span class="comment"> if ICOMPQ = 0. If ICOMPQ = 1, on exit, PERM(1, I) records
</span><span class="comment">*</span><span class="comment"> permutations done on the I-th level of the computation tree.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GIVNUM (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( LDU, 2 * NLVL ) if ICOMPQ = 1, and not
</span><span class="comment">*</span><span class="comment"> referenced if ICOMPQ = 0. If ICOMPQ = 1, on exit, for each I,
</span><span class="comment">*</span><span class="comment"> GIVNUM(1, 2 *I - 1) and GIVNUM(1, 2 *I) record the C- and S-
</span><span class="comment">*</span><span class="comment"> values of Givens rotations performed on the I-th level on
</span><span class="comment">*</span><span class="comment"> the computation tree.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> C (output) REAL array,
</span><span class="comment">*</span><span class="comment"> dimension ( N ) if ICOMPQ = 1, and dimension 1 if ICOMPQ = 0.
</span><span class="comment">*</span><span class="comment"> If ICOMPQ = 1 and the I-th subproblem is not square, on exit,
</span><span class="comment">*</span><span class="comment"> C( I ) contains the C-value of a Givens rotation related to
</span><span class="comment">*</span><span class="comment"> the right null space of the I-th subproblem.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> S (output) REAL array, dimension ( N ) if
</span><span class="comment">*</span><span class="comment"> ICOMPQ = 1, and dimension 1 if ICOMPQ = 0. If ICOMPQ = 1
</span><span class="comment">*</span><span class="comment"> and the I-th subproblem is not square, on exit, S( I )
</span><span class="comment">*</span><span class="comment"> contains the S-value of a Givens rotation related to
</span><span class="comment">*</span><span class="comment"> the right null space of the I-th subproblem.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) REAL array, dimension
</span><span class="comment">*</span><span class="comment"> (6 * N + (SMLSIZ + 1)*(SMLSIZ + 1)).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IWORK (workspace) INTEGER array, dimension (7*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"> < 0: if INFO = -i, the i-th argument had an illegal value.
</span><span class="comment">*</span><span class="comment"> > 0: if INFO = 1, an singular value did not converge
</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 Huan Ren, 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">
</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
PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> INTEGER I, I1, IC, IDXQ, IDXQI, IM1, INODE, ITEMP, IWK,
$ J, LF, LL, LVL, LVL2, M, NCC, ND, NDB1, NDIML,
$ NDIMR, NL, NLF, NLP1, NLVL, NR, NRF, NRP1, NRU,
$ NWORK1, NWORK2, SMLSZP, SQREI, VF, VFI, VL, VLI
REAL ALPHA, BETA
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL SCOPY, <a name="SLASD6.182"></a><a href="slasd6.f.html#SLASD6.1">SLASD6</a>, <a name="SLASDQ.182"></a><a href="slasdq.f.html#SLASDQ.1">SLASDQ</a>, <a name="SLASDT.182"></a><a href="slasdt.f.html#SLASDT.1">SLASDT</a>, <a name="SLASET.182"></a><a href="slaset.f.html#SLASET.1">SLASET</a>, <a name="XERBLA.182"></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"> .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Test the input parameters.
</span><span class="comment">*</span><span class="comment">
</span> INFO = 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?