SCHKST2STG(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ’… 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 🫢

  • 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; SCHKST2STG 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 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 ) with SSYTRD( UPLO='U', ... ).
  • Test (2) β€” | I - UV' | / ( n ulp ) with SORGTR( UPLO='U', ... ).
  • Test (3) β€” originally | A - V S V' | / ( |A| n ulp ) with SSYTRD( UPLO='L', ... ), but it’s replaced by | D1 - D2 | / ( |D1| ulp ), where D1 is the eigenvalue matrix computed using S and D2 is the eigenvalue matrix computed using S_2stage the output of SSYTRD_2STAGE(, ,....). D1 and D2 are computed via SSTEQR('N',...).
  • Test (4) β€” originally | I - UV' | / ( n ulp ) with SORGTR( UPLO='L', ... ), but it’s replaced by | D1 - D3 | / ( |D1| ulp ), where D1 is the eigenvalue matrix computed using S and D3 is the eigenvalue matrix computed using S_2stage the output of SSYTRD_2STAGE(, ,....). D1 and D3 are computed via SSTEQR('N',...).
  • Tests (5-8) β€” same as 1-4, but for SSPTRD and SOPGTR.
  • Test (9) β€” | S - Z D Z' | / ( |S| n ulp ) with SSTEQR('V',...).
  • Test (10) β€” | I - ZZ' | / ( n ulp ) with SSTEQR('V',...).
  • Test (11) β€” | D1 - D2 | / ( |D1| ulp ) with SSTEQR('N',...).
  • Test (12) β€” | D1 - D3 | / ( |D1| ulp ) with SSTERF.
  • Test (13) β€” 0 if the true eigenvalues (computed by sturm count) of S are within THRESH of those in D1. 2*THRESH if they are not. (Tested using SSTECH)

For S positive definite,

  • Test (14) β€” | S - Z4 D4 Z4' | / ( |S| n ulp ) with SPTEQR('V',...).
  • Test (15) β€” | I - Z4 Z4' | / ( n ulp ) with SPTEQR('V',...).
  • Test (16) β€” | D4 - D5 | / ( 100 |D4| ulp ) with SPTEQR('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 ) with SSTEBZ( '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 ) with SSTEBZ, SSTEIN.
  • Test (21) β€” | I - Y Y' | / ( n ulp ) with SSTEBZ, SSTEIN.
  • Test (22) β€” | S - Z D Z' | / ( |S| n ulp ) with SSTEDC('I').
  • Test (23) β€” | I - ZZ' | / ( n ulp ) with SSTEDC('I').
  • Test (24) β€” | S - Z D Z' | / ( |S| n ulp ) with SSTEDC('V').
  • Test (25) β€” | I - ZZ' | / ( n ulp ) with SSTEDC('V').
  • Test (26) β€” | D1 - D2 | / ( |D1| ulp ) with SSTEDC('V') and SSTEDC('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 ) with SSTEMR('V', 'I').
  • Test (30) β€” | I - ZZ' | / ( n ulp ) with SSTEMR('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 ) with SSTEMR('V', 'V').
  • Test (33) β€” | I - ZZ' | / ( n ulp ) with SSTEMR('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 ) with SSTEMR('V', 'A').
  • Test (36) β€” | I - ZZ' | / ( n ulp ) with SSTEMR('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, ..., ULP and random signs. (ULP = (first number larger than 1) - 1)
  • (4) β€” a diagonal matrix with geometrically spaced entries 1, ..., ULP and random signs.
  • (5) β€” a diagonal matrix with entries 1, ULP, ..., ULP and 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 orthogonal and D has evenly spaced entries 1, ..., ULP with random signs on the diagonal.
  • (9) β€” a matrix of the form U' D U, where U is orthogonal and D has geometrically spaced entries 1, ..., ULP with random signs on the diagonal.
  • (10) β€” a matrix of the form U' D U, where U is orthogonal and D has entries 1, ULP,..., ULP with 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 β€” NSIZES is INTEGER. it’s the number of sizes of matrices to use. if it is zero, SCHKST2STG does nothing. it must be at least zero. ✨
  • NN β€” NN is 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. πŸŽ€
  • NTYPES β€” NTYPES is INTEGER. the number of elements in DOTYPE. if it is zero, SCHKST2STG does nothing. 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 in A. this is only useful if DOTYPE(1:MAXTYP) is .FALSE. and DOTYPE(MAXTYP+1) is .TRUE.. πŸ¦‹
  • 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, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) will be ignored. 🌸
  • 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. 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 of ISEED are changed on exit, and can be used in the next call to SCHKST2STG to continue the same random number sequence. πŸ”₯
  • THRESH β€” THRESH is REAL. the source literally says β€œa test will count as if the , computed as described above, exceeds THRESH” β€” blanks and all β€” so i’m not filling them in. 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.) πŸ’œ
  • A β€” A is a REAL 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. 🌈
  • LDA β€” LDA is INTEGER. the leading dimension of A. it must be at least 1 and at least max( NN ). ⭐
  • AP β€” AP is a REAL array of dimension ( max(NN)*max(NN+1)/2 ). the matrix A stored in packed format. πŸ“
  • SD β€” SD is a REAL array of dimension ( max(NN) ). the diagonal of the tridiagonal matrix computed by SSYTRD. on exit, SD and SE contain the tridiagonal form of the matrix in A. πŸ’–
  • SE β€” SE is a REAL array of dimension ( max(NN) ). the off-diagonal of the tridiagonal matrix computed by SSYTRD. on exit, SD and SE contain the tridiagonal form of the matrix in A. 🧚
  • D1 β€” D1 is a REAL array of dimension ( max(NN) ). the eigenvalues of A, as computed by SSTEQR simultaneously with Z. on exit, the eigenvalues in D1 correspond with the matrix in A. ✨
  • D2 β€” D2 is a REAL array of dimension ( max(NN) ). the eigenvalues of A, as computed by SSTEQR if Z is not computed. on exit, the eigenvalues in D2 correspond with the matrix in A. πŸŽ€
  • D3 β€” D3 is a REAL array of dimension ( max(NN) ). the eigenvalues of A, as computed by SSTERF. on exit, the eigenvalues in D3 correspond with the matrix in A. πŸ¦‹
  • D4 β€” D4 is a REAL array of dimension ( max(NN) ). the eigenvalues of A, as computed by SPTEQR(V). SPTEQR factors S as Z4 D4 Z4*. on exit, the eigenvalues in D4 correspond with the matrix in A. 🌸
  • D5 β€” D5 is a REAL array of dimension ( max(NN) ). the eigenvalues of A, as computed by SPTEQR(N) when Z is not computed. on exit, the eigenvalues in D4 correspond with the matrix in A. yes, it really says D4 there β€” keeping it exactly as written. πŸ’€
  • WA1 β€” WA1 is a REAL array of dimension ( max(NN) ). all eigenvalues of A, computed to high absolute accuracy, with different range options. as computed by SSTEBZ. πŸ”₯
  • WA2 β€” WA2 is a REAL array of dimension ( max(NN) ). selected eigenvalues of A, computed to high absolute accuracy, with different range options. as computed by SSTEBZ. choose random values for IL and IU, and ask for the IL-th through IU-th eigenvalues. πŸ‘‘
  • WA3 β€” WA3 is a REAL array of dimension ( max(NN) ). selected eigenvalues of A, computed to high absolute accuracy, with different range options. as computed by SSTEBZ. 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 a REAL array of dimension ( max(NN) ). all eigenvalues of A, computed to high absolute accuracy, with different options. as computed by SSTEBZ. 🌈
  • U β€” U is a REAL array of dimension ( LDU, max(NN) ). the orthogonal matrix computed by SSYTRD + SORGTR. ⭐
  • LDU β€” LDU is INTEGER. the leading dimension of U, Z, and V. it must be at least 1 and at least max( NN ). πŸ“
  • V β€” V is a REAL array of dimension ( LDU, max(NN) ). the Housholder vectors computed by SSYTRD 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 SSYTRD, 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 SORGTR, set those entries to 1 before using them, and then restore them later.) πŸ’–
  • VP β€” VP is a REAL array of dimension ( max(NN)*max(NN+1)/2 ). the matrix V stored in packed format. 🧚
  • TAU β€” TAU is a REAL array of dimension ( max(NN) ). the Householder factors computed by SSYTRD in reducing A to tridiagonal form. ✨
  • Z β€” Z is a REAL array of dimension ( LDU, max(NN) ). the orthogonal matrix of eigenvectors computed by SSTEQR, SPTEQR, and SSTEIN. πŸŽ€
  • WORK β€” WORK is a REAL 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. 🌸
  • IWORK β€” IWORK is INTEGER array. workspace. πŸ”₯
  • 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 a REAL array, dimension (26). the values computed by the tests described above. the values are currently limited to 1/ulp, to avoid overflow. πŸ’œ
  • INFO β€” okay the source just lists INFO here 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 β€” some NN(j) < 0
  • -3 β€” NTYPES < 0
  • -5 β€” THRESH < 0
  • -9 β€” LDA < 1 or LDA < NMAX, where NMAX is max( NN(j) )
  • -23 β€” LDU < 1 or LDU < NMAX
  • -29 β€” LWORK too 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 by ENVIR.
  • NMAX β€” largest value in NN.
  • NMATS β€” the number of matrices generated so far.
  • NERRS β€” the number of tests which have exceeded THRESH so far.
  • COND, IMODE β€” values to be passed to the matrix generators.
  • ANORM β€” norm of A; 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) β€” the MODE value 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