SCHKHS(3)
π SCHKHS(3) β LAPACK's nonsymmetric eigenvalue checker, but make it group-chat π
Manual name: SCHKHS(3). Section: Library Functions Manual. This is part 1, bestie β more parts are coming, so don't close the tab.
πΈ NAME πΈ
The source file path, exactly as the page gives it:
/home/abuild/rpmbuild/BUILD/lapack-
static-3.12.0-build/lapack-3.12.0/TESTING/EIG/schkhs.f
β¨ SYNOPSIS β¨
π§ Functions/Subroutines π§
The star of the show is SCHKHS, and here's the synopsis block in all its glory:
subroutine SCHKHS (nsizes, nn, ntypes, dotype, iseed, thresh, nounit, a,
lda, h, t1, t2, u, ldu, z, uz, wr1, wi1, wr2, wi2, wr3, wi3, evectl,
evectr, evecty, evectx, uu, tau, work, nwork, iwork, select, result,
info)
SCHKHS
π«Ά Function/Subroutine Documentation π«Ά
π§ subroutine SCHKHS π§
Full signature, copied with love and zero edits:
subroutine SCHKHS (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( lda, * ) h, real, dimension( lda, * ) t1, real,
dimension( lda, * ) t2, real, dimension( ldu, * ) u, integer ldu, real,
dimension( ldu, * ) z, real, dimension( ldu, * ) uz, real, dimension( *
) wr1, real, dimension( * ) wi1, real, dimension( * ) wr2, real,
dimension( * ) wi2, real, dimension( * ) wr3, real, dimension( * ) wi3,
real, dimension( ldu, * ) evectl, real, dimension( ldu, * ) evectr,
real, dimension( ldu, * ) evecty, real, dimension( ldu, * ) evectx,
real, dimension( ldu, * ) uu, real, dimension( * ) tau, real, dimension(
* ) work, integer nwork, integer, dimension( * ) iwork, logical,
dimension( * ) select, real, dimension( 16 ) result, integer info)
SCHKHS
Purpose
Okay so SCHKHS is the vibe check for the nonsymmetric eigenvalue problem routines. It's not out here doing the eigenvalues itself β it's the tester, the friend who holds your bag and checks that every routine actually did what it promised.
Here's the routine roster, bestie:
SGEHRDfactorsAasU H U', where'means transpose,His hessenberg, andUis an orthogonal matrix.SORGHRgenerates the orthogonal matrixU.SORMHRmultiplies a matrix by the orthogonal matrixU.SHSEQRfactorsHasZ T Z', whereZis orthogonal andTis upper triangular, and the eigenvalue vectorW.STREVCcomputes the left and right eigenvector matricesLandRforT.SHSEINcomputes the left and right eigenvector matricesYandXforH, using inverse iteration.STREVC3computes left and right eigenvector matrices from a Schur matrixTand backtransforms them withZto eigenvector matricesLandRforA.LandRare GE matrices.
When SCHKHS is called, a number of matrix sizes (NSIZES) and a number of matrix types (NTYPES) are specified. For each size (NN(j)) 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:
| A - U H U**T | / ( |A| n ulp )β didAsurvive theU H U**Tglow-up?| I - UU**T | / ( n ulp )β isUstill giving orthogonal?| H - Z T Z**T | / ( |H| n ulp )β didHturn intoZ T Z**Tcorrectly?| I - ZZ**T | / ( n ulp )β isZstill orthogonal? periodt.| A - UZ H (UZ)**T | / ( |A| n ulp )β anotherAreconstruction check.| I - UZ (UZ)**T | / ( n ulp )β another orthogonality check forUZ.| T(Z computed) - T(Z not computed) | / ( |T| ulp )β do the twoTversions match?| W(Z computed) - W(Z not computed) | / ( |W| ulp )β do the twoWversions match?| TR - RW | / ( |T| |R| ulp )β right eigenvector check forT.| L**H T - W**H L | / ( |T| |L| ulp )β left eigenvector check forT.| HX - XW | / ( |H| |X| ulp )β right eigenvector check forH.| Y**H H - W**H Y | / ( |H| |Y| ulp )β left eigenvector check forH.| AX - XW | / ( |A| |X| ulp )β right eigenvector check forA.| Y**H A - W**H Y | / ( |A| |Y| ulp )β left eigenvector check forA.| AR - RW | / ( |A| |R| ulp )β right eigenvector check forAusingR.| LA - WL | / ( |A| |L| ulp )β left eigenvector check forAusingL.
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:
- The zero matrix.
- The identity matrix.
- A (transposed) Jordan block, with 1's on the diagonal.
- A diagonal matrix with evenly spaced entries 1, ..., ULP and random signs. (ULP = (first number larger than 1) - 1 )
- A diagonal matrix with geometrically spaced entries 1, ..., ULP and random signs.
- A diagonal matrix with logarithmically spaced entries 1, ULP, ..., ULP and random signs.
- 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 orthogonal andThas evenly spaced entries 1, ..., ULP with random signs on the diagonal and random O(1) entries in the upper triangle. - A matrix of the form
U' T U, whereUis orthogonal andThas geometrically spaced entries 1, ..., ULP with random signs on the diagonal and random O(1) entries in the upper triangle. - A matrix of the form
U' T U, whereUis orthogonal andThas logarithmically spaced entries 1, ULP,..., ULP with random signs on the diagonal and random O(1) entries in the upper triangle. - A matrix of the form
U' T U, whereUis orthogonal andThas real or complex conjugate paired eigenvalues randomly chosen from ( ULP, 1 ) and random O(1) entries in the upper triangle. - A matrix of the form
X' T X, whereXhas condition SQRT( ULP ) andThas evenly spaced entries 1, ..., ULP with random signs on the diagonal and random O(1) entries in the upper triangle. - A matrix of the form
X' T X, whereXhas condition SQRT( ULP ) andThas geometrically spaced entries 1, ..., ULP with random signs on the diagonal and random O(1) entries in the upper triangle. - A matrix of the form
X' T X, whereXhas condition SQRT( ULP ) andThas logarithmically spaced entries 1, ULP,..., ULP with random signs on the diagonal and random O(1) entries in the upper triangle. - A matrix of the form
X' T X, whereXhas condition SQRT( ULP ) andThas real or complex conjugate paired eigenvalues randomly chosen from ( ULP, 1 ) and random O(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 (-1,1).
- Same as (19), but multiplied by SQRT( overflow threshold )
- Same as (19), but multiplied by SQRT( underflow threshold )
okay so weβre deep in the argument list now β every single parameter, exactly as SCHKHS gives it, no skipping, no cap:
NSIZESβINTEGER. The number of sizes of matrices to use. If it is zero,SCHKHSdoes nothing. It must be at least zero. Not modified.NNβINTEGER 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. Not modified.NTYPESβINTEGER. The number of elements inDOTYPE. If it is zero,SCHKHSdoes 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.. Not modified.DOTYPEβLOGICAL 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. Not modified.ISEEDβINTEGER 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 toSCHKHSto continue the same random number sequence. Modified.THRESHβREAL. A test will count as [blank in source] if the [blank in source], computed as described above, exceedsTHRESH. 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. Not modified.NOUNITβINTEGER. The FORTRAN unit number for printing out error messages (e.g., if a routine returnsIINFOnot equal to0.) Not modified.AβREAL array, dimension (LDA,max(NN)). Used to hold the matrix whose eigenvalues are to be computed. On exit,Acontains the last matrix actually used. Modified.LDAβINTEGER. The leading dimension ofA,H,T1andT2. It must be at least1and at leastmax( NN ). Not modified.HβREAL array, dimension (LDA,max(NN)). The upper hessenberg matrix computed bySGEHRD. On exit,Hcontains the Hessenberg form of the matrix inA. Modified.T1βREAL array, dimension (LDA,max(NN)). The Schur (=) matrix computed bySHSEQRifZis computed. On exit,T1contains the Schur form of the matrix inA. Modified.T2βREAL array, dimension (LDA,max(NN)). The Schur matrix computed bySHSEQRwhenZis not computed. This should be identical toT1. Modified.LDUβINTEGER. The leading dimension ofU,Z,UZandUU. It must be at least1and at leastmax( NN ). Not modified.UβREAL array, dimension (LDU,max(NN)). The orthogonal matrix computed bySGEHRD. Modified.ZβREAL array, dimension (LDU,max(NN)). The orthogonal matrix computed bySHSEQR. Modified.UZβREAL array, dimension (LDU,max(NN)). The product ofUtimesZ. Modified.WR1,WI1βREAL array, dimension (max(NN))each. The real and imaginary parts of the eigenvalues ofA, as computed whenZis computed. On exit,WR1 + WI1*iare the eigenvalues of the matrix inA. Modified.WR2,WI2βREAL array, dimension (max(NN))each. The real and imaginary parts of the eigenvalues ofA, as computed whenTis computed but notZ. On exit,WR2 + WI2*iare the eigenvalues of the matrix inA. Modified.WR3,WI3βREAL array, dimension (max(NN))each. LikeWR1,WI1, these arrays contain the eigenvalues ofA, but those computed whenSHSEQRonly computes the eigenvalues, i.e., not the Schur vectors and no more of the Schur form than is necessary for computing the eigenvalues. Modified.EVECTLβREAL array, dimension (LDU,max(NN)). The (upper triangular) left eigenvector matrix for the matrix inT1. For complex conjugate pairs, the real part is stored in one row and the imaginary part in the next. Modified.EVECTRβREAL array, dimension (LDU,max(NN)). The (upper triangular) right eigenvector matrix for the matrix inT1. For complex conjugate pairs, the real part is stored in one column and the imaginary part in the next. Modified.EVECTYβREAL array, dimension (LDU,max(NN)). The left eigenvector matrix for the matrix inH. For complex conjugate pairs, the real part is stored in one row and the imaginary part in the next. Modified.EVECTXβREAL array, dimension (LDU,max(NN)). The right eigenvector matrix for the matrix inH. For complex conjugate pairs, the real part is stored in one column and the imaginary part in the next. Modified.UUβREAL array, dimension (LDU,max(NN)). Details of the orthogonal matrix computed bySGEHRD. Modified.TAUβREAL array, dimension(max(NN)). Further details of the orthogonal matrix computed bySGEHRD. Modified.WORKβREAL array, dimension (NWORK). Workspace. Modified.NWORKβINTEGER. The number of entries inWORK.NWORK >= 4*NN(j)*NN(j) + 2.IWORKβINTEGER array, dimension (max(NN)). Workspace. Modified.SELECTβLOGICAL array, dimension (max(NN)). Workspace. Modified.RESULTβREAL array, dimension (16). The values computed by the fourteen tests described above. The values are currently limited to1/ulp, to avoid overflow. Modified.INFOβINTEGER. If0, then everything ran OK. The codes are:-1:NSIZES < 0;-2: SomeNN(j) < 0;-3:NTYPES < 0;-6:THRESH < 0;-9:LDA < 1orLDA < NMAX, whereNMAXismax( NN(j) );-14:LDU < 1orLDU < NMAX;-28:NWORKtoo small. IfSLATMR,SLATMS, orSLATMEreturns an error code, the absolute value of it is returned. If1, thenSHSEQRcould not find all the shifts. If2, then theEISPACKcode (for small blocks) failed. If>2, then30*Niterations were not enough to find an eigenvalue or to decompose the problem. Modified.
π Some Local Variables and Parameters
the sourceβs own little backstage pass:
ZERO,ONEβ Real0and1.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.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 will be less if any of the routines being tested indicates that it could not compute the matrices that would be tested.NMAXβ Largest value inNN.NMATSβ The number of matrices generated so far.NERRSβ The number of tests which have exceededTHRESHso far (computed bySLAFTS).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:
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). A0means irrelevant, so no stress π«Ά
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 416 of file schkhs.f.
πΈ Author πΈ
Generated automatically by Doxygen for LAPACK from the source code.
Thatβs the whole SCHKHS(3) page, bestie! π Footer vibes: LAPACK Version 3.12.0, source /home/abui...IG/schkhs.f(3), and the date stamp right there keeping it official π
π¦ 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