stedc(3)
Ok so real talk: this page is stedc(3) from the Library Functions Manual, and it's literally the divide-and-conquer eigenvalue saga. Grab a snack, bestie, we're getting into it. π
β¨ NAME β¨
stedc β stedc: eig, divide and conquer. No cap, that's the whole name. π
πΈ SYNOPSIS πΈ
π«Ά Functions
Four flavors of the exact same energy, one per precision. Iconic behavior, honestly:
- CSTEDC
subroutine cstedc (compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
- DSTEDC
subroutine dstedc (compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info)
- SSTEDC
subroutine sstedc (compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info)
- ZSTEDC
subroutine zstedc (compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
Notice how cstedc and zstedc get the extra rwork/lrwork glow-up? That's the complex-kids privilege. π
π¦ Detailed Description π¦
This is the part where the page usually says something profound, but it's literally just the runway for the Function Documentation section below. Everything you actually came for is down there π
π Function Documentation π
π§ CSTEDC β subroutine cstedc
subroutine cstedc (character compz, integer n, real, dimension( * ) d, real,
dimension( * ) e, complex, dimension( ldz, * ) z, integer ldz, complex,
dimension( * ) work, integer lwork, real, dimension( * ) rwork, integer
lrwork, integer, dimension( * ) iwork, integer liwork, integer info)
β¨ Purpose
Ok so here's the tea: CSTEDC computes all eigenvalues and, if you want them, the eigenvectors of a symmetric tridiagonal matrix, using the divide and conquer method. Obsessed. π
And it's not just tridiagonal-only β you can also get the eigenvectors of a full or band complex Hermitian matrix if CHETRD or CHPTRD or CHBTRD has already been used to reduce that matrix to tridiagonal form. The way that reduction pipeline eats π
π Parameters
COMPZβ isCHARACTER*1, and honestly it's the whole personality selector:= 'N': compute eigenvalues only.= 'I': compute eigenvectors of the tridiagonal matrix also.= 'V': compute eigenvectors of the original Hermitian matrix also. On entry,Zcontains the unitary matrix used to reduce the original matrix to tridiagonal form.
Nβ isINTEGER. The dimension of the symmetric tridiagonal matrix.N >= 0. Little baby matrices welcome, we don't judge. πΌDβ isREAL array, dimension (N). On entry, the diagonal elements of the tridiagonal matrix. On exit, ifINFO = 0, the eigenvalues in ascending order. A true glow-up arc, fr fr. βEβ isREAL array, dimension (N-1). On entry, the subdiagonal elements of the tridiagonal matrix. On exit,Ehas been destroyed. π Rip bestie, it served its purpose.Zβ isCOMPLEX array, dimension (LDZ,N). On entry, ifCOMPZ = 'V', thenZcontains the unitary matrix used in the reduction to tridiagonal form. On exit, ifINFO = 0, then ifCOMPZ = 'V',Zcontains the orthonormal eigenvectors of the original Hermitian matrix, and ifCOMPZ = 'I',Zcontains the orthonormal eigenvectors of the symmetric tridiagonal matrix. IfCOMPZ = 'N', thenZis not referenced. Not even a little bit. Not even looked at. πLDZβ isINTEGER. The leading dimension of the arrayZ.LDZ >= 1. If eigenvectors are desired, thenLDZ >= max(1,N). Respect the leading dimension, she's doing a lot for you. πWORKβ isCOMPLEX array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. Iconic how it reports back.LWORKβ isINTEGER. The dimension of the arrayWORK.- If
COMPZ = 'N'or'I', orN <= 1,LWORKmust be at least1. - If
COMPZ = 'V'andN > 1,LWORKmust be at leastN*N. - Note that for
COMPZ = 'V', then ifNis less than or equal to the minimum divide size, usually25, thenLWORKneed only be1. - If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. Sneaky little preview mode, we love a low-stakes vibe check. π₯
- If
RWORKβ isREAL array, dimension (MAX(1,LRWORK)). On exit, ifINFO = 0,RWORK(1)returns the optimalLRWORK.LRWORKβ isINTEGER. The dimension of the arrayRWORK.- If
COMPZ = 'N'orN <= 1,LRWORKmust be at least1. - If
COMPZ = 'V'andN > 1,LRWORKmust be at least
- If
1 + 3*N + 2*N*lg N + 4*N**2 ,
where lg( N ) = smallest integer k such that 2**k >= N.
- If
COMPZ = 'I'andN > 1,LRWORKmust be at least
1 + 4*N + 2*N**2 .
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLRWORKneed only bemax(1,2*(N-1)). - If
LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. Same vibe-check energy, different array. π¦
IWORKβ isINTEGER array, dimension (MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK.LIWORKβ isINTEGER. The dimension of the arrayIWORK.- If
COMPZ = 'N'orN <= 1,LIWORKmust be at least1. - If
COMPZ = 'V'orN > 1,LIWORKmust be at least
- If
6 + 6*N + 5*N*lg N.
- If
COMPZ = 'I'orN > 1,LIWORKmust be at least
3 + 5*N .
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLIWORKneed only be1. - If
LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. Third time's the charm. π
INFOβ isINTEGER, the receipts holder:= 0: successful exit. Slay. β< 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). Not a cute look, but at least it tells you exactly where things went sideways. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π«Ά Contributors:
Jeff Rutter, Computer Science Division, University of California at Berkeley, USA
π Definition
Definition at line 204 of file cstedc.f.
π§ DSTEDC β subroutine dstedc
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)
β¨ Purpose
DSTEDC computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the divide and conquer method. Same main-character algorithm, just double precision this time. π₯
You can also nab the eigenvectors of a full or band real symmetric matrix if DSYTRD or DSPTRD or DSBTRD has been used to reduce this matrix to tridiagonal form. The pipeline is pipeline-ing. π
π Parameters
COMPZβ isCHARACTER*1, choose your fighter:= 'N': compute eigenvalues only.= 'I': compute eigenvectors of the tridiagonal matrix also.= 'V': compute eigenvectors of the original dense symmetric matrix also. On entry,Zcontains the orthogonal matrix used to reduce the original matrix to tridiagonal form.
Nβ isINTEGER. The dimension of the symmetric tridiagonal matrix.N >= 0. πΈDβ isDOUBLE PRECISION array, dimension (N). On entry, the diagonal elements of the tridiagonal matrix. On exit, ifINFO = 0, the eigenvalues in ascending order. βEβ isDOUBLE PRECISION array, dimension (N-1). On entry, the subdiagonal elements of the tridiagonal matrix. On exit,Ehas been destroyed. Gone but not forgotten. πZβ isDOUBLE PRECISION array, 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. She's off duty. πLDZβ isINTEGER. The leading dimension of the arrayZ.LDZ >= 1. If eigenvectors are desired, thenLDZ >= max(1,N). πWORKβ isDOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβ
β¦and that's literally where the page cuts off, bestie βLWORKforDSTEDCpicks right back up in part 2, don't panic π«Ά
okay so, still deep in the dstedc parameter zone, and this next bit is the workspace math bestie β do not skip it, the array sizes are lowkey the whole vibe π
LWORKβLWORK is INTEGER. It's the dimension of the arrayWORK.- If
COMPZ = 'N'orN <= 1thenLWORKmust be at least1. - If
COMPZ = 'V'andN > 1thenLWORKmust be at least
- If
( 1 + 3*N + 2*N*lg N + 4*N**2 ),
where lg( N ) = smallest integer k such that 2**k >= N.
- If
COMPZ = 'I'andN > 1thenLWORKmust be at least
( 1 + 4*N + N**2 ).
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLWORKneed only bemax(1,2*(N-1)). - If
LWORK = -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.
IWORKβIWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK.LIWORKβLIWORK is INTEGER. It's the dimension of the arrayIWORK.- If
COMPZ = 'N'orN <= 1thenLIWORKmust be at least1. - If
COMPZ = 'V'andN > 1thenLIWORKmust be at least
- If
( 6 + 6*N + 5*N*lg N ).
- If
COMPZ = 'I'andN > 1thenLIWORKmust be at least
( 3 + 5*N ).
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLIWORKneed only be1. - If
LIWORK = -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.
INFOβINFO is INTEGER= 0: successful exit. slay π< 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). not the vibe π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors
- Jeff Rutter, Computer Science Division, University of California at Berkeley, USA
- Modified by Francoise Tisseur, University of Tennessee
π Definition
Definition at line 180 of file dstedc.f.
πΈ subroutine sstedc β SSTEDC
subroutine sstedc (character compz, integer n, real, dimension( * ) d, real,
dimension( * ) e, real, dimension( ldz, * ) z, integer ldz, real,
dimension( * ) work, integer lwork, integer, dimension( * ) iwork,
integer liwork, integer info)
SSTEDC
β¨ Purpose
okay so SSTEDC does the whole divide-and-conquer thing: it 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 SSYTRD or SSPTRD or SSBTRD has been used to reduce this matrix to tridiagonal form. iconic behavior honestly π¦
π§ 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,Zcontains the orthogonal matrix used to reduce the original matrix to tridiagonal form.
NβN is INTEGER. The dimension of the symmetric tridiagonal matrix.N >= 0.DβD is REAL array, dimension (N). On entry, the diagonal elements of the tridiagonal matrix. On exit, ifINFO = 0, the eigenvalues in ascending order.EβE is REAL array, dimension (N-1). On entry, the subdiagonal elements of the tridiagonal matrix. On exit,Ehas been destroyed. gone bestie πZβZ is REAL array, 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.LDZβLDZ is INTEGER. The leading dimension of the arrayZ.LDZ >= 1. If eigenvectors are desired, thenLDZ >= max(1,N).WORKβWORK is REAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGER. The dimension of the arrayWORK.- If
COMPZ = 'N'orN <= 1thenLWORKmust be at least1. - If
COMPZ = 'V'andN > 1thenLWORKmust be at least
- If
( 1 + 3*N + 2*N*lg N + 4*N**2 ),
where lg( N ) = smallest integer k such that 2**k >= N.
- If
COMPZ = 'I'andN > 1thenLWORKmust be at least
( 1 + 4*N + N**2 ).
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLWORKneed only bemax(1,2*(N-1)). - If
LWORK = -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.
IWORKβIWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK.LIWORKβLIWORK is INTEGER. The dimension of the arrayIWORK.- If
COMPZ = 'N'orN <= 1thenLIWORKmust be at least1. - If
COMPZ = 'V'andN > 1thenLIWORKmust be at least
- If
( 6 + 6*N + 5*N*lg N ).
- If
COMPZ = 'I'andN > 1thenLIWORKmust be at least
( 3 + 5*N ).
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLIWORKneed only be1. - If
LIWORK = -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.
INFOβINFO is INTEGER= 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).
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors
- Jeff Rutter, Computer Science Division, University of California at Berkeley, USA
- Modified by Francoise Tisseur, University of Tennessee
π Definition
Definition at line 180 of file sstedc.f.
π subroutine zstedc β ZSTEDC
subroutine zstedc (character compz, integer n, double precision, dimension(
* ) d, double precision, dimension( * ) e, complex*16, dimension( ldz, *
) z, integer ldz, complex*16, dimension( * ) work, integer lwork, double
precision, dimension( * ) rwork, integer lrwork, integer, dimension( * )
iwork, integer liwork, integer info)
ZSTEDC
β¨ Purpose
ZSTEDC computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix using the divide and conquer method. The eigenvectors of a full or band complex Hermitian matrix can also be found if ZHETRD or ZHPTRD or ZHBTRD has been used to reduce this matrix to tridiagonal form. complex Hermitian bestie rights π
π§ Parameters
COMPZβCOMPZ is CHARACTER*1= 'N': Compute eigenvalues only.= 'I': Compute eigenvectors of tridiagonal matrix also.= 'V': Compute eigenvectors of original Hermitian matrix also. On entry,Zcontains the unitary matrix used to reduce the original matrix to tridiagonal form.
NβN is INTEGER. The dimension of the symmetric tridiagonal matrix.N >= 0.DβD is DOUBLE PRECISION array, dimension (N). On entry, the diagonal elements of the tridiagonal matrix. On exit, ifINFO = 0, the eigenvalues in ascending order.EβE is DOUBLE PRECISION array, dimension (N-1). On entry, the subdiagonal elements of the tridiagonal matrix. On exit,Ehas been destroyed.ZβZ is COMPLEX*16 array, dimension (LDZ,N). On entry, ifCOMPZ = 'V', thenZcontains the unitary matrix used in the reduction to tridiagonal form. On exit, ifINFO = 0, then ifCOMPZ = 'V',Zcontains the orthonormal eigenvectors of the original Hermitian matrix, and ifCOMPZ = 'I',Zcontains the orthonormal eigenvectors of the symmetric tridiagonal matrix. IfCOMPZ = 'N', thenZis not referenced.LDZβLDZ is INTEGER. The leading dimension of the arrayZ.LDZ >= 1. If eigenvectors are desired, thenLDZ >= max(1,N).WORKWORKβ aCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0, thenWORK(1)hands you back the optimalLWORKβ¨ (it's literally tattling on how much space it actually wanted).LWORKβ anINTEGER, the dimension of the arrayWORK. Here's the sizing tea β:- If
COMPZ = 'N'or'I', orN <= 1, thenLWORKmust be at least1. - If
COMPZ = 'V'andN > 1, thenLWORKmust be at leastN*N. - Note that for
COMPZ = 'V', then ifNis less than or equal to the minimum divide size, usually25, thenLWORKneed only be1. - If
LWORK = -1, then a workspace query is assumed π΅οΈββοΈ β the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. So lowkey you can probe it without getting yelled at π .
- If
RWORKβ aDOUBLE PRECISIONarray, dimension(MAX(1,LRWORK)). On exit, ifINFO = 0, thenRWORK(1)returns the optimalLRWORKπ.LRWORKβ anINTEGER, the dimension of the arrayRWORK.- If
COMPZ = 'N'orN <= 1, thenLRWORKmust be at least1. - If
COMPZ = 'V'andN > 1, thenLRWORKmust be at least
- If
1 + 3*N + 2*N*lg N + 4*N**2 ,
where lg( N ) = smallest integer k such that 2**k >= N.
- If
COMPZ = 'I'andN > 1, thenLRWORKmust be at least
1 + 4*N + 2*N**2 .
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLRWORKneed only bemax(1,2*(N-1))β yeah, way chiller than the big formula, ikyk π. - If
LRWORK = -1, then a workspace query is assumed β the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA.
IWORKβ anINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0, thenIWORK(1)returns the optimalLIWORKπΈ.LIWORKβ anINTEGER, the dimension of the arrayIWORK.- If
COMPZ = 'N'orN <= 1, thenLIWORKmust be at least1. - If
COMPZ = 'V'orN > 1,LIWORKmust be at least
- If
6 + 6*N + 5*N*lg N.
- If
COMPZ = 'I'orN > 1,LIWORKmust be at least
3 + 5*N .
- Note that for
COMPZ = 'I'or'V', then ifNis less than or equal to the minimum divide size, usually25, thenLIWORKneed only be1. Tiny! π§ - If
LIWORK = -1, then a workspace query is assumed β the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA.
INFOβ anINTEGER, the vibe report at the end π₯:= 0: successful exit. Slay, it worked π< 0: ifINFO = -i, thei-th argument had an illegal value π (you passed it something cursed, bestie).> 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 literally tells you exactly which blob of the matrix it choked on. Not me getting a location pin for my own failure.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ Contributors:
Jeff Rutter, Computer Science Division, University of California at Berkeley, USA
Definition at line 204 of file zstedc.f.
π Author
Generated automatically by Doxygen for LAPACK from the source code. (Yeah, no human typed this part β it's giving robot doing its little paperwork π€β¨)
And that's the whole page, bestie β you made it to the end π«Ά This icon of a manpage is riding with LAPACK, Version 3.12.0, dated stedc(3) β go forth and size your workspaces correctly, periodt π
π
π¦ 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