SCHKST2STG(3)
π SCHKST2STG(3) β the manual page, but make it make sense
Okay bestie, so this one lives in section 3 of the Library Functions Manual β you know, the C/functions corner of manpage land. π«Ά And the actual manual name is folded in right here: chkst2stg.f(3). That's the header, we're not doing the whole "three slashes and a path" thing at the top, iykyk.
β¨ NAME β¨
The name of this thing is literally just this absolute unit of a file path:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/schkst2stg.f
Like... yes, that's the whole NAME section. It's giving "I was generated by a documentation tool and nobody stopped me." π But no cap, that path is the name and we respect it. Note the TESTING/EIG in there and the lapack-static-3.12.0-build / lapack-3.12.0 bits β those are part of the string, don't be editing them. π
π¦ SYNOPSIS π¦
Functions/Subroutines
There's exactly one subroutine chilling in here, and its name is SCHKST2STG:
subroutine SCHKST2STG (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)
That's it. That's the synopsis. Thirty-four arguments and not a single one of them is optional, which is honestly so on brand for Fortran. π
π FUNCTION/SUBROUTINE DOCUMENTATION π
πΈ subroutine SCHKST2STG πΈ
Here's the full declaration in all its glory β every type, every dimension( * ), every single character preserved exactly, because we do not play fast and loose with a signature around here:
subroutine SCHKST2STG (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)
SCHKST2STG β say it with your chest. π£οΈ
A little vibe check on what you're looking at, purely from what's declared up there, no guessing: you've got four integer scalars that are not arrays (nsizes, ntypes, nounit, lwork... and also lda, ldu, liwork, info β okay, more than four, my bad, there's a lot of integers bestie π), a whole parade of real scalars (thresh), a bunch of real arrays with assumed size dimension( * ), some 2-D-ish ones with leading dimensions dimension( lda, * ) and dimension( ldu, * ), one lonely logical, dimension( * ) array called dotype, one integer, dimension( 4 ) array called iseed β size four, locked in, don't @ me β and a bunch of real workspace-looking arrays (wa1, wa2, wa3, work, result, and friends) plus integer ones (iwork).
Heads up: this is part one of four, so we are not done. Don't go anywhere. π§
π₯ Purpose: π₯
(to be continued in part 2 β the purpose section is up next and we are seated π)
okay so bestie, the whole point of SCHKST2STG is checking the symmetric eigenvalue problem routines when youβre using the 2-stage reduction techniques π
. Since the generation of Q or the vectors is not available in this release, we only compare the eigenvalue resulting when using the 2-stage to the one considered as reference using the standard 1-stage reduction SSYTRD. For that, we call the standard SSYTRD and compute D1 using SSTEQR, then we call the 2-stage SSYTRD_2STAGE with Upper and Lower and we compute D2 and D3 using SSTEQR, and then we replaced tests 3 and 4 by tests 11 and 12. test 1 and 2 remain to verify that the 1-stage results are OK and can be trusted. This testing routine will converge to the SCHKST in the next release when vectors and generation of Q will be implemented. β¨
hereβs the cast of routines, because the lore matters π«Ά
SSYTRDfactorsAasU S U', where'means transpose,Sis symmetric tridiagonal, andUis orthogonal.SSYTRDcan use either just the lower or just the upper triangle ofA;SCHKST2STGchecks both cases.Uis represented as a product of Householder transformations, whose vectors are stored in the firstn-1columns ofV, and whose scale factors are inTAU.SSPTRDdoes the same asSSYTRD, except thatAandVare stored in format.SORGTRconstructs the matrixUfrom the contents ofVandTAU.SOPGTRconstructs the matrixUfrom the contents ofVPandTAU.SSTEQRfactorsSasZ D1 Z', whereZis the orthogonal matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal.D2is the matrix of eigenvalues computed whenZis not computed.SSTERFcomputesD3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors.SPTEQRfactorsSasZ4 D4 Z4', for a symmetric positive definite tridiagonal matrix.D5is the matrix of eigenvalues computed whenZis 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.SSTEINcomputesY, the eigenvectors ofS, given the eigenvalues.SSTEDCfactorsSasZ D1 Z', whereZis the orthogonal matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal ('I'option). It may also update an input orthogonal matrix, usually the output fromSSYTRD/SORGTRorSSPTRD/SOPGTR('V'option). It may also just compute eigenvalues ('N'option).SSTEMRfactorsSasZ D1 Z', whereZis the orthogonal matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal ('I'option).SSTEMRuses the Relatively Robust Representation whenever possible.
When SCHKST2STG 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 symmetric eigenroutines. For each matrix, a number of tests will be performed:
the test lineup, no skips π₯
- Test (1) β
| A - V S V' | / ( |A| n ulp )withSSYTRD( UPLO='U', ... ). - Test (2) β
| I - UV' | / ( n ulp )withSORGTR( UPLO='U', ... ). - Test (3) β originally
| A - V S V' | / ( |A| n ulp )withSSYTRD( UPLO='L', ... ), but itβs replaced by| D1 - D2 | / ( |D1| ulp ), whereD1is the eigenvalue matrix computed usingSandD2is the eigenvalue matrix computed usingS_2stagethe output ofSSYTRD_2STAGE(, ,....).D1andD2are computed viaSSTEQR('N',...). - Test (4) β originally
| I - UV' | / ( n ulp )withSORGTR( UPLO='L', ... ), but itβs replaced by| D1 - D3 | / ( |D1| ulp ), whereD1is the eigenvalue matrix computed usingSandD3is the eigenvalue matrix computed usingS_2stagethe output ofSSYTRD_2STAGE(, ,....).D1andD3are computed viaSSTEQR('N',...). - Tests (5-8) β same as 1-4, but for
SSPTRDandSOPGTR. - Test (9) β
| S - Z D Z' | / ( |S| n ulp )withSSTEQR('V',...). - Test (10) β
| I - ZZ' | / ( n ulp )withSSTEQR('V',...). - Test (11) β
| D1 - D2 | / ( |D1| ulp )withSSTEQR('N',...). - Test (12) β
| D1 - D3 | / ( |D1| ulp )withSSTERF. - Test (13) β
0if the true eigenvalues (computed by sturm count) ofSare withinTHRESHof those inD1.2*THRESHif they are not. (Tested usingSSTECH)
For S positive definite,
- Test (14) β
| S - Z4 D4 Z4' | / ( |S| n ulp )withSPTEQR('V',...). - Test (15) β
| I - Z4 Z4' | / ( n ulp )withSPTEQR('V',...). - Test (16) β
| D4 - D5 | / ( 100 |D4| ulp )withSPTEQR('N',...).
When S is also diagonally dominant by the factor gamma < 1,
- Test (17) β
max | D4(i) - WR(i) | / ( |D4(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
SSTEBZ( 'A', 'E', ...)
- Test (18) β
| WA1 - D3 | / ( |D3| ulp )withSSTEBZ( 'A', 'E', ...). - Test (19) β
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
SSTEBZ( 'I', 'E', ...)
- Test (20) β
| S - Y WA1 Y' | / ( |S| n ulp )withSSTEBZ,SSTEIN. - Test (21) β
| I - Y Y' | / ( n ulp )withSSTEBZ,SSTEIN. - Test (22) β
| S - Z D Z' | / ( |S| n ulp )withSSTEDC('I'). - Test (23) β
| I - ZZ' | / ( n ulp )withSSTEDC('I'). - Test (24) β
| S - Z D Z' | / ( |S| n ulp )withSSTEDC('V'). - Test (25) β
| I - ZZ' | / ( n ulp )withSSTEDC('V'). - Test (26) β
| D1 - D2 | / ( |D1| ulp )withSSTEDC('V')andSSTEDC('N').
Test 27 is disabled at the moment because SSTEMR does not guarantee high relatvie accuracy.
- Test (27) β
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
SSTEMR('V', 'A')
- Test (28) β
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
SSTEMR('V', 'I')
Tests 29 through 34 are disable at present because SSTEMR does not handle partial spectrum requests.
- Test (29) β
| S - Z D Z' | / ( |S| n ulp )withSSTEMR('V', 'I'). - Test (30) β
| I - ZZ' | / ( n ulp )withSSTEMR('V', 'I'). - Test (31) β
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
SSTEMR('N', 'I') vs. SSTEMR('V', 'I')
- Test (32) β
| S - Z D Z' | / ( |S| n ulp )withSSTEMR('V', 'V'). - Test (33) β
| I - ZZ' | / ( n ulp )withSSTEMR('V', 'V'). - Test (34) β
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
SSTEMR('N', 'V') vs. SSTEMR('V', 'V')
- Test (35) β
| S - Z D Z' | / ( |S| n ulp )withSSTEMR('V', 'A'). - Test (36) β
| I - ZZ' | / ( n ulp )withSSTEMR('V', 'A'). - Test (37) β
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
SSTEMR('N', 'A') vs. SSTEMR('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, whereUis orthogonal andDhas evenly spaced entries1, ..., ULPwith random signs on the diagonal. - (9) β a matrix of the form
U' D U, whereUis orthogonal andDhas geometrically spaced entries1, ..., ULPwith random signs on the diagonal. - (10) β a matrix of the form
U' D U, whereUis orthogonal andDhas 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) β symmetric 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 parameter list and itβs a whole buffet. every single one is here, no skips, no cap. π
NSIZESβNSIZESisINTEGER. itβs the number of sizes of matrices to use. if it is zero,SCHKST2STGdoes 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,SCHKST2STGdoes nothing. it must be at least zero. if it isMAXTYP+1andNSIZESis1, then an additional type,MAXTYP+1, is defined, which is to use whatever matrix is inA. this is only useful ifDOTYPE(1:MAXTYP)is.FALSE.andDOTYPE(MAXTYP+1)is.TRUE.. π¦DOTYPEβDOTYPEisLOGICAL array, dimension (NTYPES). ifDOTYPE(j)is.TRUE., then for each size inNNa matrix of that size and of typejwill be generated. ifNTYPESis smaller than the maximum number of types defined (PARAMETER MAXTYP), then typesNTYPES+1throughMAXTYPwill not be generated. ifNTYPESis larger thanMAXTYP,DOTYPE(MAXTYP+1)throughDOTYPE(NTYPES)will be ignored. πΈISEEDβISEEDisINTEGER array, dimension (4). on entryISEEDspecifies the seed of the random number generator. the array elements should be between0and4095; if not they will be reduced mod4096. also,ISEED(4)must be odd. the random number generator uses a linear congruential sequence limited to small integers, and so should produce machine independent random numbers. the values ofISEEDare changed on exit, and can be used in the next call toSCHKST2STGto continue the same random number sequence. π₯THRESHβTHRESHisREAL. the source literally says βa test will count as if the , computed as described above, exceedsTHRESHβ β blanks and all β so iβm not filling them in. note that the error is scaled to beO(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. πNOUNITβNOUNITisINTEGER. theFORTRANunit number for printing out error messages (e.g., if a routine returnsIINFOnot equal to0.) πAβAis aREALarray of dimension( LDA , max(NN) ). used to hold the matrix whose eigenvalues are to be computed. on exit,Acontains the last matrix actually used. πLDAβLDAisINTEGER. the leading dimension ofA. it must be at least1and at leastmax( NN ). βAPβAPis aREALarray of dimension( max(NN)*max(NN+1)/2 ). the matrixAstored in packed format. πSDβSDis aREALarray of dimension( max(NN) ). the diagonal of the tridiagonal matrix computed bySSYTRD. on exit,SDandSEcontain the tridiagonal form of the matrix inA. πSEβSEis aREALarray of dimension( max(NN) ). the off-diagonal of the tridiagonal matrix computed bySSYTRD. on exit,SDandSEcontain the tridiagonal form of the matrix inA. π§D1βD1is aREALarray of dimension( max(NN) ). the eigenvalues ofA, as computed bySSTEQRsimultaneously withZ. on exit, the eigenvalues inD1correspond with the matrix inA. β¨D2βD2is aREALarray of dimension( max(NN) ). the eigenvalues ofA, as computed bySSTEQRifZis not computed. on exit, the eigenvalues inD2correspond with the matrix inA. πD3βD3is aREALarray of dimension( max(NN) ). the eigenvalues ofA, as computed bySSTERF. on exit, the eigenvalues inD3correspond with the matrix inA. π¦D4βD4is aREALarray of dimension( max(NN) ). the eigenvalues ofA, as computed bySPTEQR(V).SPTEQRfactorsSasZ4 D4 Z4*. on exit, the eigenvalues inD4correspond with the matrix inA. πΈD5βD5is aREALarray of dimension( max(NN) ). the eigenvalues ofA, as computed bySPTEQR(N)whenZis not computed. on exit, the eigenvalues inD4correspond with the matrix inA. yes, it really saysD4there β keeping it exactly as written. πWA1βWA1is aREALarray of dimension( max(NN) ). all eigenvalues ofA, computed to high absolute accuracy, with different range options. as computed bySSTEBZ. π₯WA2βWA2is aREALarray 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βWA3is aREALarray 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βWRis aREALarray of dimension( max(NN) ). all eigenvalues ofA, computed to high absolute accuracy, with different options. as computed bySSTEBZ. πUβUis aREALarray of dimension( LDU, max(NN) ). the orthogonal matrix computed bySSYTRD + SORGTR. βLDUβLDUisINTEGER. the leading dimension ofU,Z, andV. it must be at least1and at leastmax( NN ). πVβVis aREALarray of dimension( LDU, max(NN) ). the Housholder 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 to1, although the true Householder vector has a1in that position. the routines that useV, such asSORGTR, set those entries to1before using them, and then restore them later.) πVPβVPis aREALarray of dimension( max(NN)*max(NN+1)/2 ). the matrixVstored in packed format. π§TAUβTAUis aREALarray of dimension( max(NN) ). the Householder factors computed bySSYTRDin reducingAto tridiagonal form. β¨ZβZis aREALarray of dimension( LDU, max(NN) ). the orthogonal matrix of eigenvectors computed bySSTEQR,SPTEQR, andSSTEIN. πWORKβWORKis aREALarray of dimension( LWORK ). π¦LWORKβLWORKisINTEGER. the number of entries inWORK. this must be at least1 + 4 * Nmax + 2 * Nmax * lg Nmax + 3 * Nmax**2whereNmax = max( NN(j), 2 )andlg = log base 2. πΈIWORKβIWORKisINTEGER array. workspace. π₯LIWORKβLIWORKisINTEGER. the number of entries inIWORK. this must be at least6 + 6*Nmax + 5 * Nmax * lg NmaxwhereNmax = max( NN(j), 2 )andlg = log base 2. πRESULTβRESULTis aREALarray, dimension(26). the values computed by the tests described above. the values are currently limited to1/ulp, to avoid overflow. πINFOβ okay the source just listsINFOhere and then gives no description, so weβre not inventing one. π
INFO is INTEGER, bestie, and it's basically the whole run's vibe check:
0β everything ran OK β¨ (the dream, we love to see it)-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. Slay, but like, an error is still an error π
π§ Some Local Variables and Parameters π§
okay this is the backstage cast list, the supporting characters that carry the whole plot:
ZERO,ONEβ real 0 and 1. 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 608 of file schkst2stg.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code. no cap, the robots wrote this part π€π
and that's a wrap on SCHKST2STG(3)!! π«Ά this absolute unit of a page came straight from /home/abui...chkst2stg.f(3) and it's serving LAPACK Version 3.12.0 energy β go forth and let INFO come back 0, bestie πβ¨ππ¦πΈ
π¦ 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