CCHKST(3)
π CCHKST(3) β Library Functions Manual π
bestie, the manual name is Library Functions Manual, and the short header path is /home/abui...IG/cchkst.f(3). buckle up, this is the test-driver page and it is long.
πΈ NAME πΈ
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/cchkst.f
β¨ SYNOPSIS β¨
π Functions/Subroutines π
subroutine CCHKST (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)
CCHKST
CCHKST is the subroutine name. iconic, no notes.
π«Ά Function/Subroutine Documentation π«Ά
hereβs the full typed signature, exactly as the page gives it:
subroutine CCHKST (integer nsizes, integer, dimension( * ) nn, integer
ntypes, logical, dimension( * ) dotype, integer, dimension( 4 ) iseed,
real thresh, integer nounit, complex, dimension( lda, * ) a, integer
lda, complex, dimension( * ) ap, real, dimension( * ) sd, real,
dimension( * ) se, real, dimension( * ) d1, real, dimension( * ) d2,
real, dimension( * ) d3, real, dimension( * ) d4, real, dimension( * )
d5, real, dimension( * ) wa1, real, dimension( * ) wa2, real, dimension(
* ) wa3, real, dimension( * ) wr, complex, dimension( ldu, * ) u,
integer ldu, complex, dimension( ldu, * ) v, complex, dimension( * ) vp,
complex, dimension( * ) tau, complex, dimension( ldu, * ) z, complex,
dimension( * ) work, integer lwork, real, dimension( * ) rwork, integer
lrwork, integer, dimension( * ) iwork, integer liwork, real, dimension(
* ) result, integer info)
CCHKST
π Purpose π
okay so CCHKST checks the Hermitian eigenvalue problem routines. hereβs the whole vibe, routine by routine:
CCHKSTchecks the Hermitian eigenvalue problem routines.CHETRDfactors A asU S U*, where*means conjugate transpose, S is real symmetric tridiagonal, and U is unitary.CHETRDcan use either just the lower or just the upper triangle of A;CCHKSTchecks both cases.- U is represented as a product of Householder transformations, whose vectors are stored in the first
n-1columns of V, and whose scale factors are inTAU. CHPTRDdoes the same asCHETRD, except that A and V are stored in format.CUNGTRconstructs the matrix U from the contents of V andTAU.CUPGTRconstructs the matrix U from the contents of VP andTAU.CSTEQRfactors S asZ D1 Z*, where Z is the unitary matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal.D2is the matrix of eigenvalues computed when Z is not computed.SSTERFcomputesD3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors.CPTEQRfactors S asZ4 D4 Z4*, for a Hermitian positive definite tridiagonal matrix.D5is the matrix of eigenvalues computed when Z is not computed.SSTEBZcomputes selected eigenvalues.WA1,WA2, andWA3will denote eigenvalues computed to high absolute accuracy, with different range options.WRwill denote eigenvalues computed to high relative accuracy.CSTEINcomputes Y, the eigenvectors of S, given the eigenvalues.CSTEDCfactors S asZ D1 Z*, where Z is the unitary matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal ('I'option). It may also update an input unitary matrix, usually the output fromCHETRD/CUNGTRorCHPTRD/CUPGTR('V'option). It may also just compute eigenvalues ('N'option).CSTEMRfactors S asZ D1 Z*, where Z is the unitary matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal ('I'option).CSTEMRuses the Relatively Robust Representation whenever possible.
when CCHKST 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:
- (1)
| A - V S V* | / ( |A| n ulp )βCHETRD( UPLO='U', ... ) - (2)
| I - UV* | / ( n ulp )βCUNGTR( UPLO='U', ... ) - (3)
| A - V S V* | / ( |A| n ulp )βCHETRD( UPLO='L', ... ) - (4)
| I - UV* | / ( n ulp )βCUNGTR( UPLO='L', ... ) - (5-8) Same as 1-4, but for
CHPTRDandCUPGTR. - (9)
| S - Z D Z* | / ( |S| n ulp )βCSTEQR('V',...) - (10)
| I - ZZ* | / ( n ulp )βCSTEQR('V',...) - (11)
| D1 - D2 | / ( |D1| ulp )βCSTEQR('N',...) - (12)
| D1 - D3 | / ( |D1| ulp )βSSTERF - (13)
0if the true eigenvalues (computed by sturm count) of S are withinTHRESHof those inD1.2*THRESHif they are not. (Tested usingSSTECH)
For S positive definite,
- (14)
| S - Z4 D4 Z4* | / ( |S| n ulp )βCPTEQR('V',...) - (15)
| I - Z4 Z4* | / ( n ulp )βCPTEQR('V',...) - (16)
| D4 - D5 | / ( 100 |D4| ulp )βCPTEQR('N',...)
When S is also diagonally dominant by the factor gamma < 1,
- (17)
max | D4(i) - WR(i) | / ( |D4(i)| omega ) ,overi;omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4βSSTEBZ( 'A', 'E', ... ) - (18)
| WA1 - D3 | / ( |D3| ulp )βSSTEBZ( 'A', 'E', ... ) - (19) hereβs the min/max situation:
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
and the routine is SSTEBZ( 'I', 'E', ... ).
- (20)
| S - Y WA1 Y* | / ( |S| n ulp )βSSTEBZ,CSTEIN - (21)
| I - Y Y* | / ( n ulp )βSSTEBZ,CSTEIN - (22)
| S - Z D Z* | / ( |S| n ulp )βCSTEDC('I') - (23)
| I - ZZ* | / ( n ulp )βCSTEDC('I') - (24)
| S - Z D Z* | / ( |S| n ulp )βCSTEDC('V') - (25)
| I - ZZ* | / ( n ulp )βCSTEDC('V') - (26)
| D1 - D2 | / ( |D1| ulp )βCSTEDC('V')andCSTEDC('N')
Test 27 is disabled at the moment because CSTEMR does not guarantee high relatvie accuracy.
- (27)
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,overi;omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4βCSTEMR('V', 'A') - (28)
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,overi;omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4βCSTEMR('V', 'I')
Tests 29 through 34 are disable at present because CSTEMR does not handle partial spectrum requests.
- (29)
| S - Z D Z* | / ( |S| n ulp )βCSTEMR('V', 'I') - (30)
| I - ZZ* | / ( n ulp )βCSTEMR('V', 'I') - (31) the same min/max formula:
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
and itβs CSTEMR('N', 'I') vs. CSTEMR('V', 'I').
- (32)
| S - Z D Z* | / ( |S| n ulp )βCSTEMR('V', 'V') - (33)
| I - ZZ* | / ( n ulp )βCSTEMR('V', 'V') - (34) the same min/max formula:
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
and itβs CSTEMR('N', 'V') vs. CSTEMR('V', 'V').
- (35)
| S - Z D Z* | / ( |S| n ulp )βCSTEMR('V', 'A') - (36)
| I - ZZ* | / ( n ulp )βCSTEMR('V', 'A') - (37) the same min/max formula:
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
and itβs CSTEMR('N', 'A') vs. CSTEMR('V', 'A').
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:
- (1) The zero matrix.
- (2) The identity matrix.
- (3) A diagonal matrix with evenly spaced entries
1, ..., ULPand random signs. (ULP = (first number larger than 1) - 1) - (4) A diagonal matrix with geometrically spaced entries
1, ..., ULPand random signs. - (5) A diagonal matrix with entries
1, ULP, ..., ULPand random signs. - (6) Same as (4), but multiplied by
SQRT( overflow threshold ) - (7) Same as (4), but multiplied by
SQRT( underflow threshold ) - (8) A matrix of the form
U* D U, where U is unitary and D has evenly spaced entries1, ..., ULPwith random signs on the diagonal. - (9) A matrix of the form
U* D U, where U is unitary and D has geometrically spaced entries1, ..., ULPwith random signs on the diagonal. - (10) A matrix of the form
U* D U, where U is unitary and D has entries1, ULP,..., ULPwith random signs on the diagonal. - (11) Same as (8), but multiplied by
SQRT( overflow threshold ) - (12) Same as (8), but multiplied by
SQRT( underflow threshold ) - (13) Hermitian matrix with random entries chosen from
(-1,1). - (14) Same as (13), but multiplied by
SQRT( overflow threshold ) - (15) Same as (13), but multiplied by
SQRT( 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 by
SQRT( overflow threshold ) - (20) Same as (16), but multiplied by
SQRT( underflow threshold ) - (21) A diagonally dominant tridiagonal matrix with geometrically spaced diagonal entries
1, ..., ULP.
β¨ Parameters β¨
Okay bestie, this is the big one β every single arg that CCHKST takes, and there are so many. Buckle in π
NSIZESβNSIZESisINTEGER. It's the number of sizes of matrices to use. If it's zero,CCHKSTdoes literally nothing (slay, a no-op). It must be at least zero.NNβNNisINTEGERarray, dimension(NSIZES). It's the array holding the sizes used for the matrices. Zero values get skipped, no cap. And the values must be at least zero.NTYPESβNTYPESisINTEGER. It's the number of elements inDOTYPE. If it's zero,CCHKSTdoes nothing at all, periodt. It must be at least zero. But here's the cute special case: if it'sMAXTYP+1andNSIZESis1, then an extra type,MAXTYP+1, is defined β and that type means "just use whatever matrix is already inA". It's only useful whenDOTYPE(1:MAXTYP)is.FALSE.andDOTYPE(MAXTYP+1)is.TRUE..DOTYPEβDOTYPEisLOGICALarray, dimension(NTYPES). IfDOTYPE(j)is.TRUE., then for each size inNNa matrix of that size and of typejgets 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)get straight-up ignored π.ISEEDβISEEDisINTEGERarray, dimension(4). On entry,ISEEDspecifies the seed of the random number generator. The array elements should be between0and4095; if they're not, they'll be reducedmod 4096. Also β important βISEED(4)must be odd. The generator uses a linear congruential sequence limited to small integers, so it should produce machine independent random numbers (iconic). The values ofISEEDare changed on exit, and you can use them in the next call toCCHKSTto continue the same random number sequence π.THRESHβTHRESHisREAL. A test will count as β¦ if the β¦ computed as described above exceedsTHRESH(the original text has blanks right there, so we're keeping it mysterious π). Note that the error is scaled to beO(1), soTHRESHshould be a reasonably small multiple of 1, 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.NOUNITβNOUNITisINTEGER. It's the FORTRAN unit number for printing out error messages (like, if a routine returnsIINFOnot equal to0).AβAisCOMPLEXarray of dimension( LDA , max(NN) ). It holds the matrix whose eigenvalues are to be computed. On exit,Acontains the last matrix actually used.LDAβLDAisINTEGER. It's the leading dimension ofA. Must be at least1and at leastmax( NN ).APβAPisCOMPLEXarray of dimension( max(NN)*max(NN+1)/2 ). It's the matrixAstored in packed format.SDβSDisREALarray of dimension( max(NN) ). It's the diagonal of the tridiagonal matrix computed byCHETRD. On exit,SDandSEcontain the tridiagonal form of the matrix inA.SEβSEisREALarray of dimension( max(NN) ). It's the off-diagonal of the tridiagonal matrix computed byCHETRD. On exit,SDandSEcontain the tridiagonal form of the matrix inA(yes, they're a matching set, we love a duo π«Ά).D1βD1isREALarray of dimension( max(NN) ). These are the eigenvalues ofA, as computed byCSTEQRsimultaneously withZ. On exit, the eigenvalues inD1correspond with the matrix inA.D2βD2isREALarray of dimension( max(NN) ). The eigenvalues ofA, as computed byCSTEQRifZis not computed. On exit, the eigenvalues inD2correspond with the matrix inA.D3βD3isREALarray of dimension( max(NN) ). The eigenvalues ofA, as computed bySSTERF. On exit, the eigenvalues inD3correspond with the matrix inA.D4βD4isREALarray of dimension( max(NN) ). The eigenvalues ofA, as computed byCPTEQR(V).ZPTEQRfactorsSasZ4 D4 Z4*. On exit, the eigenvalues inD4correspond with the matrix inA.D5βD5isREALarray of dimension( max(NN) ). The eigenvalues ofA, as computed byZPTEQR(N)whenZis not computed. On exit, the eigenvalues inD4correspond with the matrix inA(bestie, the original really does sayD4here β not a typo I'm fixing, I promise π).WA1βWA1isREALarray of dimension( max(NN) ). All eigenvalues ofA, computed to high absolute accuracy, with different range options, as computed bySSTEBZ.WA2βWA2isREALarray of dimension( max(NN) ). Selected eigenvalues ofA, computed to high absolute accuracy, with different range options, as computed bySSTEBZ. Choose random values forILandIU, and ask for theIL-th throughIU-th eigenvalues π―.WA3βWA3isREALarray of dimension( max(NN) ). Selected eigenvalues ofA, computed to high absolute accuracy, with different range options, as computed bySSTEBZ. Determine the valuesVLandVUof theIL-th andIU-th eigenvalues, and ask for all eigenvalues in this range.WRβWRisDOUBLE PRECISIONarray of dimension( max(NN) ). All eigenvalues ofA, computed to high absolute accuracy, with different options, as computed byDSTEBZ.UβUisCOMPLEXarray of dimension( LDU, max(NN) ). It's the unitary matrix computed byCHETRD + CUNGTRβ¨.LDUβLDUisINTEGER. The leading dimension ofU,Z, andV. It must be at least1and at leastmax( NN ).VβVisCOMPLEXarray of dimension( LDU, max(NN) ). The Householder vectors computed byCHETRDin reducingAto tridiagonal form. The vectors computed withUPLO='U'are in the upper triangle, and the vectors computed withUPLO='L'are in the lower triangle. (As described inCHETRD, the sub- and superdiagonal are not set to1, even though the true Householder vector has a1in that position. The routines that useV, such asCUNGTR, set those entries to1before using them, and then restore them later. Little sneak-and-restore moment, iykyk π§)VPβVPisCOMPLEXarray of dimension( max(NN)*max(NN+1)/2 ). It's the matrixVstored in packed format.TAUβTAUisCOMPLEXarray of dimension( max(NN) ). The Householder factors computed byCHETRDin reducingAto tridiagonal form.ZβZisCOMPLEXarray of dimension( LDU, max(NN) ). The unitary matrix of eigenvectors computed byCSTEQR,CPTEQR, andCSTEINπ.WORKβWORKisCOMPLEXarray of dimension( LWORK ).LWORKβLWORKisINTEGER. 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.
IWORKβIWORKisINTEGERarray. Workspace. That's it, that's the description π«‘.LIWORKβLIWORKisINTEGER. 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βRWORKisREALarray.LRWORKβLRWORKisINTEGER. The number of entries inLRWORK(dimension( ??? )β the original literally leaves it as???, we stan an honest manpage π).RESULTβRESULTisREALarray, dimension(26). The values computed by the tests described above. The values are currently limited to1/ulp, to avoid overflow β οΈ.INFOβ and we're cutting off right at theINFOarg, bestie β the rest of it rolls into the next part π
okay so INFO is an INTEGER, and here's the whole vibe check on what its values mean β bestie, write these down π
0β everything ran OK, we love a clean run β¨-1βNSIZES < 0(not it π)-2β someNN(j) < 0-3βNTYPES < 0-5βTHRESH < 0-9βLDA < 1orLDA < NMAX, whereNMAXismax( NN(j) )β literally the max, no cap-23βLDU < 1orLDU < NMAX-29βLWORKtoo small, tragic
and if CLATMR, CLATMS, CHETRD, CUNGTR, CSTEQR, SSTERF, or CUNMC2 returns an error code, the absolute value of it is returned β so it comes back positive, iykyk.
π Some Local Variables and Parameters π
okay these are the supporting cast, and they all matter:
ZERO,ONEβ real0and1, the basics πMAXTYPβ the number of types definedNTESTβ the number of tests performed, or which can be performed so far, for the current matrixNTESTTβ the total number of tests performed so farNBLOCKβ blocksize as returned byENVIRNMAXβ largest value inNNNMATSβ the number of matrices generated so farNERRSβ the number of tests which have exceededTHRESHso farCOND,IMODEβ values to be passed to the matrix generatorsANORMβ norm ofA; passed to matrix generatorsOVFL,UNFLβ overflow and underflow thresholdsULP,ULPINVβ finest relative precision and its inverseRTOVFL,RTUNFLβ square roots of the previous 2 values
the following four arrays decode JTYPE (yes it says four, but only three are listed β we don't ask questions, we just vibe):
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 cchkst.f. β periodt.
π Author (Doxygen's version) π
Generated automatically by Doxygen for LAPACK from the source code. main character energy, honestly.
that's the whole page, bestie π«Ά this iconic manual is from LAPACK Version 3.12.0, source file /home/abui...IG/cchkst.f(3) β slay and goodbye π
β¨
π¦ 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