CHSEIN(3)
CHSEIN(3) β¨ β inverse iteration but make it iconic π
okay so bestie, this is CHSEIN(3) from /home/abui...RC/chsein.f(3) and it's literally the LAPACK routine that uses inverse iteration to find specified right and/or left eigenvectors of a complex upper Hessenberg matrix H. it's giving main character energy in the LAPACK library and we're obsessed π
SYNOPSIS π
subroutine CHSEIN (side, eigsrc, initv, select, n, h, ldh, w, vl, ldvl,
vr, ldvr, mm, m, work, rwork, ifaill, ifailr, info)
CHSEIN
and the full signature with all the types, so you know exactly what you're signing up for:
subroutine CHSEIN (character side, character eigsrc, character initv,
logical, dimension( * ) select, integer n, complex, dimension( ldh, * )
h, integer ldh, complex, dimension( * ) w, complex, dimension( ldvl, * )
vl, integer ldvl, complex, dimension( ldvr, * ) vr, integer ldvr,
integer mm, integer m, complex, dimension( * ) work, real, dimension( *
) rwork, integer, dimension( * ) ifaill, integer, dimension( * ) ifailr,
integer info)
CHSEIN
DESCRIPTION π¦
okay so the whole vibe of CHSEIN is: it uses inverse iteration to find specified right and/or left eigenvectors of a complex upper Hessenberg matrix H. no cap, that's literally what it does and it slays π
the right eigenvector x and the left eigenvector y of the matrix H corresponding to an eigenvalue w are defined by:
H * x = w * x, y**h * H = w * y**h
where yh denotes the conjugate transpose of the vector y. periodt. that's the math and it ate π₯
PARAMETERS πΈ
SIDE
SIDEisCHARACTER*1= 'R': compute right eigenvectors only= 'L': compute left eigenvectors only= 'B': compute both right and left eigenvectors
EIGSRC
EIGSRCisCHARACTER*1β this one specifies the source of eigenvalues supplied inW:= 'Q': the eigenvalues were found using CHSEQR. so if H has zero subdiagonal elements, and so is block-triangular, then the j-th eigenvalue can be assumed to be an eigenvalue of the block containing the j-th row/column. this property allows CHSEIN to perform inverse iteration on just one diagonal block. lowkey efficient, highkey iconic β¨= 'N': no assumptions are made on the correspondence between eigenvalues and diagonal blocks. in this case, CHSEIN must always perform inverse iteration using the whole matrix H. it's giving thorough, ngl π«Ά
INITV
INITVisCHARACTER*1= 'N': no initial vectors are supplied= 'U': user-supplied initial vectors are stored in the arraysVLand/orVR
SELECT
SELECTis aLOGICALarray, dimension(N)- specifies the eigenvectors to be computed. to select the eigenvector corresponding to the eigenvalue
W(j), you gotta setSELECT(j)to.TRUE.. that's the vibe check babe π
- specifies the eigenvectors to be computed. to select the eigenvector corresponding to the eigenvalue
N
NisINTEGER- the order of the matrix H.
N >= 0. no negative energy allowed π ββοΈ
- the order of the matrix H.
H
His aCOMPLEXarray, dimension(LDH,N)- the upper Hessenberg matrix H.
- if a NaN is detected in H, the routine will return with
INFO=-6. not me catching NaN and throwing an error π
LDH
LDHisINTEGER- the leading dimension of the array
H.LDH >= max(1,N).
- the leading dimension of the array
W
Wis aCOMPLEXarray, dimension(N)- on entry: the eigenvalues of H.
- on exit: the real parts of W may have been altered since close eigenvalues are perturbed slightly in searching for independent eigenvectors. it's giving "we tweaked it a little for the algorithm" and honestly same π
VL
VLis aCOMPLEXarray, dimension(LDVL,MM)- on entry: if
INITV = 'U'andSIDE = 'L'or'B',VLmust contain starting vectors for the inverse iteration for the left eigenvectors; the starting vector for each eigenvector must be in the same column in which the eigenvector will be stored. - on exit: if
SIDE = 'L'or'B', the left eigenvectors specified bySELECTwill be stored consecutively in the columns ofVL, in the same order as their eigenvalues. - if
SIDE = 'R',VLis not referenced. it's literally not invited to the right-side party π
- on entry: if
LDVL
LDVLisINTEGER- the leading dimension of the array
VL. LDVL >= max(1,N)ifSIDE = 'L'or'B';LDVL >= 1otherwise.
- the leading dimension of the array
VR
VRis aCOMPLEXarray, dimension(LDVR,MM)- on entry: if
INITV = 'U'andSIDE = 'R'or'B',VRmust contain starting vectors for the inverse iteration for the right eigenvectors; the starting vector for each eigenvector must be in the same column in which the eigenvector will be stored. - on exit: if
SIDE = 'R'or'B', the right eigenvectors specified bySELECTwill be stored consecutively in the columns ofVR, in the same order as their eigenvalues. - if
SIDE = 'L',VRis not referenced. same energy as VL but flipped πββοΈ
- on entry: if
LDVR
LDVRisINTEGER- the leading dimension of the array
VR. LDVR >= max(1,N)ifSIDE = 'R'or'B';LDVR >= 1otherwise.
- the leading dimension of the array
MM
MMisINTEGER- the number of columns in the arrays
VLand/orVR.MM >= M.
- the number of columns in the arrays
M
MisINTEGER- the number of columns in the arrays
VLand/orVRrequired to store the eigenvectors (which equals the number of.TRUE.elements inSELECT). soMis literally focused only on the chosen ones, and honestly we respect the selectivity π
- the number of columns in the arrays
WORK
WORKis aCOMPLEXarray, dimension(N*N)
RWORK
RWORKis aREALarray, dimension(N)
IFAILL
IFAIL Lis anINTEGERarray, dimension(MM)- if
SIDE = 'L'or'B',IFAIL L(i) = j > 0if the left eigenvector in the i-th column ofVL(corresponding to the eigenvaluew(j)) failed to converge;IFAIL L(i) = 0if the eigenvector converged satisfactorily. it's giving "some of y'all didn't make the cut" π - if
SIDE = 'R',IFAIL Lis not referenced.
- if
IFAILR
IFAILRis anINTEGERarray, dimension(MM)- if
SIDE = 'R'or'B',IFAILR(i) = j > 0if the right eigenvector in the i-th column ofVR(corresponding to the eigenvaluew(j)) failed to converge;IFAILR(i) = 0if the eigenvector converged satisfactorily. same energy but for the right side π«Ά - if
SIDE = 'L',IFAILRis not referenced.
- if
INFO
INFOisINTEGER= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value. you tried it and the argument said "not today" π> 0: ifINFO = i,iis the number of eigenvectors which failed to converge. seeIFAIL LandIFAILRfor further details. sometimes the vibes just don't converge, bestie π
AUTHOR π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
these institutions literally collaborated on this and we're grateful π
FURTHER DETAILS π§
each eigenvector is normalized so that the element of largest magnitude has magnitude 1; here the magnitude of a complex number(x,y)is taken to be|x|+|y|. that's the normalization rule and it's giving "we keep it neat" energy π
DEFINITION π
Definition at line 242 of file chsein.f.
Generated automatically by Doxygen for LAPACK from the source code. it's giving "the robots wrote this documentation and honestly they ate" π€π
and that's the whole page bestie β LAPACK Version 3.12.0, from /home/abui...RC/chsein.f(3), and if you need me I'll be over here normalizing my eigenvectors so the biggest element is 1. periodt. πβ¨π¦π
π¦ 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