DCHKST2STG(3)
π
DCHKST2STG(3) β Library Functions Manual π
okay bestie, you are looking at the manual page for DCHKST2STG(3), and the manual name is Library Functions Manual. The source file it comes from is about to get its own NAME moment, because that is literally what the NAME section is.
πΈ NAME πΈ
the whole NAME situation is this exact source path:
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/dchkst2stg.f
β¨ SYNOPSIS β¨
π«Ά Functions/Subroutines π«Ά
Hereβs the subroutine lineup β itβs a one-icon show, and the icon is DCHKST2STG:
subroutine DCHKST2STG (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)
DCHKST2STG
π Function/Subroutine Documentation π
π subroutine DCHKST2STG π
okay so this is the full typed-out signature, and we are keeping every single type and dimension exactly as given β no cap, every integer, every logical, every double precision, every dimension( * ), and every argument name stays put:
subroutine DCHKST2STG (integer nsizes, integer, dimension( * ) nn, integer
ntypes, logical, dimension( * ) dotype, integer, dimension( 4 ) iseed,
double precision thresh, integer nounit, double precision, dimension(
lda, * ) a, integer lda, double precision, 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, double
precision, dimension( ldu, * ) u, integer ldu, double precision,
dimension( ldu, * ) v, double precision, dimension( * ) vp, double
precision, dimension( * ) tau, double precision, dimension( ldu, * ) z,
double precision, dimension( * ) work, integer lwork, integer,
dimension( * ) iwork, integer liwork, double precision, dimension( * )
result, integer info)
DCHKST2STG
and yes, the subroutine name pops back up right after the signature β thatβs DCHKST2STG doing its little encore. π
π Purpose
Purpose:
okay so DCHKST2STG checks the symmetric eigenvalue problem routines 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 DSYTRD. For that, we call the standard DSYTRD and compute D1 using DSTEQR, then we call the 2-stage DSYTRD_2STAGE with Upper and Lower and we compute D2 and D3 using DSTEQR and then we replaced tests 3 and 4 by tests 11 and 12. Tests 1 and 2 remain to verify that the 1-stage results are OK and can be trusted. This testing routine will converge to the DCHKST in the next release when vectors and generation of Q will be implemented. π
the routine lore, bestie: π
DSYTRDfactorsAasU S U', where'means transpose,Sis symmetric tridiagonal, andUis orthogonal.DSYTRDcan use either just the lower or just the upper triangle ofA;DCHKST2STGchecks 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.DSPTRDdoes the same asDSYTRD, except thatAandVare stored in packed format.DORGTRconstructs the matrixUfrom the contents ofVandTAU.DOPGTRconstructs the matrixUfrom the contents ofVPandTAU.DSTEQRfactorsSasZ 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.DSTERFcomputesD3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors.DPTEQRfactorsSasZ4 D4 Z4', for a symmetric positive definite tridiagonal matrix.D5is the matrix of eigenvalues computed whenZis not computed.DSTEBZcomputes selected eigenvalues.WA1,WA2, andWA3will denote eigenvalues computed to high absolute accuracy, with different range options.WRwill denote eigenvalues computed to high relative accuracy.DSTEINcomputesY, the eigenvectors ofS, given the eigenvalues.DSTEDCfactorsSasZ 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 fromDSYTRD/DORGTRorDSPTRD/DOPGTR('V'option). It may also just compute eigenvalues ('N'option).DSTEMRfactorsSasZ D1 Z', whereZis the orthogonal matrix of eigenvectors andD1is a diagonal matrix with the eigenvalues on the diagonal ('I'option).DSTEMRuses the Relatively Robust Representation whenever possible.
When DCHKST2STG is called, a number of matrix sizes and a number of matrix types 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: π₯
- Test (1) β
| A - V S V' | / ( |A| n ulp )withDSYTRD( UPLO='U', ... )β¨ - Test (2) β
| I - UV' | / ( n ulp )withDORGTR( UPLO='U', ... ) - Test (3) β
| A - V S V' | / ( |A| n ulp )withDSYTRD( UPLO='L', ... )β but bestie, this one got replaced by| D1 - D2 | / ( |D1| ulp )whereD1is the eigenvalue matrix computed usingSandD2is the eigenvalue matrix computed usingS_2stage, the output ofDSYTRD_2STAGE(, ,....).D1andD2are computed viaDSTEQR('N',...). - Test (4) β
| I - UV' | / ( n ulp )withDORGTR( UPLO='L', ... )β replaced by| D1 - D3 | / ( |D1| ulp )whereD1is the eigenvalue matrix computed usingSandD3is the eigenvalue matrix computed usingS_2stage, the output ofDSYTRD_2STAGE(, ,....).D1andD3are computed viaDSTEQR('N',...). - Tests (5-8) β same as 1-4, but for
DSPTRDandDOPGTR. - Test (9) β
| S - Z D Z' | / ( |S| n ulp )withDSTEQR('V',...) - Test (10) β
| I - ZZ' | / ( n ulp )withDSTEQR('V',...) - Test (11) β
| D1 - D2 | / ( |D1| ulp )withDSTEQR('N',...) - Test (12) β
| D1 - D3 | / ( |D1| ulp )withDSTERF - Test (13) β returns
0if the true eigenvalues (computed by sturm count) ofSare withinTHRESHof those inD1, and2*THRESHif they are not. (Tested usingDSTECH.) π
For S positive definite, we also got:
- Test (14) β
| S - Z4 D4 Z4' | / ( |S| n ulp )withDPTEQR('V',...) - Test (15) β
| I - Z4 Z4' | / ( n ulp )withDPTEQR('V',...) - Test (16) β
| D4 - D5 | / ( 100 |D4| ulp )withDPTEQR('N',...)
When S is also diagonally dominant by the factor gamma < 1, we get:
- Test (17) β this one is giving "max absolute error" energy:
max | D4(i) - WR(i) | / ( |D4(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
via DSTEBZ( 'A', 'E', ...).
- Test (18) β
| WA1 - D3 | / ( |D3| ulp )withDSTEBZ( 'A', 'E', ...). - Test (19) β the "match the spectra" vibe check:
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
via DSTEBZ( 'I', 'E', ...).
- Test (20) β
| S - Y WA1 Y' | / ( |S| n ulp )withDSTEBZ,SSTEIN. - Test (21) β
| I - Y Y' | / ( n ulp )withDSTEBZ,SSTEIN. - Test (22) β
| S - Z D Z' | / ( |S| n ulp )withDSTEDC('I'). - Test (23) β
| I - ZZ' | / ( n ulp )withDSTEDC('I'). - Test (24) β
| S - Z D Z' | / ( |S| n ulp )withDSTEDC('V'). - Test (25) β
| I - ZZ' | / ( n ulp )withDSTEDC('V'). - Test (26) β
| D1 - D2 | / ( |D1| ulp )withDSTEDC('V')andDSTEDC('N').
bestie, test 27 is disabled at the moment because DSTEMR does not guarantee high relative accuracy. π
- Test (27) β (disabled)
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
via DSTEMR('V', 'A').
- Test (28) β (disabled)
max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
via DSTEMR('V', 'I').
tests 29 through 34 are disabled at present because DSTEMR does not handle partial spectrum requests. π
- Test (29) β (disabled)
| S - Z D Z' | / ( |S| n ulp )withDSTEMR('V', 'I'). - Test (30) β (disabled)
| I - ZZ' | / ( n ulp )withDSTEMR('V', 'I'). - Test (31) β (disabled)
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
with DSTEMR('N', 'I') vs. SSTEMR('V', 'I').
- Test (32) β (disabled)
| S - Z D Z' | / ( |S| n ulp )withDSTEMR('V', 'V'). - Test (33) β (disabled)
| I - ZZ' | / ( n ulp )withDSTEMR('V', 'V'). - Test (34) β (disabled)
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
with DSTEMR('N', 'V') vs. SSTEMR('V', 'V').
- Test (35) β
| S - Z D Z' | / ( |S| n ulp )withDSTEMR('V', 'A'). - Test (36) β
| I - ZZ' | / ( n ulp )withDSTEMR('V', 'A'). - Test (37) β
( max { min | WA2(i)-WA3(j) | } +
i j
max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
i j
with DSTEMR('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 will be generated. Currently, the list of possible types is: π
- The zero matrix.
- The identity matrix.
- A diagonal matrix with evenly spaced entries
1, ..., ULPand random signs. (ULP = (first number larger than 1) - 1) - A diagonal matrix with geometrically spaced entries
1, ..., ULPand random signs. - A diagonal matrix with entries
1, ULP, ..., ULPand 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' D U, whereUis orthogonal andDhas evenly spaced entries1, ..., ULPwith random signs on the diagonal. - A matrix of the form
U' D U, whereUis orthogonal andDhas geometrically spaced entries1, ..., ULPwith random signs on the diagonal. - A matrix of the form
U' D U, whereUis orthogonal andDhas entries1, ULP, ..., ULPwith random signs on the diagonal. - Same as (8), but multiplied by
SQRT( overflow threshold ) - Same as (8), but multiplied by
SQRT( underflow threshold ) - Symmetric matrix with random entries chosen from
(-1,1). - Same as (13), but multiplied by
SQRT( overflow threshold ) - Same as (13), but multiplied by
SQRT( underflow threshold ) - Same as (8), but diagonal elements are all positive.
- Same as (9), but diagonal elements are all positive.
- Same as (10), but diagonal elements are all positive.
- Same as (16), but multiplied by
SQRT( overflow threshold ) - Same as (16), but multiplied by
SQRT( underflow threshold ) - A diagonally dominant tridiagonal matrix with geometrically spaced diagonal entries
1, ..., ULP.
Parameters π
okay bestie, buckle in β this is the full roster of arguments, and I mean full. No skipping, no "tl;dr", no "you get the idea" π read it like a pre-flight checklist before you call this thing.
NSIZES
NSIZES is INTEGER. It's the number of sizes of matrices to use. If it's zero, DCHKST2STG does nothing β like, literally nothing, the whole test is cancelled πΈ It must be at least zero.
NN
NN is INTEGER array, dimension (NSIZES). An array holding the sizes used for the matrices. Zero values get skipped (they don't get a turn β¨). The values must be at least zero.
NTYPES
NTYPES is INTEGER. The number of elements in DOTYPE. If it's zero, DCHKST2STG does nothing (again β nothing happens, go home π«Ά). It must be at least zero. If it is MAXTYP+1 and NSIZES is 1, then an additional type, MAXTYP+1, is defined, which is to use whatever matrix is already in A. This is only useful if DOTYPE(1:MAXTYP) is .FALSE. and DOTYPE(MAXTYP+1) is .TRUE. β iykyk.
DOTYPE
DOTYPE is LOGICAL array, dimension (NTYPES). If DOTYPE(j) is .TRUE., then for each size in NN a matrix of that size and of type j will be generated. If NTYPES is smaller than the maximum number of types defined (PARAMETER MAXTYP), then types NTYPES+1 through MAXTYP will not be generated. If NTYPES is larger than MAXTYP, then DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) will be ignored β they're just there, vibing π
ISEED
ISEED is INTEGER array, dimension (4). On entry, ISEED specifies the seed of the random number generator. The array elements should be between 0 and 4095; if not, they will be reduced mod 4096 (the math said "no" and fixed it for you π§). Also, ISEED(4) must be odd β non-negotiable, bestie β The random number generator uses a linear congruential sequence limited to small integers, and so should produce machine independent random numbers. The values of ISEED are changed on exit, and can be used in the next call to DCHKST2STG to continue the same random number sequence. cute, right? a little continuity π
THRESH
THRESH is DOUBLE PRECISION. A test will count as β¦ if the β¦, computed as described above, exceeds THRESH (yeah, the words got eaten in the source, I'm not making it up π« ). Note that 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. It must be at least zero.
NOUNIT
NOUNIT is INTEGER. The FORTRAN unit number for printing out error messages (e.g., if a routine returns IINFO not equal to 0). It's the little messenger that snitches when something goes wrong π’
A
A is DOUBLE PRECISION array of
dimension ( LDA , max(NN) )
Used to hold the matrix whose eigenvalues are to be computed. On exit, A contains the last matrix actually used β so it keeps the receipts of the most recent run π
LDA
LDA is INTEGER. The leading dimension of A. It must be at least 1 and at least max( NN ).
AP
AP is DOUBLE PRECISION array of
dimension( max(NN)*max(NN+1)/2 )
The matrix A stored in packed format π
SD
SD is DOUBLE PRECISION array of
dimension( max(NN) )
The diagonal of the tridiagonal matrix computed by DSYTRD. On exit, SD and SE contain the tridiagonal form of the matrix in A.
SE
SE is DOUBLE PRECISION array of
dimension( max(NN) )
The off-diagonal of the tridiagonal matrix computed by DSYTRD. On exit, SD and SE contain the tridiagonal form of the matrix in A β yes, same sentence, they're a package deal π«Ά
D1
D1 is DOUBLE PRECISION array of
dimension( max(NN) )
The eigenvalues of A, as computed by DSTEQR simultaneously with Z. On exit, the eigenvalues in D1 correspond with the matrix in A.
D2
D2 is DOUBLE PRECISION array of
dimension( max(NN) )
The eigenvalues of A, as computed by DSTEQR if Z is not computed. On exit, the eigenvalues in D2 correspond with the matrix in A.
D3
D3 is DOUBLE PRECISION array of
dimension( max(NN) )
The eigenvalues of A, as computed by DSTERF. On exit, the eigenvalues in D3 correspond with the matrix in A.
D4
D4 is DOUBLE PRECISION array of
dimension( max(NN) )
The eigenvalues of A, as computed by DPTEQR(V). DPTEQR factors S as Z4 D4 Z4*. On exit, the eigenvalues in D4 correspond with the matrix in A.
D5
D5 is DOUBLE PRECISION array of
dimension( max(NN) )
The eigenvalues of A, as computed by DPTEQR(N) when Z is not computed. On exit, the eigenvalues in D4 correspond with the matrix in A β yep, it says D4 right there in the D5 paragraph, that's not me, that's the docs ππ
WA1
WA1 is DOUBLE PRECISION array of
dimension( max(NN) )
All eigenvalues of A, computed to high absolute accuracy, with different range options, as computed by DSTEBZ β¨
WA2
WA2 is DOUBLE PRECISION array of
dimension( max(NN) )
Selected eigenvalues of A, computed to high absolute accuracy, with different range options, as computed by DSTEBZ. Choose random values for IL and IU, and ask for the IL-th through IU-th eigenvalues β a lil surprise selection π²
WA3
WA3 is DOUBLE PRECISION array of
dimension( max(NN) )
Selected eigenvalues of A, computed to high absolute accuracy, with different range options, as computed by DSTEBZ. Determine the values VL and VU of the IL-th and IU-th eigenvalues and ask for all eigenvalues in this range.
WR
WR is DOUBLE PRECISION array of
dimension( max(NN) )
All eigenvalues of A, computed to high absolute accuracy, with different options, as computed by DSTEBZ.
U
U is DOUBLE PRECISION array of
dimension( LDU, max(NN) ).
The orthogonal matrix computed by DSYTRD + DORGTR.
LDU
LDU is INTEGER. The leading dimension of U, Z, and V. It must be at least 1 and at least max( NN ). One number, three matrices, main character energy π
V
V is DOUBLE PRECISION array of
dimension( LDU, max(NN) ).
The Housholder vectors computed by DSYTRD in reducing A to tridiagonal form. The vectors computed with UPLO='U' are in the upper triangle, and the vectors computed with UPLO='L' are in the lower triangle. (As described in DSYTRD, the sub- and superdiagonal are not set to 1, although the true Householder vector has a 1 in that position. The routines that use V, such as DORGTR, set those entries to 1 before using them, and then restore them later.) so it's a whole borrow-and-return situation π¦
VP
VP is DOUBLE PRECISION array of
dimension( max(NN)*max(NN+1)/2 )
The matrix V stored in packed format.
TAU
TAU is DOUBLE PRECISION array of
dimension( max(NN) )
The Householder factors computed by DSYTRD in reducing A to tridiagonal form.
Z
Z is DOUBLE PRECISION array of
dimension( LDU, max(NN) ).
The orthogonal matrix of eigenvectors computed by DSTEQR, DPTEQR, and DSTEIN.
WORK
WORK is DOUBLE PRECISION array of
dimension( LWORK )
LWORK
LWORK is INTEGER. The number of entries in WORK. 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 the workspace, bestie, it will not forgive you π
IWORK
IWORK is INTEGER array, Workspace. that's it, that's the whole description π
LIWORK
LIWORK is INTEGER. The number of entries in IWORK. This must be at least
6 + 6*Nmax + 5 * Nmax * lg Nmax
where Nmax = max( NN(j), 2 ) and lg = log base 2.
RESULT
RESULT is DOUBLE PRECISION array, dimension (26). The values computed by the tests described above. The values are currently limited to 1/ulp, to avoid overflow β safety rails, we love to see them πΌ
INFO
okay so INFO is INTEGER, and hereβs the whole βdid it slay or did it flopβ chart:
0β everything ran OK. we love a clean bill of health β¨-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 DLATMR, SLATMS, DSYTRD, DORGTR, DSTEQR, SSTERF, or DORMC2 returns an error code, the absolute value of it is returned. periodt.
π«§ Some Local Variables and Parameters
ZERO,ONEβ real0and1, the tiny icons of this whole situation.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 dchkst2stg.f.
πͺ Author
Generated automatically by Doxygen for LAPACK from the source code.
Thatβs the tea from LAPACK Version 3.12.0, source path /home/abui...chkst2stg.f(3), with the footerβs date stamp β mwah π
π¦ 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