ZCHKST(3)
πΈ zchkst.f(3) β Library Functions Manual πΈ
okay bestie, this page is literally zchkst.f(3) from the Library Functions Manual, and it's giving major LAPACK testing energy. no cap, we're looking at the whole ZCHKST situation β keep up, iykyk π
πΈ NAME πΈ
This whole page is about this exact file path, periodt:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/zchkst.f
β¨ SYNOPSIS β¨
π Functions/Subroutines π
Here's the subroutine lineup, bestie β literally one icon:
subroutine ZCHKST (nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a,
lda, ap, sd, se, d1, d2, d3, d4, d5, wa1, wa2, wa3, wr, u, ldu, v,
vp, tau, z, work, lwork, rwork, lrwork, iwork, liwork, result, info)
ZCHKST
π FUNCTION/SUBROUTINE DOCUMENTATION π
okay so this is the full signature, and it's lowkey a lot β but we do not skip a single argument in this house π«Ά:
subroutine ZCHKST (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( * ) ap, double precision,
dimension( * ) sd, double precision, dimension( * ) se, double
precision, dimension( * ) d1, double precision, dimension( * ) d2,
double precision, dimension( * ) d3, double precision, dimension( * )
d4, double precision, dimension( * ) d5, double precision, dimension( *
) wa1, double precision, dimension( * ) wa2, double precision,
dimension( * ) wa3, double precision, dimension( * ) wr, complex*16,
dimension( ldu, * ) u, integer ldu, complex*16, dimension( ldu, * ) v,
complex*16, dimension( * ) vp, complex*16, dimension( * ) tau,
complex*16, dimension( ldu, * ) z, complex*16, dimension( * ) work,
integer lwork, double precision, dimension( * ) rwork, integer lrwork,
integer, dimension( * ) iwork, integer liwork, double precision,
dimension( * ) result, integer info)
ZCHKST
and yes, it says ZCHKST again at the end β main character energy, honestly π
π Purpose π
Okay so picture the whole Hermitian eigenvalue pipeline as a group chat, and ZCHKST is the friend who screenshots everything and checks it against the receipts. Here's who she's checking on π
ZHETRD factors A as U S U*, where * means conjugate transpose, S is real symmetric tridiagonal, and U is unitary. ZHETRD can use either just the lower or just the upper triangle of A β ZCHKST checks both cases, no skipping π
ββοΈ. U is represented as a product of Householder transformations, whose vectors are stored in the first n-1 columns of V, and whose scale factors are in TAU.
ZHPTRD does the same as ZHETRD, except that A and V are stored in format. (yep, the source really does leave that word blank, iykyk π«Ά)
ZUNGTR constructs the matrix U from the contents of V and TAU.
ZUPGTR constructs the matrix U from the contents of VP and TAU.
ZSTEQR factors S as Z D1 Z*, where Z is the unitary matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal. D2 is the matrix of eigenvalues computed when Z is not computed.
DSTERF computes D3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors.
ZPTEQR factors S as Z4 D4 Z4*, for a Hermitian positive definite tridiagonal matrix. D5 is the matrix of eigenvalues computed when Z is not computed.
DSTEBZ computes selected eigenvalues. WA1, WA2, and WA3 will denote eigenvalues computed to high absolute accuracy, with different range options. WR will denote eigenvalues computed to high relative accuracy.
ZSTEIN computes Y, the eigenvectors of S, given the eigenvalues.
ZSTEDC factors S as Z D1 Z*, where Z is the unitary matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal (the 'I' option). It may also update an input unitary matrix, usually the output from ZHETRD/ZUNGTR or ZHPTRD/ZUPGTR (the 'V' option). It may also just compute eigenvalues (the 'N' option).
ZSTEMR factors S as Z D1 Z*, where Z is the unitary matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal (the 'I' option). ZSTEMR uses the Relatively Robust Representation whenever possible. iconic behavior honestly β¨
When ZCHKST is 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 Hermitian eigenroutines. For each matrix, a number of tests will be performed β and bestie, the test roster is LONG, we love a thorough queen π
(1)β| A - V S V* | / ( |A| n ulp )ZHETRD( UPLO='U', ... )(2)β| I - UV* | / ( n ulp )ZUNGTR( UPLO='U', ... )(3)β| A - V S V* | / ( |A| n ulp )ZHETRD( UPLO='L', ... )(4)β| I - UV* | / ( n ulp )ZUNGTR( UPLO='L', ... )(5-8)β Same as1-4, but forZHPTRDandZUPGTR.(9)β| S - Z D Z* | / ( |S| n ulp )ZSTEQR('V',...)(10)β| I - ZZ* | / ( n ulp )ZSTEQR('V',...)(11)β| D1 - D2 | / ( |D1| ulp )ZSTEQR('N',...)(12)β| D1 - D3 | / ( |D1| ulp )DSTERF(13)β0if the true eigenvalues (computed by sturm count) ofSare withinTHRESHof those inD1.2*THRESHif they are not. (Tested usingDSTECH)
For S positive definite:
(14)β| S - Z4 D4 Z4* | / ( |S| n ulp )ZPTEQR('V',...)(15)β| I - Z4 Z4* | / ( n ulp )ZPTEQR('V',...)(16)β| D4 - D5 | / ( 100 |D4| ulp )ZPTEQR('N',...)
When S is also diagonally dominant by the factor gamma < 1:
(17)β the accuracy check againstWR, done withDSTEBZ( 'A', 'E', ...):
max | D4(i) - WR(i) | / ( |D4(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
(18)β| WA1 - D3 | / ( |D3| ulp )DSTEBZ( 'A', 'E', ...)(19)β the two-way min/max match-up, done withDSTEBZ( 'I', 'E', ...):
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
(20)β| S - Y WA1 Y* | / ( |S| n ulp )DSTEBZ,ZSTEIN(21)β| I - Y Y* | / ( n ulp )DSTEBZ,ZSTEIN(22)β| S - Z D Z* | / ( |S| n ulp )ZSTEDC('I')(23)β| I - ZZ* | / ( n ulp )ZSTEDC('I')(24)β| S - Z D Z* | / ( |S| n ulp )ZSTEDC('V')(25)β| I - ZZ* | / ( n ulp )ZSTEDC('V')(26)β| D1 - D2 | / ( |D1| ulp )ZSTEDC('V')andZSTEDC('N')
Test 27 is disabled at the moment because ZSTEMR does not guarantee high relatvie accuracy. π (that's the source's spelling, not mine, we respect the typo)
(27)β theWRaccuracy check withZSTEMR('V', 'A'):
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
(28)β theWRaccuracy check withZSTEMR('V', 'I'):
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
Tests 29 through 34 are disable at present because ZSTEMR does not handle partial spectrum requests. π (again: source's wording, we stan accuracy)
(29)β| S - Z D Z* | / ( |S| n ulp )ZSTEMR('V', 'I')(30)β| I - ZZ* | / ( n ulp )ZSTEMR('V', 'I')(31)β the min/max match-up,ZSTEMR('N', 'I')vs.CSTEMR('V', 'I'):
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
(32)β| S - Z D Z* | / ( |S| n ulp )ZSTEMR('V', 'V')(33)β| I - ZZ* | / ( n ulp )ZSTEMR('V', 'V')(34)β the min/max match-up,ZSTEMR('N', 'V')vs.CSTEMR('V', 'V'):
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
(35)β| S - Z D Z* | / ( |S| n ulp )ZSTEMR('V', 'A')(36)β| I - ZZ* | / ( n ulp )ZSTEMR('V', 'A')(37)β the min/max match-up,ZSTEMR('N', 'A')vs.CSTEMR('V', 'A'):
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
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 π:
(1)β The zero matrix.(2)β The identity matrix.(3)β A diagonal matrix with evenly spaced entries1, ..., ULPand random signs. (ULP = (first number larger than 1) - 1)(4)β A diagonal matrix with geometrically spaced entries1, ..., ULPand random signs.(5)β A diagonal matrix with entries1, ULP, ..., ULPand random signs.(6)β Same as(4), but multiplied bySQRT( overflow threshold )(7)β Same as(4), but multiplied bySQRT( underflow threshold )(8)β A matrix of the formU* D U, whereUis unitary andDhas evenly spaced entries1, ..., ULPwith random signs on the diagonal.(9)β A matrix of the formU* D U, whereUis unitary andDhas geometrically spaced entries1, ..., ULPwith random signs on the diagonal.(10)β A matrix of the formU* D U, whereUis unitary andDhas entries1, ULP,..., ULPwith random signs on the diagonal.(11)β Same as(8), but multiplied bySQRT( overflow threshold )(12)β Same as(8), but multiplied bySQRT( underflow threshold )(13)β Hermitian matrix with random entries chosen from(-1,1).(14)β Same as(13), but multiplied bySQRT( overflow threshold )(15)β Same as(13), but multiplied bySQRT( underflow threshold )(16)β Same as(8), but diagonal elements are all positive.(17)β Same as(9), but diagonal elements are all positive.(18)β Same as(10), but diagonal elements are all positive.(19)β Same as(16), but multiplied bySQRT( overflow threshold )(20)β Same as(16), but multiplied bySQRT( underflow threshold )(21)β A diagonally dominant tridiagonal matrix with geometrically spaced diagonal entries1, ..., ULP.
β¨ Parameters β¨
NSIZESβNSIZESisINTEGER. It's the number of sizes of matrices to use. If it is zero,ZCHKSTdoes nothing. It must be at least zero.NNβNNisINTEGER array, dimension (NSIZES). An array containing the sizes to be used for the matrices. Zero values will be skipped. The values must be at least zero.NTYPESβNTYPESisINTEGER. The number of elements inDOTYPE. If it is zero,ZCHKSTdoes nothing. It must be at least zero. If it isMAXTYP+1andNSIZESis1, then an additional type,MAXTYP+1is defined, which is to use whatever matrix is inA. This is only useful ifDOTYPE(1:MAXTYP)is.FALSE.andDOTYPE(MAXTYP+1)is.TRUE..DOTYPEβ and yes bestie,DOTYPEgets her own whole moment, the description picks right back up on the next line of the source π«ΆDOTYPEβLOGICAL array, dimension (NTYPES). Bestie, this is your β¨to-do listβ¨ of matrix types: ifDOTYPE(j)is.TRUE., then for every size inNNa matrix of that size and of type j gets generated. IfNTYPESis smaller than the maximum number of types defined (PARAMETER MAXTYP), then typesNTYPES+1throughMAXTYPwill not be generated π. And ifNTYPESis larger thanMAXTYP, thenDOTYPE(MAXTYP+1)throughDOTYPE(NTYPES)just gets ignored. No cap, they simply don't matter.
ISEEDβINTEGER array, dimension (4). On entry,ISEEDspecifies the seed of the random number generator π±. The array elements should be between0and4095; if they're not, they get reducedmod 4096. Also β important, don't skip βISEED(4)must be odd. The random number generator uses a linear congruential sequence limited to small integers, so it should produce machine independent random numbers π. The values ofISEEDare changed on exit, and you can use them in the next call toZCHKSTto continue the exact same random number sequence. Continuity icon behavior, honestly.
THRESHβDOUBLE PRECISION. The vibe check threshold π¨. Fair warning, the source text here has a couple of blank spots in it, so here's the line as it literally reads:
A test will count as if the , computed as described above, exceeds THRESH.
What's not missing: the error is scaled to be O(1), so THRESH should be a reasonably small multiple of 1, e.g., 10 or 100 β¨. In particular, it should not depend on the precision (single vs. double) or the size of the matrix. And it must be at least zero, periodt.
NOUNITβINTEGER. The FORTRAN unit number for printing out error messages π β like, for example, if a routine returnsIINFOnot equal to0. That's where the drama gets reported.
AβCOMPLEX*16 array of dimension ( LDA , max(NN) ). Used to hold the matrix whose eigenvalues are to be computed π. On exit,Acontains the last matrix actually used β so she's not a memory, she's the moment.
LDAβINTEGER. The leading dimension ofA. It must be at least1and at leastmax( NN )π«Ά.
APβCOMPLEX*16 array of dimension( max(NN)*max(NN+1)/2 ). The matrixAstored in packed format. Compact queen π .
SDβDOUBLE PRECISION array of dimension( max(NN) ). The diagonal of the tridiagonal matrix computed byZHETRD. On exit,SDandSEcontain the tridiagonal form of the matrix inAβ¨.
SEβDOUBLE PRECISION array of dimension( max(NN) ). The off-diagonal of the tridiagonal matrix computed byZHETRD. On exit,SDandSEcontain the tridiagonal form of the matrix inAβ yes, same sentence energy, they're a matched set π.
D1βDOUBLE PRECISION array of dimension( max(NN) ). The eigenvalues ofA, as computed byZSTEQRsimultaneously withZπ₯. On exit, the eigenvalues inD1correspond with the matrix inA.
D2βDOUBLE PRECISION array of dimension( max(NN) ). The eigenvalues ofA, as computed byZSTEQRifZis not computed. On exit, the eigenvalues inD2correspond with the matrix inA. Same energy, different route πΈ.
D3βDOUBLE PRECISION array of dimension( max(NN) ). The eigenvalues ofA, as computed byDSTERF. On exit, the eigenvalues inD3correspond with the matrix inAπ¦.
D4βDOUBLE PRECISION array of dimension( max(NN) ). The eigenvalues ofA, as computed byZPTEQR(V).ZPTEQRfactorsSasZ4 D4 Z4*β. On exit, the eigenvalues inD4correspond with the matrix inA.
D5βDOUBLE PRECISION array of dimension( max(NN) ). The eigenvalues ofA, as computed byZPTEQR(N)whenZis not computed. On exit, the eigenvalues inD4correspond with the matrix inAβ and yes, the original really saysD4right there in theD5entry π. We're preserving it, not fixing it, that's the rule.
WA1βDOUBLE PRECISION array of dimension( max(NN) ). All eigenvalues ofA, computed to high absolute accuracy, with different range options, as computed byDSTEBZπ.
WA2βDOUBLE PRECISION array of dimension( max(NN) ). Selected eigenvalues ofA, computed to high absolute accuracy, with different range options, as computed byDSTEBZπ. Specifically: choose random values forILandIU, and ask for theIL-th throughIU-th eigenvalues.
WA3βDOUBLE PRECISION array of dimension( max(NN) ). Selected eigenvalues ofA, computed to high absolute accuracy, with different range options, as computed byDSTEBZπ. Specifically: determine the valuesVLandVUof theIL-th andIU-th eigenvalues and ask for all eigenvalues in this range.
WRβDOUBLE PRECISION array of dimension( max(NN) ). All eigenvalues ofA, computed to high absolute accuracy, with different options, as computed byDSTEBZπ.
UβCOMPLEX*16 array of dimension( LDU, max(NN) ). The unitary matrix computed byZHETRD + ZUNGTRπ .
LDUβINTEGER. The leading dimension ofU,Z, andVβ all three, one number, iconic efficiency π«Ά. It must be at least1and at leastmax( NN ).
VβCOMPLEX*16 array of dimension( LDU, max(NN) ). The Householder vectors computed byZHETRDin reducingAto tridiagonal form π§. The vectors computed withUPLO='U'are in the upper triangle, and the vectors computed withUPLO='L'are in the lower triangle. And here's the little lore drop, exactly as described inZHETRD: the sub- and superdiagonal are not set to1, even though the true Householder vector has a1in that position. The routines that useV, such asZUNGTR, set those entries to1before using them, and then restore them later. Respectful, honestly π.
VPβCOMPLEX*16 array of dimension( max(NN)*max(NN+1)/2 ). The matrixVstored in packed format π.
TAUβCOMPLEX*16 array of dimension( max(NN) ). The Householder factors computed byZHETRDin reducingAto tridiagonal form β¨.
ZβCOMPLEX*16 array of dimension( LDU, max(NN) ). The unitary matrix of eigenvectors computed byZSTEQR,ZPTEQR, andZSTEINπ₯.
WORKβCOMPLEX*16 array of dimension( LWORK ). Workspace, bestie. It works so you don't have to π.
LWORKβINTEGER. The number of entries inWORK. This must be at least:
1 + 4 * Nmax + 2 * Nmax * lg Nmax + 3 * Nmax**2
where Nmax = max( NN(j), 2 ) and lg = log base 2 π. Do the math, don't guess it.
IWORKβINTEGER array. Workspace πΈ.
LIWORKβINTEGER. The number of entries inIWORK. This must be at least:
6 + 6*Nmax + 5 * Nmax * lg Nmax
where Nmax = max( NN(j), 2 ) and lg = log base 2 β.
RWORKβDOUBLE PRECISION array. That's it, that's the whole description π.
LRWORKβINTEGER. The number of entries inLRWORK(the original saysdimension( ??? )and honestly, same π β that question mark trio is verbatim, we keep it).
RESULTβDOUBLE PRECISION array, dimension (26). The values computed by the tests described above π. These values are currently limited to1/ulp, to avoid overflow β safety first, always.
INFOβ π the source cuts off right here mid-entry, so this one's a cliffhanger.
INFO is INTEGER, bestie, and itβs literally the vibe report for the whole run:
- If
0, then everything ran OK. π -1:NSIZES < 0-2: SomeNN(j) < 0-3:NTYPES < 0-5:THRESH < 0-9:LDA < 1orLDA < NMAX, whereNMAXismax( NN(j) ).-23:LDU < 1orLDU < NMAX.-29:LWORKtoo small.
If ZLATMR, CLATMS, ZHETRD, ZUNGTR, ZSTEQR, DSTERF, or ZUNMC2 returns an error code, the absolute value of it is returned. Thatβs the rule, no cap. π«Ά
π§ Some Local Variables and Parameters π§
ZERO,ONEβ Real0and1.MAXTYPβ The number of types defined.NTESTβ The number of tests performed, or which can be performed so far, for the current matrix.NTESTTβ The total number of tests performed so far.NBLOCKβ Blocksize as returned byENVIR.NMAXβ Largest value inNN.NMATSβ The number of matrices generated so far.NERRSβ The number of tests which have exceededTHRESHso far.COND,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β Square roots of the previous 2 values.
The following four arrays decode JTYPE:
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) )
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 599 of file zchkst.f.
π«Ά Author
Generated automatically by Doxygen for LAPACK from the source code.
Final footer moment, because weβre cute like that: LAPACK Version 3.12.0 plus the original footerβs date/path stamp are waving goodbye from the bottom of the page β consider them mentioned, not copied, because we have aesthetic boundaries. π β¨π
π¦ 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