TESTING/EIG/schkst.f(3)
β¨ TESTING/EIG/schkst.f β¨
from the Library Functions Manual β okay so this is the full page vibe, bestie, and we are keeping every single detail π«Ά
πΈ NAME πΈ
TESTING/EIG/schkst.f β yes, that's the name, no cap π
π¦ SYNOPSIS π¦
β¨ Functions/Subroutines β¨
subroutine schkst (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, iwork, liwork, result, info)
SCHKST
SCHKST β that's the icon, the moment, the whole subroutine π
π Function/Subroutine Documentation π
subroutine schkst β full signature, character-for-character π
subroutine schkst (integer nsizes, integer, dimension( * ) nn, integer
ntypes, logical, dimension( * ) dotype, integer, dimension( 4 ) iseed,
real thresh, integer nounit, real, dimension( lda, * ) a, integer lda,
real, 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, real, dimension( ldu, * ) u, integer ldu, real,
dimension( ldu, * ) v, real, dimension( * ) vp, real, dimension( * )
tau, real, dimension( ldu, * ) z, real, dimension( * ) work, integer
lwork, integer, dimension( * ) iwork, integer liwork, real, dimension( *
) result, integer info)
SCHKST
Purpose π
okay so SCHKST checks the symmetric eigenvalue problem routines. she's giving main character energy for the whole test suite, fr fr.
SSYTRD factors A as U S U', where ' means transpose, S is symmetric tridiagonal, and U is orthogonal. SSYTRD can use either just the lower or just the upper triangle of A; SCHKST checks both cases. 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.
SSPTRD does the same as SSYTRD, except that A and V are stored in format.
SORGTR constructs the matrix U from the contents of V and TAU.
SOPGTR constructs the matrix U from the contents of VP and TAU.
SSTEQR factors S as Z D1 Z', where Z is the orthogonal 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.
SSTERF computes D3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors.
SPTEQR factors S as Z4 D4 Z4', for a symmetric positive definite tridiagonal matrix. D5 is the matrix of eigenvalues computed when Z is not computed.
SSTEBZ 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.
SSTEIN computes Y, the eigenvectors of S, given the eigenvalues.
SSTEDC factors S as Z D1 Z', where Z is the orthogonal matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal ('I' option). It may also update an input orthogonal matrix, usually the output from SSYTRD/SORGTR or SSPTRD/SOPGTR ('V' option). It may also just compute eigenvalues ('N' option).
SSTEMR factors S as Z D1 Z', where Z is the orthogonal matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal ('I' option). SSTEMR uses the Relatively Robust Representation whenever possible.
When SCHKST is called, a number of matrix sizes (NSIZES) and matrix types (NTYPES) are specified. For each size and each type of matrix, one matrix will be generated and used to test the symmetric eigenroutines. For each matrix, a number of tests will be performed:
(1)β| A - V S V' | / ( |A| n ulp )forSSYTRD( UPLO='U', ... )(2)β| I - UV' | / ( n ulp )forSORGTR( UPLO='U', ... )(3)β| A - V S V' | / ( |A| n ulp )forSSYTRD( UPLO='L', ... )(4)β| I - UV' | / ( n ulp )forSORGTR( UPLO='L', ... )(5-8)β Same as1-4, but forSSPTRDandSOPGTR.(9)β| S - Z D Z' | / ( |S| n ulp )forSSTEQR('V',...)(10)β| I - ZZ' | / ( n ulp )forSSTEQR('V',...)(11)β| D1 - D2 | / ( |D1| ulp )forSSTEQR('N',...)(12)β| D1 - D3 | / ( |D1| ulp )forSSTERF(13)β0if the true eigenvalues (computed by sturm count) ofSare withinTHRESHof those inD1.2*THRESHif they are not. (Tested usingSSTECH.)
For S positive definite:
(14)β| S - Z4 D4 Z4' | / ( |S| n ulp )forSPTEQR('V',...)(15)β| I - Z4 Z4' | / ( n ulp )forSPTEQR('V',...)(16)β| D4 - D5 | / ( 100 |D4| ulp )forSPTEQR('N',...)
When S is also diagonally dominant by the factor gamma < 1:
(17)βmax | D4(i) - WR(i) | / ( |D4(i)| omega )overi, whereomega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4, viaSSTEBZ( 'A', 'E', ...)(18)β| WA1 - D3 | / ( |D3| ulp )viaSSTEBZ( 'A', 'E', ...)(19)β( max { min | WA2(i)-WA3(j) | } + max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )overi,j, viaSSTEBZ( 'I', 'E', ...)(20)β| S - Y WA1 Y' | / ( |S| n ulp )viaSSTEBZ,SSTEIN(21)β| I - Y Y' | / ( n ulp )viaSSTEBZ,SSTEIN(22)β| S - Z D Z' | / ( |S| n ulp )viaSSTEDC('I')(23)β| I - ZZ' | / ( n ulp )viaSSTEDC('I')(24)β| S - Z D Z' | / ( |S| n ulp )viaSSTEDC('V')(25)β| I - ZZ' | / ( n ulp )viaSSTEDC('V')(26)β| D1 - D2 | / ( |D1| ulp )viaSSTEDC('V')andSSTEDC('N')
Test 27 is disabled at the moment because SSTEMR does not guarantee high relative accuracy.
(27)βmax | D6(i) - WR(i) | / ( |D6(i)| omega )overi, whereomega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4, viaSSTEMR('V', 'A')(28)βmax | D6(i) - WR(i) | / ( |D6(i)| omega )overi, whereomega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4, viaSSTEMR('V', 'I')
Tests 29 through 34 are disabled at present because SSTEMR does not handle partial spectrum requests.
(29)β| S - Z D Z' | / ( |S| n ulp )viaSSTEMR('V', 'I')(30)β| I - ZZ' | / ( n ulp )viaSSTEMR('V', 'I')(31)β( max { min | WA2(i)-WA3(j) | } + max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )overi,j, viaSSTEMR('N', 'I')vs.SSTEMR('V', 'I')(32)β| S - Z D Z' | / ( |S| n ulp )viaSSTEMR('V', 'V')(33)β| I - ZZ' | / ( n ulp )viaSSTEMR('V', 'V')(34)β( max { min | WA2(i)-WA3(j) | } + max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )overi,j, viaSSTEMR('N', 'V')vs.SSTEMR('V', 'V')(35)β| S - Z D Z' | / ( |S| n ulp )viaSSTEMR('V', 'A')(36)β| I - ZZ' | / ( n ulp )viaSSTEMR('V', 'A')(37)β( max { min | WA2(i)-WA3(j) | } + max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )overi,j, viaSSTEMR('N', 'A')vs.SSTEMR('V', 'A')
The sizes are specified by an array NN(1:NSIZES); the value of each element NN(j) specifies one size. The types are specified by a logical array DOTYPE( 1:NTYPES ); if DOTYPE(j) is .TRUE., then matrix type j 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 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 orthogonal andDhas evenly spaced entries1, ..., ULPwith random signs on the diagonal.(9)β A matrix of the formU' D U, whereUis orthogonal andDhas geometrically spaced entries1, ..., ULPwith random signs on the diagonal.(10)β A matrix of the formU' D U, whereUis orthogonal 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)β Symmetric 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β (the original page continues into the next part right here, bestie π )NSIZESβINTEGER. This is literally just how many matrix sizes you're gonna test. Bestie, if it's zero,SCHKSTdoes absolutely nothing β like, zero, nada, the routine just sits there π. Must be at least zero.NNβINTEGERarray,dimension (NSIZES). The actual sizes used for the matrices. Any zero values get skipped (they're not it, they get left on read π ), and every value has to be at least zero.NTYPESβINTEGER. The number of elements inDOTYPE. If it's zero,SCHKSTdoes nothing at all. Must be at least zero. And here's the β¨special caseβ¨: if it equalsMAXTYP+1andNSIZESis 1, then one extra type,MAXTYP+1, gets defined β and that type means "just use whatever matrix is already inA." This is only useful ifDOTYPE(1:MAXTYP)is.FALSE.andDOTYPE(MAXTYP+1)is.TRUE.. Super specific. iykyk.DOTYPEβLOGICALarray,dimension (NTYPES). IfDOTYPE(j)is.TRUE., then for every size inNNa matrix of that size and of typejgets generated. IfNTYPESis smaller than the max number of types defined (PARAMETER MAXTYP), then typesNTYPES+1throughMAXTYPwill not be generated. IfNTYPESis larger thanMAXTYP, thenDOTYPE(MAXTYP+1)throughDOTYPE(NTYPES)are simply ignored. F in the chat for the extra entries.ISEEDβINTEGERarray,dimension (4). On entry this is the seed for the random number generator. The elements should be between 0 and 4095 β if they're not, they get reduced mod 4096. AlsoISEED(4)must be odd (no cap, it's just the rule π«Ά). The generator uses a linear congruential sequence limited to small integers, so it should produce machine independent random numbers. The values ofISEEDget changed on exit, and you can pass them into the next call toSCHKSTto keep the same random number sequence going. Iconic continuity behaviour, honestly.THRESHβREAL. A test will count as failed if the error, computed as described above, exceedsTHRESH. Note that the error is scaled to beO(1), soTHRESHshould be a reasonably small multiple of 1 β like, say, 10 or 100. In particular it should not depend on the precision (single vs. double) or the size of the matrix. Must be at least zero. Keep it smol, bestie π.NOUNITβINTEGER. The FORTRAN unit number used for printing out error messages (e.g., if a routine returnsIINFOnot equal to 0). That's the gossip channel for when things go wrong π.AβREALarray ofdimension ( LDA, max(NN) ). Holds the matrix whose eigenvalues are to be computed. On exit,Acontains the last matrix actually used. Main character array, fr fr π.LDAβINTEGER. The leading dimension ofA. It must be at least 1 and at leastmax( NN ). Both. Yes, both. Slay.APβREALarray ofdimension( max(NN)*max(NN+1)/2 ). It's the matrixAstored in packed format. Compact queen π .SDβREALarray ofdimension( max(NN) ). The diagonal of the tridiagonal matrix computed bySSYTRD. On exit,SDandSEcontain the tridiagonal form of the matrix inA.SEβREALarray ofdimension( max(NN) ). The off-diagonal of the tridiagonal matrix computed bySSYTRD. On exit,SDandSEcontain the tridiagonal form of the matrix inA. Yeah, same line asSDβ they're a package deal π«Ά.D1βREALarray ofdimension( max(NN) ). The eigenvalues ofAas computed bySSTEQRsimultaneously withZ. On exit, the eigenvalues inD1correspond with the matrix inA.D2βREALarray ofdimension( max(NN) ). The eigenvalues ofAas computed bySSTEQRifZis not computed. On exit, the eigenvalues inD2correspond with the matrix inA.D3βREALarray ofdimension( max(NN) ). The eigenvalues ofAas computed bySSTERF. On exit, the eigenvalues inD3correspond with the matrix inA.D4βREALarray ofdimension( max(NN) ). The eigenvalues ofAas computed bySPTEQR(V).ZPTEQRfactorsSasZ4 D4 Z4*. On exit, the eigenvalues inD4correspond with the matrix inA.D5βREALarray ofdimension( max(NN) ). The eigenvalues ofAas computed bySPTEQR(N)whenZis not computed. On exit, the eigenvalues inD4correspond with the matrix inA. (Yep β the source saysD4there. Not us. We don't make the rules π.)WA1βREALarray ofdimension( max(NN) ). All eigenvalues ofA, computed to high absolute accuracy, with different range options β as computed bySSTEBZ.WA2βREALarray ofdimension( 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. Randomised, but make it accurate β¨.WA3βREALarray ofdimension( 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. Range-based queen π.WRβREALarray ofdimension( max(NN) ). All eigenvalues ofA, computed to high absolute accuracy, with different options β as computed bySSTEBZ.UβREALarray ofdimension( LDU, max(NN) ). The orthogonal matrix computed bySSYTRD+SORGTR.LDUβINTEGER. The leading dimension ofU,Z, andV. It must be at least 1 and at leastmax( NN ). Three arrays, one leading dimension β efficiency at its finest π .VβREALarray ofdimension( LDU, max(NN) ). The Householder vectors computed bySSYTRDin 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 inSSYTRD, the sub- and superdiagonal are not set to 1, although the true Householder vector has a 1 in that position. The routines that useV, such asSORGTR, set those entries to 1 before using them, and then restore them later. So polite, honestly π.)VPβREALarray ofdimension( max(NN)*max(NN+1)/2 ). The matrixVstored in packed format. Same energy, smaller footprint.TAUβREALarray ofdimension( max(NN) ). The Householder factors computed bySSYTRDin reducingAto tridiagonal form.ZβREALarray ofdimension( LDU, max(NN) ). The orthogonal matrix of eigenvectors computed bySSTEQR,SPTEQR, andSSTEIN.WORKβREALarray ofdimension( LWORK ). Workspace. That's it. That's the description π«Ά.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 not skimp on this one, bestie β it's not a vibe check, it's a hard requirement π.
IWORKβINTEGERarray, Workspace. The integer-flavoured workspace, obviously.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. Same deal, same love π.
RESULTβREALarray,dimension (26). The values computed by the tests described above. The values are currently limited to1/ulp, to avoid overflow. Twenty-six slots of pure test output β a whole mood board π.INFOβINFOisINTEGERβ the runβs main-character report card π
If itβs 0, then everything ran OK. If itβs negative, itβs clocking what went wrong:
-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.
And if SLATMR, SLATMS, SSYTRD, SORGTR, SSTEQR, SSTERF, or SORMC2 returns an error code, the absolute value of it is returned. Not me taking the absolute value so the sign drama doesnβt leak π
π§ Some Local Variables and Parameters π§
ZERO,ONEβ Real0and1. iconic basics.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 587 of file schkst.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
Thatβs the page, bestie: LAPACK Version 3.12.0, source TESTING/EIG/schkst.f(3), with the footerβs date/version stamp doing its little generated-manpage thing ππ¦
π¦ 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