TESTING/EIG/zchkhs.f(3)
π NAME π
ok so this page is TESTING/EIG/zchkhs.f, and it comes to you from the Library Functions Manual β yes, TESTING/EIG/zchkhs.f(3), that's the one. Main character of the day? ZCHKHS, the routine that gives your entire nonsymmetric eigenvalue pipeline a full vibe check π«Ά
β¨ SYNOPSIS β¨
π Functions/Subroutines π
subroutine zchkhs (nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a,
lda, h, t1, t2, u, ldu, z, uz, w1, w3, evectl, evectr, evecty,
evectx, uu, tau, work, nwork, rwork, iwork, select, result, info)
ZCHKHS
π¦ Function/Subroutine Documentation π¦
π
subroutine zchkhs π
like, here's the whole signature, in its full glory, no notes:
subroutine zchkhs (integer nsizes, integer, dimension( * ) nn, integer
ntypes, logical, dimension( * ) dotype, integer, dimension( 4 ) iseed,
double precision thresh, integer nounit, complex*16, dimension( lda, * )
a, integer lda, complex*16, dimension( lda, * ) h, complex*16,
dimension( lda, * ) t1, complex*16, dimension( lda, * ) t2, complex*16,
dimension( ldu, * ) u, integer ldu, complex*16, dimension( ldu, * ) z,
complex*16, dimension( ldu, * ) uz, complex*16, dimension( * ) w1,
complex*16, dimension( * ) w3, complex*16, dimension( ldu, * ) evectl,
complex*16, dimension( ldu, * ) evectr, complex*16, dimension( ldu, * )
evecty, complex*16, dimension( ldu, * ) evectx, complex*16, dimension(
ldu, * ) uu, complex*16, dimension( * ) tau, complex*16, dimension( * )
work, integer nwork, double precision, dimension( * ) rwork, integer,
dimension( * ) iwork, logical, dimension( * ) select, double precision,
dimension( 16 ) result, integer info)
ZCHKHS
β Purpose β
tiny heads up bestie: a couple of words got eaten by the doc conversion on this page (you'll spot the little β¦ gaps, that's not me being mysterious π).
ok so ZCHKHS checks the nonsymmetric eigenvalue problem routines. All of them. The whole squad. Here's who's showing up to the function π
ZGEHRDfactorsAasU H U', where'means conjugate transpose,His hessenberg, andUis unitary.ZUNGHRgenerates the unitary matrixU.ZUNMHRmultiplies a matrix by the unitary matrixU.ZHSEQRfactorsHasZ T Z', whereZis unitary andTis upper triangular. It also computes the eigenvalues,w(1), ..., w(n); we define a diagonal matrixWwhose (diagonal) entries are the eigenvalues.ZTREVCcomputes the left eigenvector matrixLand the right eigenvector matrixRfor the matrixT. The columns ofLare the complex conjugates of the left eigenvectors ofT. The columns ofRare the right eigenvectors ofT.Lis lower triangular, andRis upper triangular.ZHSEINcomputes the left eigenvector matrixYand the right eigenvector matrixXfor the matrixH. The columns ofYare the complex conjugates of the left eigenvectors ofH. The columns ofXare the right eigenvectors ofH.Yis lower triangular, andXis upper triangular.ZTREVC3computes left and right eigenvector matrices from a Schur matrixTand backtransforms them withZto eigenvector matricesLandRforA.LandRare GE matrices.
when ZCHKHS gets called, a number of matrix β¦ () and a number of matrix β¦ are specified. For each size β¦ () and each type of matrix, one matrix will be generated and used to test the nonsymmetric eigenroutines. For each matrix, 16 tests will be performed, and yes bestie, all sixteen are listed, we don't skip:
| A - U H U**H | / ( |A| n ulp )| I - UU**H | / ( n ulp )| H - Z T Z**H | / ( |H| n ulp )| I - ZZ**H | / ( n ulp )| A - UZ H (UZ)**H | / ( |A| n ulp )| I - UZ (UZ)**H | / ( n ulp )| T(Z computed) - T(Z not computed) | / ( |T| ulp )| W(Z computed) - W(Z not computed) | / ( |W| ulp )| TR - RW | / ( |T| |R| ulp )| L**H T - W**H L | / ( |T| |L| ulp )| HX - XW | / ( |H| |X| ulp )| Y**H H - W**H Y | / ( |H| |Y| ulp )| AX - XW | / ( |A| |X| ulp )| Y**H A - W**H Y | / ( |A| |Y| ulp )| AR - RW | / ( |A| |R| ulp )| LA - WL | / ( |A| |L| ulp )
the β¦ are specified by an array NN(1:NSIZES); the value of each element NN(j) specifies one size. the β¦ are specified by a logical array DOTYPE( 1:NTYPES ); if DOTYPE(j) is .TRUE., then matrix type β¦ will be generated. Currently, the list of possible types is β buckle up, there's 21 of them and they're all iconic in their own way π
- The zero matrix.
- The identity matrix.
- A (transposed) Jordan block, with 1's on the diagonal.
- A diagonal matrix with evenly spaced entries
1, ..., ULPand random complex angles. (ULP = (first number larger than 1) - 1) - A diagonal matrix with geometrically spaced entries
1, ..., ULPand random complex angles. - A diagonal matrix with β¦ entries
1, ULP, ..., ULPand random complex angles. - Same as (4), but multiplied by
SQRT( overflow threshold ) - Same as (4), but multiplied by
SQRT( underflow threshold ) - A matrix of the form
U' T U, whereUis unitary andThas evenly spaced entries1, ..., ULPwith random complex angles on the diagonal and randomO(1)entries in the upper triangle. - A matrix of the form
U' T U, whereUis unitary andThas geometrically spaced entries1, ..., ULPwith random complex angles on the diagonal and randomO(1)entries in the upper triangle. - A matrix of the form
U' T U, whereUis unitary andThas β¦ entries1, ULP,..., ULPwith random complex angles on the diagonal and randomO(1)entries in the upper triangle. - A matrix of the form
U' T U, whereUis unitary andThas complex eigenvalues randomly chosen fromULP < |z| < 1and randomO(1)entries in the upper triangle. - A matrix of the form
X' T X, whereXhas conditionSQRT( ULP )andThas evenly spaced entries1, ..., ULPwith random complex angles on the diagonal and randomO(1)entries in the upper triangle. - A matrix of the form
X' T X, whereXhas conditionSQRT( ULP )andThas geometrically spaced entries1, ..., ULPwith random complex angles on the diagonal and randomO(1)entries in the upper triangle. - A matrix of the form
X' T X, whereXhas conditionSQRT( ULP )andThas β¦ entries1, ULP,..., ULPwith random complex angles on the diagonal and randomO(1)entries in the upper triangle. - A matrix of the form
X' T X, whereXhas conditionSQRT( ULP )andThas complex eigenvalues randomly chosen fromULP < |z| < 1and randomO(1)entries in the upper triangle. - Same as (16), but multiplied by
SQRT( overflow threshold ) - Same as (16), but multiplied by
SQRT( underflow threshold ) - Nonsymmetric matrix with random entries chosen from
|z| < 1 - Same as (19), but multiplied by
SQRT( overflow threshold ) - Same as (19), but multiplied by
SQRT( underflow threshold )
NSIZESβ INTEGER. how many matrix sizes we're running through. if it's0,ZCHKHSliterally does nothing (like... why are you even here π). must be at least zero. not modified.NNβ INTEGER array, dimension(NSIZES). the actual sizes to use for the matrices. zero values get skipped bestie, they're not invited to the party. every value must be at least zero. not modified.NTYPESβ INTEGER. how many elements live inDOTYPE. if it's0, again,ZCHKHSdoes nothing. must be at least zero. BUT here's the spicy part πΆοΈ: if it'sMAXTYP+1andNSIZESis1, then a whole extra type gets defined βMAXTYP+1β which means "just use whatever matrix is already sitting inA". this is only useful ifDOTYPE(1:MAXTYP)is.FALSE.andDOTYPE(MAXTYP+1)is.TRUE.. not modified.DOTYPEβ LOGICAL array, dimension(NTYPES). ifDOTYPE(j)is.TRUE., then for every size inNNa matrix of that size and of typejgets generated, slay. ifNTYPESis smaller than the max number of types defined (PARAMETER MAXTYP), then typesNTYPES+1throughMAXTYPjust don't get generated. ifNTYPESis larger thanMAXTYP, thenDOTYPE(MAXTYP+1)throughDOTYPE(NTYPES)get ignored. not modified.ISEEDβ INTEGER array, dimension(4). on entry, this is the seed for the random number generator π². the elements should be between0and4095; if they're not, they get reduced mod4096. alsoISEED(4)must be odd, no exceptions. the generator uses a linear congruential sequence limited to small integers, so it should produce machine independent random numbers (iconic behaviour honestly). the values ofISEEDchange on exit, and you can feed them into the nextZCHKHScall to keep the same random number sequence going. modified.THRESHβ DOUBLE PRECISION. a test will count as if the , computed as described above, exceedsTHRESH(yes that sentence has holes in it, it's giving editing era, but that's what it says π« ). note that the error is scaled to be O(1), soTHRESHshould be a reasonably small multiple of1, e.g.10or100. in particular it should not depend on the precision (single vs. double) or the size of the matrix. it must be at least zero. not modified.NOUNITβ INTEGER. the FORTRAN unit number for printing out error messages (like if a routine returnsIINFOnot equal to0). not modified.Aβ COMPLEX*16 array, dimension(LDA,max(NN)). holds the matrix whose eigenvalues are about to be computed. on exit,Acontains the last matrix actually used. modified.LDAβ INTEGER. the leading dimension ofA,H,T1andT2. must be at least1and at leastmax( NN ). not modified.Hβ COMPLEX*16 array, dimension(LDA,max(NN)). the upper hessenberg matrix computed byZGEHRD. on exit,Hcontains the Hessenberg form of the matrix inA. modified.T1β COMPLEX*16 array, dimension(LDA,max(NN)). the Schur (=) matrix computed byZHSEQRifZis computed. on exit,T1contains the Schur form of the matrix inA. modified.T2β COMPLEX*16 array, dimension(LDA,max(NN)). the Schur matrix computed byZHSEQRwhenZis not computed. this should be identical toT1π. modified.LDUβ INTEGER. the leading dimension ofU,Z,UZandUU. must be at least1and at leastmax( NN ). not modified.Uβ COMPLEX*16 array, dimension(LDU,max(NN)). the unitary matrix computed byZGEHRD. modified.Zβ COMPLEX*16 array, dimension(LDU,max(NN)). the unitary matrix computed byZHSEQR. modified.UZβ COMPLEX*16 array, dimension(LDU,max(NN)). the product ofUtimesZ. modified.W1β COMPLEX*16 array, dimension(max(NN)). the eigenvalues ofA, as computed by a full Schur decompositionH = Z T Z'. on exit,W1contains the eigenvalues of the matrix inA. modified.W3β COMPLEX*16 array, dimension(max(NN)). the eigenvalues ofA, as computed by a partial Schur decomposition (Znot computed,Tonly computed as much as is necessary for determining eigenvalues). on exit,W3contains the eigenvalues of the matrix inA, possibly perturbed byZHSEIN. modified.EVECTLβ COMPLEX*16 array, dimension(LDU,max(NN)). the conjugate transpose of the (upper triangular) left eigenvector matrix for the matrix inT1. modified.EVEZTRβ COMPLEX*16 array, dimension(LDU,max(NN)). the (upper triangular) right eigenvector matrix for the matrix inT1. modified.EVECTYβ COMPLEX*16 array, dimension(LDU,max(NN)). the conjugate transpose of the left eigenvector matrix for the matrix inH. modified.EVECTXβ COMPLEX*16 array, dimension(LDU,max(NN)). the right eigenvector matrix for the matrix inH. modified.UUβ COMPLEX*16 array, dimension(LDU,max(NN)). details of the unitary matrix computed byZGEHRD. modified.TAUβ COMPLEX*16 array, dimension(max(NN)). further details of the unitary matrix computed byZGEHRD. modified.WORKβ COMPLEX*16 array, dimension(NWORK). workspace, bestie. modified.NWORKβ INTEGER. the number of entries inWORK.NWORK >= 4*NN(j)*NN(j) + 2. that's the rule, respect it π .RWORKβ DOUBLE PRECISION array, dimension(max(NN)). workspace. could be equivalenced toIWORK, but notSELECT. modified.IWORKβ INTEGER array, dimension(max(NN)). workspace. modified.SELECTβ LOGICAL array, dimension(max(NN)). workspace. could be equivalenced toIWORK, but notRWORK. modified.RESULTβ DOUBLE PRECISION array, dimension(16). the values computed by the fourteen tests described above. the values are currently limited to1/ulpto avoid overflow. modified.INFOβ INTEGER. if0, then everything ran OK β¨. otherwise:-1:NSIZES < 0-2: someNN(j) < 0-3:NTYPES < 0-6:THRESH < 0-9:LDA < 1orLDA < NMAX, whereNMAXismax( NN(j) )-14:LDU < 1orLDU < NMAX-26:NWORKtoo small
if ZLATMR, CLATMS, or CLATME returns an error code, the absolute value of it is returned. if 1, then ZHSEQR could not find all the shifts. if 2, then the EISPACK code (for small blocks) failed. if >2, then 30*N iterations were not enough to find an eigenvalue or to decompose the problem π. modified.
π§ Some Local Variables and Parameters
like, the backstage crew of this whole operation:
ZERO,ONEβ real0and1. the classics.MAXTYPβ the number of types defined.MTESTβ the number of tests defined. care must be taken that (1) the size ofRESULT, (2) the number of tests actually performed, and (3)MTESTagree. all three, bestie, they have to match π€.NTESTβ the number of tests performed on this matrix so far. this should be less thanMTEST, and equal to it by the last test. it'll be less if any of the routines being tested indicates that it could not compute the matrices that would be tested.NMAXβ the largest value inNN.NMATSβ the number of matrices generated so far.NERRSβ the number of tests which have exceededTHRESHso far (computed byDLAFTS).COND,CONDS,IMODEβ values to be passed to the matrix generators.ANORMβ norm ofA; passed to matrix generators.OVFL,UNFLβ overflow and underflow thresholds.ULP,ULPINVβ finest relative precision and its inverse.RTOVFL,RTUNFL,RTULP,RTULPIβ square roots of the previous 4 values.
the following four arrays decode JTYPE (iykyk):
KTYPE(j)β the general type (1-10) for type .KMODE(j)β theMODEvalue to be passed to the matrix generator for type .KMAGN(j)β the order of magnitude ( O(1), O(overflow^(1/2)), O(underflow^(1/2)) )KCONDS(j)β selects whetherCONDSis to be1or1/sqrt(ulp). (0means irrelevant.)
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Definition at line 416 of file zchkhs.f.
β¨ AUTHOR β¨
Generated automatically by Doxygen for LAPACK from the source code. π
Like, nobody hand-wrote this page bestie β it literally fell out of Doxygen's little document-generating machine, straight from the LAPACK source code. So if you gotta thank anyone, thank the source code and the robot that read it for you. π«Ά
okay that's the whole page, we're done, go take a vibe-check break π¦
This icon of a document came to you from LAPACK, Version 3.12.0, and it lives its best life at TESTING/EIG/zchkhs.f(3) β 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