slarrd.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 738 行 · 第 1/4 页
HTML
738 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>slarrd.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="SLARRD.1"></a><a href="slarrd.f.html#SLARRD.1">SLARRD</a>( RANGE, ORDER, N, VL, VU, IL, IU, GERS,
$ RELTOL, D, E, E2, PIVMIN, NSPLIT, ISPLIT,
$ M, W, WERR, WL, WU, IBLOCK, INDEXW,
$ 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> CHARACTER ORDER, RANGE
INTEGER IL, INFO, IU, M, N, NSPLIT
REAL PIVMIN, RELTOL, VL, VU, WL, WU
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> INTEGER IBLOCK( * ), INDEXW( * ),
$ ISPLIT( * ), IWORK( * )
REAL D( * ), E( * ), E2( * ),
$ GERS( * ), W( * ), WERR( * ), 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="SLARRD.25"></a><a href="slarrd.f.html#SLARRD.1">SLARRD</a> computes the eigenvalues of a symmetric tridiagonal
</span><span class="comment">*</span><span class="comment"> matrix T to suitable accuracy. This is an auxiliary code to be
</span><span class="comment">*</span><span class="comment"> called from <a name="SSTEMR.27"></a><a href="sstemr.f.html#SSTEMR.1">SSTEMR</a>.
</span><span class="comment">*</span><span class="comment"> The user may ask for all eigenvalues, all eigenvalues
</span><span class="comment">*</span><span class="comment"> in the half-open interval (VL, VU], or the IL-th through IU-th
</span><span class="comment">*</span><span class="comment"> eigenvalues.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> To avoid overflow, the matrix must be scaled so that its
</span><span class="comment">*</span><span class="comment"> largest element is no greater than overflow**(1/2) *
</span><span class="comment">*</span><span class="comment"> underflow**(1/4) in absolute value, and for greatest
</span><span class="comment">*</span><span class="comment"> accuracy, it should not be much smaller than that.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> See W. Kahan "Accurate Eigenvalues of a Symmetric Tridiagonal
</span><span class="comment">*</span><span class="comment"> Matrix", Report CS41, Computer Science Dept., Stanford
</span><span class="comment">*</span><span class="comment"> University, July 21, 1966.
</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"> RANGE (input) CHARACTER
</span><span class="comment">*</span><span class="comment"> = 'A': ("All") all eigenvalues will be found.
</span><span class="comment">*</span><span class="comment"> = 'V': ("Value") all eigenvalues in the half-open interval
</span><span class="comment">*</span><span class="comment"> (VL, VU] will be found.
</span><span class="comment">*</span><span class="comment"> = 'I': ("Index") the IL-th through IU-th eigenvalues (of the
</span><span class="comment">*</span><span class="comment"> entire matrix) will be found.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ORDER (input) CHARACTER
</span><span class="comment">*</span><span class="comment"> = 'B': ("By Block") the eigenvalues will be grouped by
</span><span class="comment">*</span><span class="comment"> split-off block (see IBLOCK, ISPLIT) and
</span><span class="comment">*</span><span class="comment"> ordered from smallest to largest within
</span><span class="comment">*</span><span class="comment"> the block.
</span><span class="comment">*</span><span class="comment"> = 'E': ("Entire matrix")
</span><span class="comment">*</span><span class="comment"> the eigenvalues for the entire matrix
</span><span class="comment">*</span><span class="comment"> will be ordered from smallest to
</span><span class="comment">*</span><span class="comment"> largest.
</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 tridiagonal matrix T. N >= 0.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> VL (input) REAL
</span><span class="comment">*</span><span class="comment"> VU (input) REAL
</span><span class="comment">*</span><span class="comment"> If RANGE='V', the lower and upper bounds of the interval to
</span><span class="comment">*</span><span class="comment"> be searched for eigenvalues. Eigenvalues less than or equal
</span><span class="comment">*</span><span class="comment"> to VL, or greater than VU, will not be returned. VL < VU.
</span><span class="comment">*</span><span class="comment"> Not referenced if RANGE = 'A' or 'I'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IL (input) INTEGER
</span><span class="comment">*</span><span class="comment"> IU (input) INTEGER
</span><span class="comment">*</span><span class="comment"> If RANGE='I', the indices (in ascending order) of the
</span><span class="comment">*</span><span class="comment"> smallest and largest eigenvalues to be returned.
</span><span class="comment">*</span><span class="comment"> 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0.
</span><span class="comment">*</span><span class="comment"> Not referenced if RANGE = 'A' or 'V'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> GERS (input) REAL array, dimension (2*N)
</span><span class="comment">*</span><span class="comment"> The N Gerschgorin intervals (the i-th Gerschgorin interval
</span><span class="comment">*</span><span class="comment"> is (GERS(2*i-1), GERS(2*i)).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> RELTOL (input) REAL
</span><span class="comment">*</span><span class="comment"> The minimum relative width of an interval. When an interval
</span><span class="comment">*</span><span class="comment"> is narrower than RELTOL times the larger (in
</span><span class="comment">*</span><span class="comment"> magnitude) endpoint, then it is considered to be
</span><span class="comment">*</span><span class="comment"> sufficiently small, i.e., converged. Note: this should
</span><span class="comment">*</span><span class="comment"> always be at least radix*machine epsilon.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> D (input) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The n diagonal elements of the tridiagonal matrix T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> E (input) REAL array, dimension (N-1)
</span><span class="comment">*</span><span class="comment"> The (n-1) off-diagonal elements of the tridiagonal matrix T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> E2 (input) REAL array, dimension (N-1)
</span><span class="comment">*</span><span class="comment"> The (n-1) squared off-diagonal elements of the tridiagonal matrix T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> PIVMIN (input) REAL
</span><span class="comment">*</span><span class="comment"> The minimum pivot allowed in the Sturm sequence for T.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> NSPLIT (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of diagonal blocks in the matrix T.
</span><span class="comment">*</span><span class="comment"> 1 <= NSPLIT <= N.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> ISPLIT (input) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The splitting points, at which T breaks up into submatrices.
</span><span class="comment">*</span><span class="comment"> The first submatrix consists of rows/columns 1 to ISPLIT(1),
</span><span class="comment">*</span><span class="comment"> the second of rows/columns ISPLIT(1)+1 through ISPLIT(2),
</span><span class="comment">*</span><span class="comment"> etc., and the NSPLIT-th consists of rows/columns
</span><span class="comment">*</span><span class="comment"> ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N.
</span><span class="comment">*</span><span class="comment"> (Only the first NSPLIT elements will actually be used, but
</span><span class="comment">*</span><span class="comment"> since the user cannot know a priori what value NSPLIT will
</span><span class="comment">*</span><span class="comment"> have, N words must be reserved for ISPLIT.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> M (output) INTEGER
</span><span class="comment">*</span><span class="comment"> The actual number of eigenvalues found. 0 <= M <= N.
</span><span class="comment">*</span><span class="comment"> (See also the description of INFO=2,3.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> On exit, the first M elements of W will contain the
</span><span class="comment">*</span><span class="comment"> eigenvalue approximations. <a name="SLARRD.121"></a><a href="slarrd.f.html#SLARRD.1">SLARRD</a> computes an interval
</span><span class="comment">*</span><span class="comment"> I_j = (a_j, b_j] that includes eigenvalue j. The eigenvalue
</span><span class="comment">*</span><span class="comment"> approximation is given as the interval midpoint
</span><span class="comment">*</span><span class="comment"> W(j)= ( a_j + b_j)/2. The corresponding error is bounded by
</span><span class="comment">*</span><span class="comment"> WERR(j) = abs( a_j - b_j)/2
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WERR (output) REAL array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The error bound on the corresponding eigenvalue approximation
</span><span class="comment">*</span><span class="comment"> in W.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WL (output) REAL
</span><span class="comment">*</span><span class="comment"> WU (output) REAL
</span><span class="comment">*</span><span class="comment"> The interval (WL, WU] contains all the wanted eigenvalues.
</span><span class="comment">*</span><span class="comment"> If RANGE='V', then WL=VL and WU=VU.
</span><span class="comment">*</span><span class="comment"> If RANGE='A', then WL and WU are the global Gerschgorin bounds
</span><span class="comment">*</span><span class="comment"> on the spectrum.
</span><span class="comment">*</span><span class="comment"> If RANGE='I', then WL and WU are computed by <a name="SLAEBZ.137"></a><a href="slaebz.f.html#SLAEBZ.1">SLAEBZ</a> from the
</span><span class="comment">*</span><span class="comment"> index range specified.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IBLOCK (output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment"> At each row/column j where E(j) is zero or small, the
</span><span class="comment">*</span><span class="comment"> matrix T is considered to split into a block diagonal
</span><span class="comment">*</span><span class="comment"> matrix. On exit, if INFO = 0, IBLOCK(i) specifies to which
</span><span class="comment">*</span><span class="comment"> block (from 1 to the number of blocks) the eigenvalue W(i)
</span><span class="comment">*</span><span class="comment"> belongs. (<a name="SLARRD.145"></a><a href="slarrd.f.html#SLARRD.1">SLARRD</a> may use the remaining N-M elements as
</span><span class="comment">*</span><span class="comment"> workspace.)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> INDEXW (output) INTEGER array, dimension (N)
</span><span class="comment">*</span><span class="comment"> The indices of the eigenvalues within each block (submatrix);
</span><span class="comment">*</span><span class="comment"> for example, INDEXW(i)= j and IBLOCK(i)=k imply that the
</span><span class="comment">*</span><span class="comment"> i-th eigenvalue W(i) is the j-th eigenvalue in block k.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) REAL array, dimension (4*N)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> IWORK (workspace) INTEGER array, dimension (3*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: some or all of the eigenvalues failed to converge or
</span><span class="comment">*</span><span class="comment"> were not computed:
</span><span class="comment">*</span><span class="comment"> =1 or 3: Bisection failed to converge for some
</span><span class="comment">*</span><span class="comment"> eigenvalues; these eigenvalues are flagged by a
</span><span class="comment">*</span><span class="comment"> negative block number. The effect is that the
</span><span class="comment">*</span><span class="comment"> eigenvalues may not be as accurate as the
</span><span class="comment">*</span><span class="comment"> absolute and relative tolerances. This is
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?