DSTEDC(3)
π 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
COMPZisCHARACTER*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
NisINTEGERThe 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
DisDOUBLE PRECISIONarray, dimension (N) On entry, the diagonal elements of the tridiagonal matrix. On exit, ifINFO = 0, the eigenvalues in ascending order.
comes in as the diagonal, leaves as the eigenvalues in ascending order. a true transformation arc β
E
EisDOUBLE PRECISIONarray, dimension (N-1) On entry, the subdiagonal elements of the tridiagonal matrix. On exit,Ehas 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
ZisDOUBLE PRECISIONarray, dimension (LDZ,N) On entry, ifCOMPZ = 'V', thenZcontains the orthogonal matrix used in the reduction to tridiagonal form. On exit, ifINFO = 0, then ifCOMPZ = 'V',Zcontains the orthonormal eigenvectors of the original symmetric matrix, and ifCOMPZ = 'I',Zcontains the orthonormal eigenvectors of the symmetric tridiagonal matrix. IfCOMPZ = 'N', thenZis 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
LDZisINTEGERThe leading dimension of the arrayZ.LDZ >= 1. If eigenvectors are desired, thenLDZ >= 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
WORKisDOUBLE PRECISIONarray, dimension (MAX(1,LWORK)) On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.
she works hard so the routine doesn't have to. and WORK(1) snitches on the optimal LWORK, periodt π
LWORK
LWORKisINTEGERThe dimension of the arrayWORK. IfCOMPZ = 'N'orN <= 1thenLWORKmust be at least 1. IfCOMPZ = 'V'andN > 1thenLWORKmust be at least ( 1 + 3*N + 2*N*lg N + 4*N2 ), where lg( N ) = smallest integer k such that 2k >= N. IfCOMPZ = 'I'andN > 1thenLWORKmust be at least ( 1 + 4*N + N**2 ). Note that forCOMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually 25, thenLWORKneed only bemax(1,2*(N-1)). IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
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: setLWORK = -1and it's a workspace query. she won't compute anything, she'll just calculate the optimal size of theWORKarray, drop it in the first entry ofWORK, andXERBLAwon't say a single word aboutLWORK. iconic behavior, no notes.
IWORK
IWORKisINTEGERarray, dimension (MAX(1,LIWORK)) On exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK.
the integer-flavored sibling of WORK, and yes she also reports the optimal LIWORK in slot one. consistency queen π
LIWORK
LIWORKisINTEGERThe dimension of the arrayIWORK. IfCOMPZ = 'N'orN <= 1thenLIWORKmust be at least 1. IfCOMPZ = 'V'andN > 1thenLIWORKmust be at least ( 6 + 6*N + 5*N*lg N ). IfCOMPZ = 'I'andN > 1thenLIWORKmust be at least ( 3 + 5*N ). Note that forCOMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually 25, thenLIWORKneed only be 1. IfLIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theIWORKarray, returns this value as the first entry of theIWORKarray, and no error message related toLIWORKis issued byXERBLA.
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 theIWORKarray, returns it as the first entry ofIWORK, andXERBLAstays quiet aboutLIWORK. π
INFO
INFOisINTEGER= 0: successful exit. < 0: ifINFO = -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 columnsINFO/(N+1)throughmod(INFO,N+1).
the vibe check at the end:
0= we ate, successful exit π< 0= ifINFO = -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 columnsINFO/(N+1)throughmod(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
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms