TESTING/EIG/ddrgsx.f(3)
Bestie, welcome to TESTING/EIG/ddrgsx.f(3) from the Library Functions Manual โ yes, thatโs the manual-name vibe folded in right at the top. ๐
๐ธ NAME ๐ธ
TESTING/EIG/ddrgsx.f
โจ SYNOPSIS โจ
๐ Functions/Subroutines ๐
subroutine ddrgsx (nsize, ncmax, thresh, nin, nout, a, lda, b, ai, bi,
z, q, alphar, alphai, beta, c, ldc, s, work, lwork, iwork, liwork,
bwork, info)
DDRGSX โ the subroutine in question, and honestly sheโs doing a lot.
๐ฆ Function/Subroutine Documentation ๐ฆ
subroutine ddrgsx (integer nsize, integer ncmax, double precision thresh,
integer nin, integer nout, double precision, dimension( lda, * ) a,
integer lda, double precision, dimension( lda, * ) b, double precision,
dimension( lda, * ) ai, double precision, dimension( lda, * ) bi, double
precision, dimension( lda, * ) z, double precision, dimension( lda, * )
q, double precision, dimension( * ) alphar, double precision, dimension(
* ) alphai, double precision, dimension( * ) beta, double precision,
dimension( ldc, * ) c, integer ldc, double precision, dimension( * ) s,
double precision, dimension( * ) work, integer lwork, integer,
dimension( * ) iwork, integer liwork, logical, dimension( * ) bwork,
integer info)
DDRGSX
๐ Purpose ๐
Okay so DDRGSX checks the nonsymmetric generalized eigenvalue (Schur form) problem expert driver DGGESX. Iconic behavior, no notes. ๐
DGGESX factors A and B as Q S Z' and Q T Z', where ' means transpose, T is upper triangular, S is in generalized Schur form (block upper triangular, with 1x1 and 2x2 blocks on the diagonal, the 2x2 blocks corresponding to complex conjugate pairs of generalized eigenvalues), and Q and Z are orthogonal. It also computes the generalized eigenvalues (alpha(1),beta(1)), ..., (alpha(n),beta(n)). Thus, w(j) = alpha(j)/beta(j) is a root of the characteristic equation
det( A - w(j) B ) = 0
Optionally it also reorders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal block of the Schur forms; computes a reciprocal condition number for the average of the selected eigenvalues; and computes a reciprocal condition number for the right and left deflating subspaces corresponding to the selected eigenvalues.
When DDRGSX is called with NSIZE > 0, five (5) types of built-in matrix pairs are used to test the routine DGGESX. โจ
When DDRGSX is called with NSIZE = 0, it reads in test matrix data to test DGGESX.
For each matrix pair, the following tests will be performed and compared with the threshold THRESH except for the tests (7) and (9):
| A - Q S Z' | / ( |A| n ulp )| B - Q T Z' | / ( |B| n ulp )| I - QQ' | / ( n ulp )| I - ZZ' | / ( n ulp )- if
Ais in Schur form (i.e. quasi-triangular form) - maximum over
jofD(j)where:
if alpha(j) is real:
|alpha(j) - S(j,j)| |beta(j) - T(j,j)|
D(j) = ------------------------ + -----------------------
max(|alpha(j)|,|S(j,j)|) max(|beta(j)|,|T(j,j)|)
if alpha(j) is complex:
| det( s S - w T ) |
D(j) = ---------------------------------------------------
ulp max( s norm(S), |w| norm(T) )*norm( s S - w T )
and S and T are here the 2 x 2 diagonal blocks of S and T corresponding to the j-th and j+1-th eigenvalues.
- if sorting worked and
SDIMis the number of eigenvalues which were selected. - the estimated value
DIFdoes not differ from the true values ofDifuandDiflmore than a factor10*THRESH. If the estimateDIFequals zero the corresponding true values ofDifuandDiflshould be less thanEPS*norm(A, B). If the true value ofDifuandDiflequal zero, the estimateDIFshould be less thanEPS*norm(A, B). - If
INFO = N+3is returned byDGGESX, the reordering and we check thatDIF = PL = PR = 0and that the true value ofDifuandDiflis< EPS*norm(A, B). We count the events whenINFO=N+3.
For read-in test matrices, the above tests are run except that the exact value for DIF (and PL) is input data. Additionally, there is one more test run for read-in test matrices:
- the estimated value
PLdoes not differ from the true value ofPLTRUmore than a factorTHRESH. If the estimatePLequals zero the corresponding true value ofPLTRUshould be less thanEPS*norm(A, B). If the true value ofPLTRUequal zero, the estimatePLshould be less thanEPS*norm(A, B).
Note that for the built-in tests, a total of 10*NSIZE*(NSIZE-1) matrix pairs are generated and tested. NSIZE should be kept small. ๐ซถ
SVD (routine DGESVD) is used for computing the true value of DIF_u and DIF_l when testing the built-in test problems.
๐งช Built-in Test Matrices ๐งช
All built-in test matrices are the 2 by 2 block of triangular matrices
A = [ A11 A12 ] and B = [ B11 B12 ]
[ A22 ] [ B22 ]
where for different type of A11 and A22 are given as the following. A12 and B12 are chosen so that the generalized Sylvester equation
A11*R - L*A22 = -A12
B11*R - L*B22 = -B12
have prescribed solution R and L.
Type 1:
Type 1: A11 = J_m(1,-1) and A_22 = J_k(1-a,1).
B11 = I_m, B22 = I_k
where J_k(a,b) is the k-by-k Jordan block with ``a'' on
diagonal and ``b'' on superdiagonal.
Type 2:
Type 2: A11 = (a_ij) = ( 2(.5-sin(i)) ) and
B11 = (b_ij) = ( 2(.5-sin(ij)) ) for i=1,...,m, j=i,...,m
A22 = (a_ij) = ( 2(.5-sin(i+j)) ) and
B22 = (b_ij) = ( 2(.5-sin(ij)) ) for i=m+1,...,k, j=i,...,k
Type 3:
Type 3: A11, A22 and B11, B22 are chosen as for Type 2, but each
second diagonal block in A_11 and each third diagonal block
in A_22 are made as 2 by 2 blocks.
Type 4:
Type 4: A11 = ( 20(.5 - sin(ij)) ) and B22 = ( 2(.5 - sin(i+j)) )
for i=1,...,m, j=1,...,m and
A22 = ( 20(.5 - sin(i+j)) ) and B22 = ( 2(.5 - sin(ij)) )
for i=m+1,...,k, j=m+1,...,k
Type 5:
Type 5: (A,B) and have potentially close or common eigenvalues and
very large departure from block diagonality A_11 is chosen
as the m x m leading submatrix of A_1:
| 1 b |
| -b 1 |
| 1+d b |
| -b 1+d |
A_1 = | d 1 |
| -1 d |
| -d 1 |
| -1 -d |
| 1 |
and A_22 is chosen as the k x k leading submatrix of A_2:
| -1 b |
| -b -1 |
| 1-d b |
| -b 1-d |
A_2 = | d 1+b |
| -1-b d |
| -d 1+b |
| -1+b -d |
| 1-d |
and matrix B are chosen as identity matrices (see DLATM5).
๐ง Parameters ๐ง
NSIZEโNSIZE is INTEGER. The maximum size of the matrices to use.NSIZE >= 0. IfNSIZE = 0, no built-in tests matrices are used, but read-in test matrices are used to testDGGESX. ๐ซNCMAXโNCMAX is INTEGER. Maximum allowableNMAXfor generating Kroneker matrix in call toDLAKF2.THRESHโTHRESH is DOUBLE PRECISION. A test will count as a failure if the error, 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.THRESH >= 0. ๐ฅNINโNIN is INTEGER. TheFORTRANunit number for reading in the data file of problems to solve.NOUTโNOUT is INTEGER. TheFORTRANunit number for printing out error messages (e.g., if a routine returnsIINFOnot equal to0.).AโA is DOUBLE PRECISION array, dimension (LDA, NSIZE). Used to store the matrix whose eigenvalues are to be computed. On exit,Acontains the last matrix actually used.LDAโLDA is INTEGER. The leading dimension ofA,B,AI,BI,ZandQ,LDA >= max( 1, NSIZE ). For the read-in test,LDA >= max( 1, N ),Nis the size of the test matrices.BโB is DOUBLE PRECISION array, dimension (LDA, NSIZE). Used to store the matrix whose eigenvalues are to be computed. On exit,Bcontains the last matrix actually used.AIโAI is DOUBLE PRECISION array, dimension (LDA, NSIZE). Copy ofA, modified byDGGESX.BIโBI is DOUBLE PRECISION array, dimension (LDA, NSIZE). Copy ofB, modified byDGGESX.ZโZโDOUBLE PRECISIONarray, dimension(LDA, NSIZE). This one's holding the left Schur vectors thatDGGESXcomputed. So it's not just some random matrix, it's the actual receipts fromDGGESX. ๐QโDOUBLE PRECISIONarray, dimension(LDA, NSIZE). And this cutie holds the right Schur vectors, also computed byDGGESX. Left and right, both accounted for, we love a matched set. ๐ALPHARโDOUBLE PRECISIONarray, dimension(NSIZE). The real part of the eigenvalue situation, living over here. โจALPHAIโDOUBLE PRECISIONarray, dimension(NSIZE). The imaginary part, right next toALPHAR, as one does.BETAโDOUBLE PRECISIONarray, dimension(NSIZE). And on exit,(ALPHAR + ALPHAI*i)/BETAare the eigenvalues. That's the whole girl math of this routine, no cap. ๐งฎCโDOUBLE PRECISIONarray, dimension(LDC, LDC). This is where we store the matrix generated by subroutineDLAKF2โ literally the matrix formed by Kronecker products used for estimatingDIF. Kronecker products fr fr, she's doing the most. ๐ญLDCโINTEGER. The leading dimension ofC. Lowkey important:LDC >= max(1, LDA*LDA/2 ). Get it wrong and it's giving illegal value, and not in the fun way. ๐SโDOUBLE PRECISIONarray, dimension(LDC). Singular values ofC. That's it, that's the whole vibe check. โญWORKโDOUBLE PRECISIONarray, dimension(LWORK). Workspace! Everyone needs a little room to be themselves. ๐ฆLWORKโINTEGER. The dimension of the arrayWORK, and she has requirements, bestie:
LWORK >= MAX( 5*NSIZE*NSIZE/2 - 2, 10*(NSIZE+1) )
Not a suggestion. It's giving "respect the math." ๐ฅ
IWORKโINTEGERarray, dimension(LIWORK). The integer workspace, akaWORK's integer bestie.LIWORKโINTEGER. The dimension of the arrayIWORK, and the rule isLIWORK >= NSIZE + 6. Simple. Iconic. Don't fight it. ๐BWORKโLOGICALarray, dimension(LDA). Logical array, so true/false vibes only. ๐ธINFOโINTEGER. The final verdict, the exit report, the tea:= 0: successful exit โ slay, we ate. โจ< 0: ifINFO = -i, the i-th argument had an illegal value. So if this pops up, an argument was not it. ๐> 0: a routine returned an error code. Somewhere down the chain somebody fumbled. ๐ญ
๐ซถ Author ๐ซถ
OK so the people behind this whole thing, absolute main characters, we're thanking:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 356 of file ddrgsx.f. Yes, go look at it, it's right there. ๐
โจ Author โจ
This page is generated automatically by Doxygen for LAPACK from the source code. Not a human typing it out with her little hands โ the machine does it. And she ate. ๐ค๐
And that's the page, bestie! This whole thing comes from LAPACK, Version 3.12.0, for TESTING/EIG/ddrgsx.f(3) โ cute source, cute version, and yep, the original footer carries its date too, so shoutout to the timestamp for keeping it real. ๐๐ง Love u, go run your tests, mwah. ๐
๐ฆ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms