SRC/slarrd.f(3)
okay bestie, this page is SRC/slarrd.f(3), straight outta the Library Functions Manual.
πΈ NAME πΈ
SRC/slarrd.f β that's the name, that's the file, periodt. π
β¨ SYNOPSIS β¨
π Functions/Subroutines π
Here's the subroutine, exactly as it shows up β no cap, every argument stays:
subroutine slarrd (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)
SLARRD computes the eigenvalues of a symmetric tridiagonal matrix to suitable accuracy. That's the vibe: symmetric tridiagonal matrix, eigenvalues, suitable accuracy. π¦
π FUNCTION/SUBROUTINE DOCUMENTATION
okay bestie, so here's the actual subroutine, the whole thing, in all its glory:
subroutine slarrd (character range, character order, integer n, real vl,
real vu, integer il, integer iu, real, dimension( * ) gers, real reltol,
real, dimension( * ) d, real, dimension( * ) e, real, dimension( * ) e2,
real pivmin, integer nsplit, integer, dimension( * ) isplit, integer m,
real, dimension( * ) w, real, dimension( * ) werr, real wl, real wu,
integer, dimension( * ) iblock, integer, dimension( * ) indexw, real,
dimension( * ) work, integer, dimension( * ) iwork, integer info)
SLARRD computes the eigenvalues of a symmetric tridiagonal matrix to suitable accuracy. β¨
π« Purpose
okay so picture this: SLARRD computes the eigenvalues of a symmetric tridiagonal matrix T to suitable accuracy. That's the whole gig. It's an auxiliary code, which is fancy speak for "it's a helper β it gets called from SSTEMR", not by you directly (no cap).
And the user (that's whoever's driving) may ask for:
- all eigenvalues,
- all eigenvalues in the half-open interval
(VL, VU], or - the
IL-th throughIU-th eigenvalues.
π¨ overflow warning, listen up: to avoid overflow, the matrix must be scaled so that its largest element is no greater than overflow**(1/2) * underflow**(1/4) in absolute value. And for greatest accuracy it should not be much smaller than that. Like, don't just yeet it into the void, scale it properly bestie.
π see also: W. Kahan, Report CS41, Computer Science Dept., Stanford University, July 21, 1966. (yes, the real one, iconic.)
πΈ Parameters
πΉ RANGE β CHARACTER*1
= 'A':()all eigenvalues will be found.= 'V':()all eigenvalues in the half-open interval(VL, VU]will be found.= 'I':()theIL-th throughIU-th eigenvalues (of the entire matrix) will be found.
πΉ ORDER β CHARACTER*1
= 'B':()the eigenvalues will be grouped by split-off block (seeIBLOCK,ISPLIT) and ordered from smallest to largest within the block.= 'E':()the eigenvalues for the entire matrix will be ordered from smallest to largest.
πΉ N β INTEGER
The order of the tridiagonal matrix T. N >= 0.
πΉ VL β REAL
If RANGE='V', this is the lower bound of the interval to be searched for eigenvalues. Eigenvalues less than or equal to VL, or greater than VU, will not be returned. VL < VU. Not referenced if RANGE = 'A' or 'I'.
πΉ VU β REAL
If RANGE='V', this is the upper bound of the interval to be searched for eigenvalues. Eigenvalues less than or equal to VL, or greater than VU, will not be returned. VL < VU. Not referenced if RANGE = 'A' or 'I'.
πΉ IL β INTEGER
If RANGE='I', the index of the smallest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
πΉ IU β INTEGER
If RANGE='I', the index of the largest eigenvalue to be returned. 1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0. Not referenced if RANGE = 'A' or 'V'.
πΉ GERS β REAL array, dimension (2*N)
The N Gerschgorin intervals β the i-th Gerschgorin interval is (GERS(2*i-1), GERS(2*i)). π¦
πΉ RELTOL β REAL
The minimum relative width of an interval. When an interval is narrower than RELTOL times the larger (in magnitude) endpoint, then it's considered sufficiently small, i.e., converged π. Heads up: this should always be at least radix*machine epsilon.
πΉ D β REAL array, dimension (N)
The n diagonal elements of the tridiagonal matrix T.
πΉ E β REAL array, dimension (N-1)
The (n-1) off-diagonal elements of the tridiagonal matrix T.
πΉ E2 β REAL array, dimension (N-1)
The (n-1) squared off-diagonal elements of the tridiagonal matrix T.
πΉ PIVMIN β REAL
The minimum pivot allowed in the Sturm sequence for T.
πΉ NSPLIT β INTEGER
The number of diagonal blocks in the matrix T. 1 <= NSPLIT <= N.
πΉ ISPLIT β INTEGER array, dimension (N)
The splitting points, at which T breaks up into submatrices. Like:
- the first submatrix consists of rows/columns
1toISPLIT(1), - the second of rows/columns
ISPLIT(1)+1throughISPLIT(2), - etc., and
- the
NSPLIT-th consists of rows/columnsISPLIT(NSPLIT-1)+1throughISPLIT(NSPLIT)=N.
fr fr though: only the firstNSPLITelements will actually be used, but since the user cannot know a priori what valueNSPLITwill have,Nwords must be reserved forISPLIT. reserve the space, bestie π
πΉ M β INTEGER
The actual number of eigenvalues found. 0 <= M <= N. (See also the description of INFO=2,3.)
πΉ W β REAL array, dimension (N)
On exit, the first M elements of W will contain the eigenvalue approximations. SLARRD computes an interval I_j = (a_j, b_j] that includes eigenvalue j. The eigenvalue approximation is given as the interval midpoint W(j)= ( a_j + b_j)/2. The corresponding error is bounded by WERR(j) = abs( a_j - b_j)/2. math slay β¨
πΉ WERR β REAL array, dimension (N)
The error bound on the corresponding eigenvalue approximation in W.
πΉ WL β REAL
(yes. that's it. that's the whole entry. π)
πΉ WU β REAL
The interval (WL, WU] contains all the wanted eigenvalues.
- If
RANGE='V', thenWL=VLandWU=VU. - If
RANGE='A', thenWLandWUare the global Gerschgorin bounds on the spectrum. - If
RANGE='I', thenWLandWUare computed bySLAEBZfrom the index range specified.
πΉ IBLOCK β INTEGER array, dimension (N)
At each row/column j where E(j) is zero or small, the matrix T is considered to split into a block diagonal matrix. On exit, if INFO = 0, IBLOCK(i) specifies to which block (from 1 to the number of blocks) the eigenvalue W(i) belongs. (SLARRD may use the remaining N-M elements as workspace. sneaky but valid π)
πΉ INDEXW β INTEGER array, dimension (N)
The indices of the eigenvalues within each block (submatrix). For example, INDEXW(i)= j and IBLOCK(i)=k imply that the i-th eigenvalue W(i) is the j-th eigenvalue in block k. iykyk π§
πΉ WORK β REAL array, dimension (4*N)
(scratch space, no thoughts, just vibes)
πΉ IWORK β INTEGER array, dimension (3*N)
(scratch space but integer edition)
πΉ INFO β INTEGER
= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value> 0: some or all of the eigenvalues failed to converge or were not computed:=1or3: Bisection failed to converge for some eigenvalues; these eigenvalues are flagged by a negative block number. The effect is that the eigenvalues may not be as accurate as the absolute and relative tolerances. This is generally caused by unexpectedly inaccurate arithmetic.=2or3:RANGE='I'only β not all of the eigenvaluesIL:IUwere found.- Effect:
M < IU+1-IL - Cause: non-monotonic arithmetic, causing the Sturm sequence to be non-monotonic.
- Cure: recalculate, using
RANGE='A', and pick out eigenvaluesIL:IU. In some cases, increasing thePARAMETERmay make things work.
- Effect:
= 4:RANGE='I', and the Gershgorin interval initially used was too small. No eigenvalues were computed.- Probable cause: your machine has sloppy floating-point arithmetic.
- Cure: Increase the
PARAMETER, recompile, and try again.
π§ Internal Parameters
βοΈ FUDGE
REAL, default = 2.
A fudge factor to widen the Gerschgorin intervals. Ideally a value of 1 should work, but on machines with sloppy arithmetic, this needs to be larger. The default for publicly released versions should be large enough to handle the worst machine around. Note that this has no effect on accuracy of the solution β it's just vibes insurance. π
π Contributors
absolute legends, all of them:
- W. Kahan, University of California, Berkeley, USA
- Beresford Parlett, University of California, Berkeley, USA
- Jim Demmel, University of California, Berkeley, USA
- Inderjit Dhillon, University of Texas, Austin, USA
- Osni Marques, LBNL/NERSC, USA
- Christof Voemel, University of California, Berkeley, USA
βοΈ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 325 of file slarrd.f.
β¨ AUTHOR β¨
Okay so real talk β nobody hand-typed this thing π. It's generated automatically by Doxygen for LAPACK from the source code. So the "author" is basically a robot that read the actual slarrd.f source and spat out this whole page. No cap, that's the entire credits section. The docs wrote themselves (well, the tooling did), and honestly? Slay, automated queen. π
And that's a wrap on SRC/slarrd.f(3), bestie!! π«Ά You made it all the way through β iconic behavior, truly. This little masterpiece is your LAPACK docs, Version 3.12.0, and yes the source file is SRC/slarrd.f if you ever need to go touch grass in the actual code π±. Generated straight from the source, dated and versioned and everything, so if it looks a lil different next time you peek, that's just the robot doing its thing. Go forth and compute, main character π
β¨πΈ
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms