DSTEIN2(l)
π DSTEIN2 β bestie's guide to the LAPACK routine π
okay so welcome to DSTEIN2, a LAPACK routine (we're on version 1.5, she's vintage, she's iconic). This one is all about eigenvectors of a real symmetric tridiagonal matrix. No cap.
β¨ NAME β¨
DSTEIN2 β compute the eigenvectors of a real symmetric tridiagonal matrix T corresponding to specified eigenvalues, using inverse iteration. π
π SYNOPSIS π
SUBROUTINE DSTEIN2( N, D, E, M, W, IBLOCK, ISPLIT, ORFAC, Z, LDZ, WORK,
IWORK, IFAIL, INFO )
INTEGER INFO, LDZ, M, N
DOUBLE PRECISION ORFAC
INTEGER IBLOCK( * ), IFAIL( * ), ISPLIT( * ), IWORK( * )
DOUBLE PRECISION D( * ), E( * ), W( * ), WORK( * ), Z( LDZ,
* )
πΈ PURPOSE πΈ
So basically, DSTEIN2 computes the eigenvectors of a real symmetric tridiagonal matrix T corresponding to specified eigenvalues, using inverse iteration. That's the whole vibe. π¦
And listen β the maximum number of iterations allowed for each eigenvector is specified by an internal parameter MAXITS (currently set to 5). Five. That's the budget. Bestie gets five shots. π
π ARGUMENTS π
N(input)INTEGERβ the order of the matrix. Constraint:N >= 0. π«ΆD(input)DOUBLE PRECISIONarray, dimension(N)β thendiagonal elements of the tridiagonal matrixT. πE(input)DOUBLE PRECISIONarray, dimension(N)β the(n-1)subdiagonal elements of the tridiagonal matrixT, sitting in elements1toN-1.E(N)need not be set. She's off the clock, leave her alone. πM(input)INTEGERβ the number of eigenvectors to be found. Constraint:0 <= M <= N. πW(input)DOUBLE PRECISIONarray, dimension(N)β the firstMelements ofWcontain the eigenvalues for which eigenvectors are to be computed. These eigenvalues should be grouped by split-off block and ordered from smallest to largest within the block. (The output arrayWfromDSTEBZwithORDER = 'B'is expected here.) It's giving very specific requirements, and honestly? Respect. βIBLOCK(input)INTEGERarray, dimension(N)β the submatrix indices associated with the corresponding eigenvalues inW. SoIBLOCK(i)=1if eigenvalueW(i)belongs to the first submatrix from the top,=2ifW(i)belongs to the second submatrix, etc. (The output arrayIBLOCKfromDSTEBZis expected here.) π§ISPLIT(input)INTEGERarray, dimension(N)β the splitting points, at whichTbreaks up into submatrices. The first submatrix consists of rows/columns1toISPLIT( 1 ), the second of rows/columnsISPLIT( 1 )+1throughISPLIT( 2 ), etc. (The output arrayISPLITfromDSTEBZis expected here.) The way she just... divides the matrix. Main character energy. πORFAC(input)DOUBLE PRECISIONβORFACspecifies which eigenvectors should be orthogonalized. Eigenvectors that correspond to eigenvalues which are withinORFAC*||T||of each other are to be orthogonalized. Close eigenvalues get the ortho treatment, periodt. β¨Z(output)DOUBLE PRECISIONarray, dimension(LDZ, M)β the computed eigenvectors. The eigenvector associated with the eigenvalueW(i)is stored in thei-th column ofZ. Any vector which fails to converge is set to its current iterate afterMAXITSiterations. Not ideal, not a slay, but that's the deal. πLDZ(input)INTEGERβ the leading dimension of the arrayZ. Constraint:LDZ >= max(1,N). π₯WORK(workspace)DOUBLE PRECISIONarray, dimension(5*N). It's doing the work, hence the name, iykyk. π«ΆIWORK(workspace)INTEGERarray, dimension(N). πIFAIL(output)INTEGERarray, dimension(M)β on normal exit, all elements ofIFAILare zero. If one or more eigenvectors fail to converge afterMAXITSiterations, then their indices are stored in arrayIFAIL. So ifIFAILhas entries, that's the group chat telling you who didn't show up. πINFO(output)INTEGERβ the status report, and she has three moods:= 0: successful exit. π< 0: ifINFO = -i, thei-th argument had an illegal value. π¨> 0: ifINFO = i, thenieigenvectors failed to converge inMAXITSiterations. Their indices are stored in arrayIFAIL. π
π PARAMETERS π
MAXITSINTEGER, default =5β the maximum number of iterations performed. Five. That's it. That's the number. βEXTRAINTEGER, default =2β the number of iterations performed after the norm growth criterion is satisfied, and it should be at least1. So the floor is1, bestie, do not go below. πΈ
Heads up: this routine is from LAPACK version 1.5, so check your version and constraints before you ship anything to prod. She's an elder, treat her with respect. π
That's the whole page, no crumbs left. Sending you love from LAPACK routine version 1.5, dated 12 May 1997 β she's been serving eigenvectors since the 90s and she's still booked and busy. π β¨π¦
π¦ where this page comes from
- ubuntu jammy: scalapack-doc 1.5-11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms