ZCHKST2STG(3)

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

ZCHKST2STG(3) β€” Library Functions Manual πŸŽ€βœ¨

okay so bestie, welcome to the ZCHKST2STG(3) page from the Library Functions Manual. This is the LAPACK testing-zone subroutine page, and we are keeping every single argument, type, dimension, and name exactly as it appears. No cap, no summary crimes. πŸ’…

πŸ’– NAME πŸ’–

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/zchkst2stg.f

That whole absolute path is the NAME entry, bestie. Yes, the entire thing. Slay. 🫢

🌸 SYNOPSIS 🌸

πŸ’… Functions/Subroutines

Here's the synopsis line, verbatim vibes only:

subroutine ZCHKST2STG (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, rwork, lrwork, iwork, liwork, result, info)
           ZCHKST2STG

✨ Function/Subroutine Documentation ✨

πŸŽ€ The ZCHKST2STG subroutine, full signature

This is the whole declaration, exact types and dimensions included β€” not a vibe-based paraphrase:

subroutine ZCHKST2STG (integer nsizes, integer, dimension( * ) nn, integer ntypes, logical, dimension( * ) dotype, integer, dimension( 4 ) iseed, double precision thresh, integer nounit, complex*16, dimension( lda, * ) a, integer lda, complex*16, 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, complex*16, dimension( ldu, * ) u, integer ldu, complex*16, dimension( ldu, * ) v, complex*16, dimension( * ) vp, complex*16, dimension( * ) tau, complex*16, dimension( ldu, * ) z, complex*16, dimension( * ) work, integer lwork, double precision, dimension( * ) rwork, integer lrwork, integer, dimension( * ) iwork, integer liwork, double precision, dimension( * ) result, integer info)
       ZCHKST2STG

πŸ’œ Purpose:

okay so real talk, bestie: ZCHKST2STG is the vibe check for the Hermitian eigenvalue problem routines, specifically the ones using 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 ZHETRD. For that, we call the standard ZHETRD and compute D1 using DSTEQR, then we call the 2-stage ZHETRD_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 ZCHKST in the next release when vectors and generation of Q will be implemented. periodt ✨

ZHETRD factors A as U S U*, where * means conjugate transpose, S is real symmetric tridiagonal, and U is unitary. ZHETRD can use either just the lower or just the upper triangle of A; ZCHKST2STG 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.

ZHPTRD does the same as ZHETRD, except that A and V are stored in format.

ZUNGTR constructs the matrix U from the contents of V and TAU.

ZUPGTR constructs the matrix U from the contents of VP and TAU.

ZSTEQR factors S as Z D1 Z*, where Z is the unitary 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.

DSTERF computes D3, the matrix of eigenvalues, by the PWK method, which does not yield eigenvectors.

ZPTEQR factors S as Z4 D4 Z4*, for a Hermitian positive definite tridiagonal matrix. D5 is the matrix of eigenvalues computed when Z is not computed.

DSTEBZ 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.

ZSTEIN computes Y, the eigenvectors of S, given the eigenvalues.

ZSTEDC factors S as Z D1 Z*, where Z is the unitary matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal ('I' option). It may also update an input unitary matrix, usually the output from ZHETRD/ZUNGTR or ZHPTRD/ZUPGTR ('V' option). It may also just compute eigenvalues ('N' option).

ZSTEMR factors S as Z D1 Z*, where Z is the unitary matrix of eigenvectors and D1 is a diagonal matrix with the eigenvalues on the diagonal ('I' option). ZSTEMR uses the Relatively Robust Representation whenever possible.

When ZCHKST2STG 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 Hermitian eigenroutines. For each matrix, a number of tests will be performed:

πŸ§ͺ the tests, in order

(1) | A - V S V* | / ( |A| n ulp ) with ZHETRD( UPLO='U', ... ).

(2) | I - UV* | / ( n ulp ) with ZUNGTR( UPLO='U', ... ).

(3) | A - V S V* | / ( |A| n ulp ) with ZHETRD( UPLO='L', ... ) β€” 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 ZHETRD_2STAGE(, ,....). D1 and D2 are computed via DSTEQR('N',...).

(4) | I - UV* | / ( n ulp ) with ZUNGTR( UPLO='L', ... ) β€” 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 ZHETRD_2STAGE(, ,....). D1 and D3 are computed via DSTEQR('N',...).

(5-8) Same as 1-4, but for ZHPTRD and ZUPGTR.

(9) | S - Z D Z* | / ( |S| n ulp ) with ZSTEQR('V',...).

(10) | I - ZZ* | / ( n ulp ) with ZSTEQR('V',...).

(11) | D1 - D2 | / ( |D1| ulp ) with ZSTEQR('N',...).

(12) | D1 - D3 | / ( |D1| ulp ) with DSTERF.

(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 DSTECH.

For S positive definite:

(14) | S - Z4 D4 Z4* | / ( |S| n ulp ) with ZPTEQR('V',...).

(15) | I - Z4 Z4* | / ( n ulp ) with ZPTEQR('V',...).

(16) | D4 - D5 | / ( 100 |D4| ulp ) with ZPTEQR('N',...).

When S is also diagonally dominant by the factor gamma < 1:

(17)

max | D4(i) - WR(i) | / ( |D4(i)| omega ) ,
 i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
                                             DSTEBZ( 'A', 'E', ...)

(18) | WA1 - D3 | / ( |D3| ulp ) with DSTEBZ( 'A', 'E', ...).

(19)

( max { min | WA2(i)-WA3(j) | } +
   i     j
  max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
   i     j
                                             DSTEBZ( 'I', 'E', ...)

(20) | S - Y WA1 Y* | / ( |S| n ulp ) with DSTEBZ, ZSTEIN.

(21) | I - Y Y* | / ( n ulp ) with DSTEBZ, ZSTEIN.

(22) | S - Z D Z* | / ( |S| n ulp ) with ZSTEDC('I').

(23) | I - ZZ* | / ( n ulp ) with ZSTEDC('I').

(24) | S - Z D Z* | / ( |S| n ulp ) with ZSTEDC('V').

(25) | I - ZZ* | / ( n ulp ) with ZSTEDC('V').

(26) | D1 - D2 | / ( |D1| ulp ) with ZSTEDC('V') and ZSTEDC('N').

Test 27 is disabled at the moment because ZSTEMR does not guarantee high relatvie accuracy.

(27)

max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
 i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
                                             ZSTEMR('V', 'A')

(28)

max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
 i
omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
                                             ZSTEMR('V', 'I')
Tests 29 through 34 are disable at present because ZSTEMR does not handle partial spectrum requests.

(29) | S - Z D Z* | / ( |S| n ulp ) with ZSTEMR('V', 'I').

(30) | I - ZZ* | / ( n ulp ) with ZSTEMR('V', 'I').

(31)

( max { min | WA2(i)-WA3(j) | } +
   i     j
  max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
   i     j
        ZSTEMR('N', 'I') vs. CSTEMR('V', 'I')

(32) | S - Z D Z* | / ( |S| n ulp ) with ZSTEMR('V', 'V').

(33) | I - ZZ* | / ( n ulp ) with ZSTEMR('V', 'V').

(34)

( max { min | WA2(i)-WA3(j) | } +
   i     j
  max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
   i     j
        ZSTEMR('N', 'V') vs. CSTEMR('V', 'V')

(35) | S - Z D Z* | / ( |S| n ulp ) with ZSTEMR('V', 'A').

(36) | I - ZZ* | / ( n ulp ) with ZSTEMR('V', 'A').

(37)

( max { min | WA2(i)-WA3(j) | } +
   i     j
  max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
   i     j
        ZSTEMR('N', 'A') vs. CSTEMR('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 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 unitary 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 unitary 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 unitary 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. Hermitian 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.

okay so the parameter list is literally the whole cast of the show β€” grab a snack and a strawberry drink, we're doing every single one πŸ’…πŸ“

NSIZES

NSIZES is INTEGER. It's the number of sizes of matrices to use. If it's zero, ZCHKST2STG does nothing β€” like, nothing nothing, it's giving cancelled plans energy 😴. 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 (they just don't get an invite to the party πŸ™ˆ). The values must be at least zero.

NTYPES

NTYPES is INTEGER. This is the number of elements in DOTYPE. If it's zero, ZCHKST2STG does nothing, and again β€” must be at least zero, no negatives bestie.

Here's the spicy part πŸ”₯: if it's MAXTYP+1 and NSIZES is 1, then an additional type, MAXTYP+1, is defined, which is to use whatever matrix is in A. That whole situation 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, then DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) will be ignored (sorry to those entries, they simply don't matter πŸ’€)

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 β€” and if they're not, they will be reduced mod 4096. Also, ISEED(4) must be odd (non-negotiable, that's the vibe check πŸ™…β€β™€οΈ).

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 ZCHKST2STG to continue the same random number sequence. So it's like a little relay baton you keep passing πŸƒβ€β™€οΈ

THRESH

THRESH is DOUBLE PRECISION.

A test will count as … if the …, computed as described above, exceeds THRESH. (yes, the source page literally has holes in that sentence β€” not my typo, I'm not out here inventing lore πŸ’€)

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. It's the FORTRAN unit number for printing out error messages (e.g., if a routine returns IINFO not equal to 0). Basically the lil megaphone πŸ“£ when things go sideways.

A

A is COMPLEX*16 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 final one 🧾

LDA

LDA is INTEGER. The leading dimension of A. It must be at least 1 and at least max( NN ).

AP

AP is COMPLEX*16 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 ZHETRD. 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 ZHETRD. On exit, SD and SE contain the tridiagonal form of the matrix in A. Yes, SD and SE are a duo, they come as a set 🫢

D1

D1 is DOUBLE PRECISION array of dimension ( max(NN) ).

The eigenvalues of A, as computed by ZSTEQR 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 ZSTEQR 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 ZPTEQR(V). ZPTEQR 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 ZPTEQR(N) when Z is not computed. On exit, the eigenvalues in D4 correspond with the matrix in A. (and yes, it says D4 right there in the D5 entry β€” the source does that, I'm just the messenger πŸ™ˆ)

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 🎯

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 COMPLEX*16 array of dimension ( LDU, max(NN) ).

The unitary matrix computed by ZHETRD + ZUNGTR πŸ‘‘

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 icons.

V

V is COMPLEX*16 array of dimension ( LDU, max(NN) ).

The Housholder vectors computed by ZHETRD in reducing A to tridiagonal form πŸ¦‹

  • The vectors computed with UPLO='U' are in the upper triangle
  • The vectors computed with UPLO='L' are in the lower triangle

(As described in ZHETRD, 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 ZUNGTR, set those entries to 1 before using them, and then restore them later. So they put the 1 in, then take it back out β€” respectful, actually 🫑)

VP

VP is COMPLEX*16 array of dimension ( max(NN)*max(NN+1)/2 ).

The matrix V stored in packed format.

TAU

TAU is COMPLEX*16 array of dimension ( max(NN) ).

The Householder factors computed by ZHETRD in reducing A to tridiagonal form ✨

Z

Z is COMPLEX*16 array of dimension ( LDU, max(NN) ).

The unitary matrix of eigenvectors computed by ZSTEQR, ZPTEQR, and ZSTEIN. Main character energy honestly πŸ‘‘

WORK

WORK is COMPLEX*16 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, she needs room to breathe πŸ’…

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.

RWORK

RWORK is DOUBLE PRECISION array. Short and sweet, no dimension given, she's mysterious 🌈

LRWORK

LRWORK is INTEGER. The number of entries in LRWORK (dimension( ??? ) β€” yeah the source page literally leaves it as ??? bestie, I can't make it up 😭)

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 β€” so the numbers stay cute and don't go feral πŸ’€

INFO

INFO β€” and that is literally all the page says for this one. It just exists. Iconic, no notes πŸ™ˆ

okay so bestie, we're picking up right where we left off β€” the INFO tea β˜•οΈ and then the local-variables lore. no cap, every single detail is staying.

  • INFO is INTEGER
  • If 0, then everything ran OK. ✨
  • -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.
  • If ZLATMR, CLATMS, ZHETRD, ZUNGTR, ZSTEQR, DSTERF, or ZUNMC2 returns an error code, the absolute value of it is returned.

✨ Some Local Variables and Parameters ✨

like, literally the whole cast of characters πŸ’…

  • ZERO, ONE β€” Real 0 and 1.
  • 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 620 of file zchkst2stg.f.


Author πŸ’…

Generated automatically by Doxygen for LAPACK from the source code.


and that's the whole page, bestie 🫢 huge shoutout to LAPACK Version 3.12.0 and the source file zchkst2stg.f(3) β€” it's giving iconic documentation energy, no cap πŸ’–βœ¨

πŸ“¦ where this page comes from