DSTEDC(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ’… dstedc.f(3) β€” LAPACK Library Functions Manual ✨

okay so real talk, this page lives at /home/abui...RC/dstedc.f(3) in the LAPACK Library Functions Manual, and it's literally the whole glow-up guide to one Fortran subroutine. she's giving linear algebra main character energy and honestly? obsessed. 🫢


🌸 NAME 🌸

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/dstedc.f

that's the file, bestie. that's the whole NAME section. it's giving "my full government name" energy πŸ’€


✨ SYNOPSIS ✨

🌈 Functions/Subroutines

  • subroutine DSTEDC (compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info) β€” DSTEDC. that's her. that's the girl.

πŸ¦‹ Function/Subroutine Documentation πŸ¦‹

πŸŽ€ subroutine DSTEDC (character compz, integer n, double precision, dimension( * ) d, double precision, dimension( * ) e, double precision, dimension( ldz, * ) z, integer ldz, double precision, dimension( * ) work, integer lwork, integer, dimension( * ) iwork, integer liwork, integer info)

DSTEDC πŸ’– (yes the heading repeats her name, she's that iconic)

πŸ’œ Purpose:

so what does she actually do? ok so:

DSTEDC computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the divide and conquer method. The eigenvectors of a full or band real symmetric matrix can also be found if DSYTRD or DSPTRD or DSBTRD has been used to reduce this matrix to tridiagonal form.

no cap, divide and conquer method. she's out here conquering. πŸ‘‘

πŸ“ Parameters

  • COMPZ
COMPZ is CHARACTER*1 = 'N': Compute eigenvalues only. = 'I': Compute eigenvectors of tridiagonal matrix also. = 'V': Compute eigenvectors of original dense symmetric matrix also. On entry, Z contains the orthogonal matrix used to reduce the original matrix to tridiagonal form.

three moods, one variable. pick your vibe wisely πŸ’…

  • N
N is INTEGER The dimension of the symmetric tridiagonal matrix. N >= 0.

literally the size of the situation. and yes, N >= 0 β€” zero is allowed, she's inclusive 🫢

  • D
D is DOUBLE PRECISION array, dimension (N) On entry, the diagonal elements of the tridiagonal matrix. On exit, if INFO = 0, the eigenvalues in ascending order.

comes in as the diagonal, leaves as the eigenvalues in ascending order. a true transformation arc ⭐

  • E
E is DOUBLE PRECISION array, dimension (N-1) On entry, the subdiagonal elements of the tridiagonal matrix. On exit, E has been destroyed.

⚠️ heads up bestie: E gets destroyed. she does not survive the function. gone. reduced to atoms. πŸ’€ like, that's just how it is, don't be attached.

  • Z
Z is DOUBLE PRECISION array, dimension (LDZ,N) On entry, if COMPZ = 'V', then Z contains the orthogonal matrix used in the reduction to tridiagonal form. On exit, if INFO = 0, then if COMPZ = 'V', Z contains the orthonormal eigenvectors of the original symmetric matrix, and if COMPZ = 'I', Z contains the orthonormal eigenvectors of the symmetric tridiagonal matrix. If COMPZ = 'N', then Z is not referenced.

so Z is the one who either minds her own business ('N') or shows up with eigenvectors, depending on the COMPZ situation. she's flexible, she's versatile. 🌸

  • LDZ
LDZ is INTEGER The leading dimension of the array Z. LDZ >= 1. If eigenvectors are desired, then LDZ >= max(1,N).

the leading dimension, aka how much room Z gets to breathe. LDZ >= 1 always, and if you want eigenvectors then step it up to max(1,N) πŸ“

  • WORK
WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

she works hard so the routine doesn't have to. and WORK(1) snitches on the optimal LWORK, periodt πŸ’…

  • LWORK
LWORK is INTEGER The dimension of the array WORK. If COMPZ = 'N' or N <= 1 then LWORK must be at least 1. If COMPZ = 'V' and N > 1 then LWORK must be at least ( 1 + 3*N + 2*N*lg N + 4*N2 ), where lg( N ) = smallest integer k such that 2k >= N. If COMPZ = 'I' and N > 1 then LWORK must be at least ( 1 + 4*N + N**2 ). Note that for COMPZ = 'I' or 'V', then if N is less than or equal to the minimum divide size, usually 25, then LWORK need only be max(1,2*(N-1)). If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

okay so the math is mathing and you do have to actually do it:

( 1 + 3*N + 2*N*lg N + 4*N**2 )

where lg( N ) = smallest integer k such that 2**k >= N. iykyk πŸ€“

and for COMPZ = 'I':

( 1 + 4*N + N**2 )

BUT the cute shortcut: for COMPZ = 'I' or 'V', if N is less than or equal to the minimum divide size (usually 25), then LWORK need only be max(1,2*(N-1)) β€” tiny N, tiny workspace, we love efficiency 🧚

πŸ” and the cheat code: set LWORK = -1 and it's a workspace query. she won't compute anything, she'll just calculate the optimal size of the WORK array, drop it in the first entry of WORK, and XERBLA won't say a single word about LWORK. iconic behavior, no notes.
  • IWORK
IWORK is INTEGER array, dimension (MAX(1,LIWORK)) On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.

the integer-flavored sibling of WORK, and yes she also reports the optimal LIWORK in slot one. consistency queen πŸ‘‘

  • LIWORK
LIWORK is INTEGER The dimension of the array IWORK. If COMPZ = 'N' or N <= 1 then LIWORK must be at least 1. If COMPZ = 'V' and N > 1 then LIWORK must be at least ( 6 + 6*N + 5*N*lg N ). If COMPZ = 'I' and N > 1 then LIWORK must be at least ( 3 + 5*N ). Note that for COMPZ = 'I' or 'V', then if N is less than or equal to the minimum divide size, usually 25, then LIWORK need only be 1. If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the IWORK array, returns this value as the first entry of the IWORK array, and no error message related to LIWORK is issued by XERBLA.

same deal, integer edition. the formulas:

( 6 + 6*N + 5*N*lg N )

for COMPZ = 'V' with N > 1, and:

( 3 + 5*N )

for COMPZ = 'I' with N > 1.

and again the small-N shortcut: for COMPZ = 'I' or 'V', if N is less than or equal to the minimum divide size (usually 25), then LIWORK need only be 1. one. uno. single digit. slay 🌈

πŸ” and same cheat code: LIWORK = -1 = workspace query. she calculates the optimal size of the IWORK array, returns it as the first entry of IWORK, and XERBLA stays quiet about LIWORK. πŸ’…
  • INFO
INFO is INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. > 0: The algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns INFO/(N+1) through mod(INFO,N+1).

the vibe check at the end:

  • 0 = we ate, successful exit πŸŽ‰
  • < 0 = if INFO = -i, the i-th argument had an illegal value (bestie, check your args 😭)
  • > 0 = the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns INFO/(N+1) through mod(INFO,N+1). so it's not the whole matrix's fault, it's specifically that submatrix. she's telling you exactly where it went wrong, we respect the honesty 🫢

🌟 Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

the whole squad contributed, we stan a collaborative effort πŸ’–

πŸŽ€ Contributors:

Jeff Rutter, Computer Science Division, University of California at Berkeley, USA Modified by Francoise Tisseur, University of Tennessee

shoutout Jeff, shoutout Francoise, both icons, both ate πŸ‘‘

πŸ“– Definition at line 180 of file dstedc.f.

line 180, bestie. that's where the magic literally begins ✨


πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for LAPACK from the source code.

(not a human, a robot did this, and honestly? she understood the assignment πŸ€–πŸ’…)


okay that's the whole page!! and for the cute sign-off β€” this is LAPACK Version 3.12.0, page /home/abui...RC/dstedc.f(3), and that's the tea πŸ΅πŸ’– no cap, go compute some eigenvalues, you're gonna do amazing, mwah 🫢✨

πŸ“¦ where this page comes from