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 β€” is CHARACTER*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, Z contains the unitary matrix used to reduce the original matrix to tridiagonal form.
  • N β€” is INTEGER. The dimension of the symmetric tridiagonal matrix. N >= 0. Little baby matrices welcome, we don't judge. 🍼
  • D β€” is REAL array, dimension (N). On entry, the diagonal elements of the tridiagonal matrix. On exit, if INFO = 0, the eigenvalues in ascending order. A true glow-up arc, fr fr. ⭐
  • E β€” is REAL array, dimension (N-1). On entry, the subdiagonal elements of the tridiagonal matrix. On exit, E has been destroyed. πŸ’€ Rip bestie, it served its purpose.
  • Z β€” is COMPLEX array, dimension (LDZ,N). On entry, if COMPZ = 'V', then Z contains the unitary 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 Hermitian matrix, and if COMPZ = 'I', Z contains the orthonormal eigenvectors of the symmetric tridiagonal matrix. If COMPZ = 'N', then Z is not referenced. Not even a little bit. Not even looked at. πŸ™ˆ
  • LDZ β€” is INTEGER. The leading dimension of the array Z. LDZ >= 1. If eigenvectors are desired, then LDZ >= max(1,N). Respect the leading dimension, she's doing a lot for you. πŸ‘‘
  • WORK β€” is COMPLEX array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK. Iconic how it reports back.
  • LWORK β€” is INTEGER. The dimension of the array WORK.
    • If COMPZ = 'N' or 'I', or N <= 1, LWORK must be at least 1.
    • If COMPZ = 'V' and N > 1, LWORK must be at least N*N.
    • Note that for COMPZ = 'V', then if N is less than or equal to the minimum divide size, usually 25, then LWORK need only be 1.
    • If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. Sneaky little preview mode, we love a low-stakes vibe check. πŸ”₯
  • RWORK β€” is REAL array, dimension (MAX(1,LRWORK)). On exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
  • LRWORK β€” is INTEGER. The dimension of the array RWORK.
    • If COMPZ = 'N' or N <= 1, LRWORK must be at least 1.
    • If COMPZ = 'V' and N > 1, LRWORK must be at least
1 + 3*N + 2*N*lg N + 4*N**2 ,

where lg( N ) = smallest integer k such that 2**k >= N.

  • If COMPZ = 'I' and N > 1, LRWORK must be at least
1 + 4*N + 2*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 LRWORK need only be max(1,2*(N-1)).
  • If LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. Same vibe-check energy, different array. πŸ¦‹
  • IWORK β€” is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
  • LIWORK β€” is INTEGER. The dimension of the array IWORK.
    • If COMPZ = 'N' or N <= 1, LIWORK must be at least 1.
    • If COMPZ = 'V' or N > 1, LIWORK must be at least
6 + 6*N + 5*N*lg N.
  • If COMPZ = 'I' or N > 1, 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 sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. Third time's the charm. πŸŽ€
  • INFO β€” is INTEGER, the receipts holder:
    • = 0: successful exit. Slay. βœ…
    • < 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). 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 β€” is CHARACTER*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, Z contains the orthogonal matrix used to reduce the original matrix to tridiagonal form.
  • N β€” is INTEGER. The dimension of the symmetric tridiagonal matrix. N >= 0. 🌸
  • 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. ⭐
  • E β€” is DOUBLE PRECISION array, dimension (N-1). On entry, the subdiagonal elements of the tridiagonal matrix. On exit, E has been destroyed. Gone but not forgotten. πŸ’€
  • 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. She's off duty. πŸ™ˆ
  • LDZ β€” is INTEGER. The leading dimension of the array Z. LDZ >= 1. If eigenvectors are desired, then LDZ >= max(1,N). πŸ‘‘
  • WORK β€” is DOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • LWORK β€”
…and that's literally where the page cuts off, bestie β€” LWORK for DSTEDC picks 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 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*N**2 ),

where lg( N ) = smallest integer k such that 2**k >= 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.
  • IWORK β€” IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
  • LIWORK β€” LIWORK is INTEGER. It's 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.
  • INFO β€” INFO is INTEGER
    • = 0: successful exit. slay πŸ’–
    • < 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). 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, Z contains 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, if INFO = 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, E has been destroyed. gone bestie πŸ’€
  • Z β€” Z is REAL 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.
  • LDZ β€” LDZ is INTEGER. The leading dimension of the array Z. LDZ >= 1. If eigenvectors are desired, then LDZ >= max(1,N).
  • WORK β€” WORK is REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
  • 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*N**2 ),

where lg( N ) = smallest integer k such that 2**k >= 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.
  • IWORK β€” IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
  • 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.
  • 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).

πŸ‘‘ 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, Z contains 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, if INFO = 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, E has been destroyed.
  • Z β€” Z is COMPLEX*16 array, dimension (LDZ,N). On entry, if COMPZ = 'V', then Z contains the unitary 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 Hermitian matrix, and if COMPZ = 'I', Z contains the orthonormal eigenvectors of the symmetric tridiagonal matrix. If COMPZ = 'N', then Z is not referenced.
  • LDZ β€” LDZ is INTEGER. The leading dimension of the array Z. LDZ >= 1. If eigenvectors are desired, then LDZ >= max(1,N).
  • WORK
  • WORK β€” a COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, then WORK(1) hands you back the optimal LWORK ✨ (it's literally tattling on how much space it actually wanted).
  • LWORK β€” an INTEGER, the dimension of the array WORK. Here's the sizing tea β˜•:
    • If COMPZ = 'N' or 'I', or N <= 1, then LWORK must be at least 1.
    • If COMPZ = 'V' and N > 1, then LWORK must be at least N*N.
    • Note that for COMPZ = 'V', then if N is less than or equal to the minimum divide size, usually 25, then LWORK need only be 1.
    • If LWORK = -1, then a workspace query is assumed πŸ•΅οΈβ€β™€οΈ β€” the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA. So lowkey you can probe it without getting yelled at πŸ’….
  • RWORK β€” a DOUBLE PRECISION array, dimension (MAX(1,LRWORK)). On exit, if INFO = 0, then RWORK(1) returns the optimal LRWORK πŸŽ€.
  • LRWORK β€” an INTEGER, the dimension of the array RWORK.
    • If COMPZ = 'N' or N <= 1, then LRWORK must be at least 1.
    • If COMPZ = 'V' and N > 1, then LRWORK must be at least
1 + 3*N + 2*N*lg N + 4*N**2 ,

where lg( N ) = smallest integer k such that 2**k >= N.

  • If COMPZ = 'I' and N > 1, then LRWORK must be at least
1 + 4*N + 2*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 LRWORK need only be max(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 the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.
  • IWORK β€” an INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, then IWORK(1) returns the optimal LIWORK 🌸.
  • LIWORK β€” an INTEGER, the dimension of the array IWORK.
    • If COMPZ = 'N' or N <= 1, then LIWORK must be at least 1.
    • If COMPZ = 'V' or N > 1, LIWORK must be at least
6 + 6*N + 5*N*lg N.
  • If COMPZ = 'I' or N > 1, 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. Tiny! 🧚
  • If LIWORK = -1, then a workspace query is assumed β€” the routine only calculates the optimal sizes of the WORK, RWORK and IWORK arrays, returns these values as the first entries of the WORK, RWORK and IWORK arrays, and no error message related to LWORK or LRWORK or LIWORK is issued by XERBLA.
  • INFO β€” an INTEGER, the vibe report at the end πŸ”₯:
    • = 0: successful exit. Slay, it worked πŸ’–
    • < 0: if INFO = -i, the i-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 columns INFO/(N+1) through mod(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