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 through IU-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': () the IL-th through IU-th eigenvalues (of the entire matrix) will be found.

πŸ”Ή ORDER β€” CHARACTER*1

  • = 'B': () the eigenvalues will be grouped by split-off block (see IBLOCK, 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 1 to ISPLIT(1),
  • the second of rows/columns ISPLIT(1)+1 through ISPLIT(2),
  • etc., and
  • the NSPLIT-th consists of rows/columns ISPLIT(NSPLIT-1)+1 through ISPLIT(NSPLIT)=N.
fr fr though: only the first NSPLIT elements will actually be used, but since the user cannot know a priori what value NSPLIT will have, N words must be reserved for ISPLIT. 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', then WL=VL and WU=VU.
  • If RANGE='A', then WL and WU are the global Gerschgorin bounds on the spectrum.
  • If RANGE='I', then WL and WU are computed by SLAEBZ from 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: if INFO = -i, the i-th argument had an illegal value
  • > 0: some or all of the eigenvalues failed to converge or were not computed:
    • =1 or 3: 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.
    • =2 or 3: RANGE='I' only β€” not all of the eigenvalues IL:IU were 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 eigenvalues IL:IU. In some cases, increasing the PARAMETER may make things work.
    • = 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