TESTING/EIG/schkbd.f(3)
π TESTING/EIG/schkbd.f π
Library Functions Manual
πΈ NAME πΈ
TESTING/EIG/schkbd.f β that's the file, bestie. It's the SCHKBD page, and it is a whole lot π.
β¨ SYNOPSIS β¨
π Functions/Subroutines π
subroutine schkbd (nsizes, mval, nval, ntypes, dotype, nrhs, iseed,
thresh, a, lda, bd, be, s1, s2, x, ldx, y, z, q, ldq, pt, ldpt, u,
vt, work, lwork, iwork, nout, info)
SCHKBD
π§ Function/Subroutine Documentation π§
subroutine schkbd (integer nsizes, integer, dimension( * ) mval, integer,
dimension( * ) nval, integer ntypes, logical, dimension( * ) dotype,
integer nrhs, integer, dimension( 4 ) iseed, real thresh, real,
dimension( lda, * ) a, integer lda, real, dimension( * ) bd, real,
dimension( * ) be, real, dimension( * ) s1, real, dimension( * ) s2,
real, dimension( ldx, * ) x, integer ldx, real, dimension( ldx, * ) y,
real, dimension( ldx, * ) z, real, dimension( ldq, * ) q, integer ldq,
real, dimension( ldpt, * ) pt, integer ldpt, real, dimension( ldpt, * )
u, real, dimension( ldpt, * ) vt, real, dimension( * ) work, integer
lwork, integer, dimension( * ) iwork, integer nout, integer info)
SCHKBD
SCHKBD β say it with your chest, periodt.
Purpose: π
okay so first thing: SCHKBD checks the singular value decomposition (SVD) routines. that's the whole mission π
.
SGEBRD reduces a real general m by n matrix A to upper or lower bidiagonal form B by an orthogonal transformation: Q' * A * P = B (or A = Q * B * P'). The matrix B is upper bidiagonal if m >= n and lower bidiagonal if m < n. slay, but make it bidiagonal.
SORGBR generates the orthogonal matrices Q and P' from SGEBRD. Note that Q and P are not necessarily square. not me expecting square matrices again π.
SBDSQR computes the singular value decomposition of the bidiagonal matrix B as B = U S V'. It is called three times to compute:
B = U S1 V', whereS1is the diagonal matrix of singular values and the columns of the matricesUandVare the left and right singular vectors, respectively, ofB.- Same as 1), but the singular values are stored in
S2and the singular vectors are not computed. A = (UQ) S (P'V'), the SVD of the original matrixA.
In addition, SBDSQR has an option to apply the left orthogonal matrix U to a matrix X, useful in least squares applications. least squares said "notice me" π«Ά.
SBDSDC computes the singular value decomposition of the bidiagonal matrix B as B = U S V' using divide-and-conquer. It is called twice to compute:
B = U S1 V', whereS1is the diagonal matrix of singular values and the columns of the matricesUandVare the left and right singular vectors, respectively, ofB.- Same as 1), but the singular values are stored in
S2and the singular vectors are not computed.
SBDSVDX computes the singular value decomposition of the bidiagonal matrix B as B = U S V' using bisection and inverse iteration. It is called six times to compute:
B = U S1 V',RANGE='A', whereS1is the diagonal matrix of singular values and the columns of the matricesUandVare the left and right singular vectors, respectively, ofB.- Same as 1), but the singular values are stored in
S2and the singular vectors are not computed. B = U S1 V',RANGE='I', whereS1is the diagonal matrix of singular values and the columns of the matricesUandVare the left and right singular vectors, respectively, ofB.- Same as 3), but the singular values are stored in
S2and the singular vectors are not computed. B = U S1 V',RANGE='V', whereS1is the diagonal matrix of singular values and the columns of the matricesUandVare the left and right singular vectors, respectively, ofB.- Same as 5), but the singular values are stored in
S2and the singular vectors are not computed.
For each pair of matrix dimensions (M,N) and each selected matrix type, an M by N matrix A and an M by NRHS matrix X are generated. The problem dimensions are as follows:
A: M x N
Q: M x min(M,N) (but M x M if NRHS > 0)
P: min(M,N) x N
B: min(M,N) x min(M,N)
U, V: min(M,N) x min(M,N)
S1, S2 diagonal, order min(M,N)
X: M x NRHS
For each generated matrix, 14 tests are performed. (the list says 14 and then keeps going to 34 β iconic, honestly) π.
Test SGEBRD and SORGBR
(1)β| A - Q B PT | / ( |A| max(M,N) ulp ), PT = P'(2)β| I - Q' Q | / ( M ulp )(3)β| I - PT PT' | / ( N ulp )
Test SBDSQR on bidiagonal matrix B
(4)β| B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V'(5)β| Y - U Z | / ( |Y| max(min(M,N),k) ulp ), where Y = Q' X and Z = U' Y.(6)β| I - U' U | / ( min(M,N) ulp )(7)β| I - VT VT' | / ( min(M,N) ulp )(8)βS1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)(9)β| S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V.(10)β0 if the true singular values of B are within THRESH of those in S1. 2*THRESH if they are not. (Tested using SSVDCH)
Test SBDSQR on matrix A
(11)β| A - (QU) S (VT PT) | / ( |A| max(M,N) ulp )(12)β| X - (QU) Z | / ( |X| max(M,k) ulp )(13)β| I - (QU)'(QU) | / ( M ulp )(14)β| I - (VT PT) (PT'VT') | / ( N ulp )
Test SBDSDC on bidiagonal matrix B
(15)β| B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V'(16)β| I - U' U | / ( min(M,N) ulp )(17)β| I - VT VT' | / ( min(M,N) ulp )(18)βS1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)(19)β| S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V.
Test SBDSVDX on bidiagonal matrix B
(20)β| B - U S1 VT | / ( |B| min(M,N) ulp ), VT = V'(21)β| I - U' U | / ( min(M,N) ulp )(22)β| I - VT VT' | / ( min(M,N) ulp )(23)βS1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)(24)β| S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V.(25)β| S1 - U' B VT' | / ( |S| n ulp ) SBDSVDX('V', 'I')(26)β| I - U' U | / ( min(M,N) ulp )(27)β| I - VT VT' | / ( min(M,N) ulp )(28)βS1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)(29)β| S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V.(30)β| S1 - U' B VT' | / ( |S1| n ulp ) SBDSVDX('V', 'V')(31)β| I - U' U | / ( min(M,N) ulp )(32)β| I - VT VT' | / ( min(M,N) ulp )(33)βS1 contains min(M,N) nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)(34)β| S1 - S2 | / ( |S1| ulp ), where S2 is computed without computing U and V.
The possible matrix types are:
(1)β The zero matrix.(2)β The identity matrix.(3)β A diagonal matrix with evenly spaced entries1, ..., ULPand random signs. (ULP = (first number larger than 1) - 1)(4)β A diagonal matrix with geometrically spaced entries1, ..., ULPand random signs.(5)β A diagonal matrix with entries1, ULP, ..., ULPand random signs.(6)β Same as(3), but multiplied bySQRT( overflow threshold )(7)β Same as(3), but multiplied bySQRT( underflow threshold )(8)β A matrix of the formU D V, whereUandVare orthogonal andDhas evenly spaced entries1, ..., ULPwith random signs on the diagonal.(9)β A matrix of the formU D V, whereUandVare orthogonal andDhas geometrically spaced entries1, ..., ULPwith random signs on the diagonal.(10)β A matrix of the formU D V, whereUandVare orthogonal andDhas entries1, ULP,..., ULPwith random signs on the diagonal.(11)β Same as(8), but multiplied bySQRT( overflow threshold )(12)β Same as(8), but multiplied bySQRT( underflow threshold )(13)β Rectangular matrix with random entries chosen from(-1,1).(14)β Same as(13), but multiplied bySQRT( overflow threshold )(15)β Same as(13), but multiplied bySQRT( underflow threshold )
Special case:
(16)β A bidiagonal matrix with random entries chosen from a logarithmic distribution on[ulp^2,ulp^(-2)](I.e., each entry ise^x, wherexis chosen uniformly on[ 2 log(ulp), -2 log(ulp) ].) For this type:- (a)
SGEBRDis not called to reduce it to bidiagonal form. - (b) the bidiagonal is
min(M,N) x min(M,N); ifM<N, the matrix will be lower bidiagonal, otherwise upper. - (c) only tests
5--8and14are performed.
- (a)
A subset of the full set of matrix types may be selected through the logical array DOTYPE. choose your fighter, bestie π¦.
Parameters π
NSIZES
NSIZESisINTEGER.- The number of values of
MandNcontained in the vectorsMVALandNVAL. The matrix sizes are used in pairs(M,N).
MVAL
MVALisINTEGER array, dimension (NM).- The values of the matrix row dimension
M.
NVAL
NVALisINTEGER array, dimension (NM).- The values of the matrix column dimension
N.
NTYPES
NTYPESβ INTEGER. The number of elements inDOTYPE. If itβs zero,SCHKBDdoes absolutely nothing. It must be at least zero. If itβsMAXTYP+1andNSIZESis 1, then an additional type,MAXTYP+1, is defined, and that one is the βuse whatever matrices are inAandBβ type. This is only useful ifDOTYPE(1:MAXTYP)is.FALSE.andDOTYPE(MAXTYP+1)is.TRUE.. π«ΆDOTYPEβ LOGICAL array, dimension(NTYPES). IfDOTYPE(j)is.TRUE., then for each size(m,n), a matrix of typejwill be generated. IfNTYPESis smaller than the maximum number of types defined (PARAMETER MAXTYP), then typesNTYPES+1throughMAXTYPwill not be generated. IfNTYPESis larger thanMAXTYP, thenDOTYPE(MAXTYP+1)throughDOTYPE(NTYPES)will be ignored. β¨NRHSβ INTEGER. The number of columns in the matricesX,Y, andZ, used in testingSBDSQR. IfNRHS = 0, then the operations on the right-hand side will not be tested.NRHSmust be at least 0. πISEEDβ INTEGER array, dimension(4). On entry,ISEEDspecifies 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 values ofISEEDare changed on exit, and can be used in the next call toSCHKBDto continue the same random number sequence. πTHRESHβ REAL. The threshold value for the test ratios. A result is included in the output file ifRESULT >= THRESH. To have every test ratio printed, useTHRESH = 0. Note that the expected value of the test ratios isO(1), soTHRESHshould be a reasonably small multiple of 1, e.g., 10 or 100. π₯Aβ REAL array, dimension(LDA,NMAX), whereNMAXis the maximum value ofNinNVAL. πΈLDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,MMAX), whereMMAXis the maximum value ofMinMVAL. πBDβ REAL array, dimension(max(min(MVAL(j),NVAL(j)))). π¦BEβ REAL array, dimension(max(min(MVAL(j),NVAL(j)))). πS1β REAL array, dimension(max(min(MVAL(j),NVAL(j)))). βS2β REAL array, dimension(max(min(MVAL(j),NVAL(j)))). πXβ REAL array, dimension(LDX,NRHS). πLDXβ INTEGER. The leading dimension of the arraysX,Y, andZ.LDX >= max(1,MMAX). π«ΆYβ REAL array, dimension(LDX,NRHS). πZβ REAL array, dimension(LDX,NRHS). π§Qβ REAL array, dimension(LDQ,MMAX). π«LDQβ INTEGER. The leading dimension of the arrayQ.LDQ >= max(1,MMAX). πPTβ REAL array, dimension(LDPT,NMAX). πLDPTβ INTEGER. The leading dimension of the arraysPT,U, andV.LDPT >= max(1, max(min(MVAL(j),NVAL(j)))). πUβ REAL array, dimension(LDPT,max(min(MVAL(j),NVAL(j)))). π₯VTβ REAL array, dimension(LDPT,max(min(MVAL(j),NVAL(j)))). πWORKβ REAL array, dimension(LWORK). πΈLWORKβ INTEGER. The number of entries inWORK. This must be at least3(M+N)andM(M + max(M,N,k) + 1) + N*min(M,N)for all pairs(M,N)=(MM(j),NN(j)). π«ΆIWORKβ INTEGER array, dimension at least8*min(M,N). πNOUTβ INTEGER. The FORTRAN unit number for printing out error messages (e.g., if a routine returnsIINFOnot equal to 0.). πINFOβ INTEGER. If 0, then everything ran OK. Hereβs the exact error tea:
If 0, then everything ran OK.
-1: NSIZES < 0
-2: Some MM(j) < 0
-3: Some NN(j) < 0
-4: NTYPES < 0
-6: NRHS < 0
-8: THRESH < 0
-11: LDA < 1 or LDA < MMAX, where MMAX is max( MM(j) ).
-17: LDB < 1 or LDB < MMAX.
-21: LDQ < 1 or LDQ < MMAX.
-23: LDPT< 1 or LDPT< MNMAX.
-27: LWORK too small.
If SLATMR, SLATMS, SGEBRD, SORGBR, or SBDSQR,
returns an error code, the
absolute value of it is returned.
π§ Some Local Variables and Parameters π§
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.MMAXβ Largest value inNN.NMAXβ Largest value inNN.MNMINβmin(MM(j), NN(j))(the dimension of the bidiagonal matrix.)MNMAXβ The maximum value ofMNMINforj=1,...,NSIZES.NFAILβ The number of tests which have exceededTHRESH.COND,IMODEβ Values to be passed to the matrix generators.ANORMβ Norm ofA; passed to matrix generators.OVFL,UNFLβ Overflow and underflow thresholds.RTOVFL,RTUNFLβ Square roots of the previous 2 values.ULP,ULPINVβ Finest relative precision and its inverse.
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 489 of file schkbd.f.
π€ Author π€
Generated automatically by Doxygen for LAPACK from the source code.
π Thatβs the whole page, bestie! Source/version: LAPACK, Version 3.12.0. Page: TESTING/EIG/schkbd.f(3). The footer as given doesnβt show a date, so Iβm not making one up β no fake timestamp energy here π
β¨
π¦ 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