sbdsdc.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 453 行 · 第 1/3 页
HTML
453 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>sbdsdc.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="SBDSDC.1"></a><a href="sbdsdc.f.html#SBDSDC.1">SBDSDC</a>( UPLO, COMPQ, N, D, E, U, LDU, VT, LDVT, Q, IQ,
$ WORK, IWORK, 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> CHARACTER COMPQ, UPLO
INTEGER INFO, LDU, LDVT, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> INTEGER IQ( * ), IWORK( * )
REAL D( * ), E( * ), Q( * ), 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="SBDSDC.21"></a><a href="sbdsdc.f.html#SBDSDC.1">SBDSDC</a> computes the singular value decomposition (SVD) of a real
</span><span class="comment">*</span><span class="comment"> N-by-N (upper or lower) bidiagonal matrix B: B = U * S * VT,
</span><span class="comment">*</span><span class="comment"> using a divide and conquer method, where S is a diagonal matrix
</span><span class="comment">*</span><span class="comment"> with non-negative diagonal elements (the singular values of B), and
</span><span class="comment">*</span><span class="comment"> U and VT are orthogonal matrices of left and right singular vectors,
</span><span class="comment">*</span><span class="comment"> respectively. <a name="SBDSDC.26"></a><a href="sbdsdc.f.html#SBDSDC.1">SBDSDC</a> can be used to compute all singular values,
</span><span class="comment">*</span><span class="comment"> and optionally, singular vectors or singular vectors in compact form.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> This code makes very mild assumptions about floating point
</span><span class="comment">*</span><span class="comment"> arithmetic. It will work on machines with a guard digit in
</span><span class="comment">*</span><span class="comment"> add/subtract, or on those binary machines without guard digits
</span><span class="comment">*</span><span class="comment"> which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2.
</span><span class="comment">*</span><span class="comment"> It could conceivably fail on hexadecimal or decimal machines
</span><span class="comment">*</span><span class="comment"> without guard digits, but we know of none. See <a name="SLASD3.34"></a><a href="slasd3.f.html#SLASD3.1">SLASD3</a> for details.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> The code currently calls <a name="SLASDQ.36"></a><a href="slasdq.f.html#SLASDQ.1">SLASDQ</a> if singular values only are desired.
</span><span class="comment">*</span><span class="comment"> However, it can be slightly modified to compute singular values
</span><span class="comment">*</span><span class="comment"> using the divide and conquer method.
</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"> UPLO (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'U': B is upper bidiagonal.
</span><span class="comment">*</span><span class="comment"> = 'L': B is lower bidiagonal.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> COMPQ (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Specifies whether singular vectors are to be computed
</span><span class="comment">*</span><span class="comment"> as follows:
</span><span class="comment">*</span><span class="comment"> = 'N': Compute singular values only;
</span><span class="comment">*</span><span class="comment"> = 'P': Compute singular values and compute singular
</span><span class="comment">*</span><span class="comment"> vectors in compact form;
</span><span class="comment">*</span><span class="comment"> = 'I': Compute singular values and singular vectors.
</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 order of the matrix B. N >= 0.
</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, the n diagonal elements of the bidiagonal matrix B.
</span><span class="comment">*</span><span class="comment"> On exit, if INFO=0, the singular values of B.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> E (input/output) REAL array, dimension (N-1)
</span><span class="comment">*</span><span class="comment"> On entry, the elements of E contain the offdiagonal
</span><span class="comment">*</span><span class="comment"> elements of the bidiagonal matrix whose SVD is desired.
</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, dimension (LDU,N)
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'I', then:
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, U contains the left singular vectors
</span><span class="comment">*</span><span class="comment"> of the bidiagonal matrix.
</span><span class="comment">*</span><span class="comment"> For other values of COMPQ, U is not referenced.
</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 >= 1.
</span><span class="comment">*</span><span class="comment"> If singular vectors are desired, then LDU >= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VT (output) REAL array, dimension (LDVT,N)
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'I', then:
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, VT' contains the right singular
</span><span class="comment">*</span><span class="comment"> vectors of the bidiagonal matrix.
</span><span class="comment">*</span><span class="comment"> For other values of COMPQ, VT is not referenced.
</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 >= 1.
</span><span class="comment">*</span><span class="comment"> If singular vectors are desired, then LDVT >= max( 1, N ).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Q (output) REAL array, dimension (LDQ)
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'P', then:
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, Q and IQ contain the left
</span><span class="comment">*</span><span class="comment"> and right singular vectors in a compact form,
</span><span class="comment">*</span><span class="comment"> requiring O(N log N) space instead of 2*N**2.
</span><span class="comment">*</span><span class="comment"> In particular, Q contains all the REAL data in
</span><span class="comment">*</span><span class="comment"> LDQ >= N*(11 + 2*SMLSIZ + 8*INT(LOG_2(N/(SMLSIZ+1))))
</span><span class="comment">*</span><span class="comment"> words of memory, where SMLSIZ is returned by <a name="ILAENV.94"></a><a href="hfy-index.html#ILAENV">ILAENV</a> and
</span><span class="comment">*</span><span class="comment"> is equal to the maximum size of the subproblems at the
</span><span class="comment">*</span><span class="comment"> bottom of the computation tree (usually about 25).
</span><span class="comment">*</span><span class="comment"> For other values of COMPQ, Q is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IQ (output) INTEGER array, dimension (LDIQ)
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'P', then:
</span><span class="comment">*</span><span class="comment"> On exit, if INFO = 0, Q and IQ contain the left
</span><span class="comment">*</span><span class="comment"> and right singular vectors in a compact form,
</span><span class="comment">*</span><span class="comment"> requiring O(N log N) space instead of 2*N**2.
</span><span class="comment">*</span><span class="comment"> In particular, IQ contains all INTEGER data in
</span><span class="comment">*</span><span class="comment"> LDIQ >= N*(3 + 3*INT(LOG_2(N/(SMLSIZ+1))))
</span><span class="comment">*</span><span class="comment"> words of memory, where SMLSIZ is returned by <a name="ILAENV.106"></a><a href="hfy-index.html#ILAENV">ILAENV</a> and
</span><span class="comment">*</span><span class="comment"> is equal to the maximum size of the subproblems at the
</span><span class="comment">*</span><span class="comment"> bottom of the computation tree (usually about 25).
</span><span class="comment">*</span><span class="comment"> For other values of COMPQ, IQ is not referenced.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) REAL array, dimension (MAX(1,LWORK))
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'N' then LWORK >= (4 * N).
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'P' then LWORK >= (6 * N).
</span><span class="comment">*</span><span class="comment"> If COMPQ = 'I' then LWORK >= (3 * N**2 + 4 * N).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IWORK (workspace) INTEGER array, dimension (8*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: The algorithm failed to compute an singular value.
</span><span class="comment">*</span><span class="comment"> The update process of divide and conquer failed.
</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"> Changed dimension statement in comment describing E from (N) to
</span><span class="comment">*</span><span class="comment"> (N-1). Sven, 17 Feb 05.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?