ZCHKBD(3)
β¨ ZCHKBD(3) β¨ β Library Functions Manual π
(part 1 of 2, bestie β more coming)
Header vibe check: this page is ZCHKBD(3) from the Library Functions Manual, and the header label that showed up twice is /home/abui...IG/zchkbd.f(3). The actual source path in NAME is /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/zchkbd.f. Slay.
β¨ NAME β¨
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/TESTING/EIG/zchkbd.f β literally the file this page is about, bestie. No cap.
π¦ SYNOPSIS π¦
π«Ά Functions/Subroutines π«Ά
subroutine ZCHKBD (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, rwork, nout, info)β the whole icon, right here:
subroutine ZCHKBD (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, rwork, nout, info)
ZCHKBDβ yes, it says its own name again. Main character energy, honestly.
π Function/Subroutine Documentation π
π«Ά subroutine ZCHKBD π«Ά
Here's the full typed-out glow-up of the signature, bestie:
subroutine ZCHKBD (integer nsizes, integer, dimension( * ) mval, integer,
dimension( * ) nval, integer ntypes, logical, dimension( * ) dotype,
integer nrhs, integer, dimension( 4 ) iseed, double precision thresh,
complex*16, dimension( lda, * ) a, integer lda, double precision,
dimension( * ) bd, double precision, dimension( * ) be, double
precision, dimension( * ) s1, double precision, dimension( * ) s2,
complex*16, dimension( ldx, * ) x, integer ldx, complex*16, dimension(
ldx, * ) y, complex*16, dimension( ldx, * ) z, complex*16, dimension(
ldq, * ) q, integer ldq, complex*16, dimension( ldpt, * ) pt, integer
ldpt, complex*16, dimension( ldpt, * ) u, complex*16, dimension( ldpt, *
) vt, complex*16, dimension( * ) work, integer lwork, double precision,
dimension( * ) rwork, integer nout, integer info)
ZCHKBD β again, because the docs said so π
πΈ Purpose: πΈ
Okay so ZCHKBD checks the singular value decomposition (SVD) routines. It is literally the vibe check for the SVD pipeline.
ZGEBRD reduces a complex general m by n matrix A to real upper or lower bidiagonal form 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.
ZUNGBR generates the orthogonal matrices Q and P' from ZGEBRD. Note that Q and P are not necessarily square. Important, bestie: not necessarily square.
ZBDSQR 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, ZBDSQR has an option to apply the left orthogonal matrix U to a matrix X, useful in least squares applications.
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:
π₯ Test ZGEBRD and ZUNGBR π₯
(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 ZBDSQR 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) 0 if the true singular values of B are within THRESH of
those in S1. 2*THRESH if they are not. (Tested using
DSVDCH)
(10) | S1 - S2 | / ( |S1| ulp ), where S2 is computed without
computing U and V.
π¦ Test ZBDSQR 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 )
The possible matrix types are:
- 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 (3), but multiplied by
SQRT( overflow threshold ) - Same as (3), but multiplied by
SQRT( underflow threshold ) - A matrix of the form
U D V, whereUandVare orthogonal andDhas evenly spaced entries1, ..., ULPwith random signs on the diagonal. - A matrix of the form
U D V, whereUandVare orthogonal andDhas geometrically spaced entries1, ..., ULPwith random signs on the diagonal. - A matrix of the form
U D V, whereUandVare 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 ) - Rectangular 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 )
Special case:
- 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)
ZGEBRDis 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.
π Parameters π
NSIZES
NSIZES is INTEGER β it's the number of values of M and N contained in the vectors MVAL and NVAL. The matrix sizes are used in pairs (M,N), periodt.
MVAL
MVAL is INTEGER array, dimension (NM) β the values of the matrix row dimension M.
NVAL
NVAL is INTEGER array, dimension (NM) β the values of the matrix column dimension N.
NTYPES
NTYPES is INTEGER β the number of elements in DOTYPE. If it is zero, ZCHKBD 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 matrices are in A and B. 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 (m,n), a matrix 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.
NRHS
NRHS is INTEGER β the number of columns in the matrices X, Y, and Z, used in testing ZBDSQR. If NRHS = 0, then the operations on the right-hand side will not be tested. NRHS must be at least 0.
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 values of ISEED are changed on exit, and can be used in the next call to ZCHKBD to continue the same random number sequence.
THRESH
THRESH is DOUBLE PRECISION β the threshold value for the test ratios. A result is included in the output file if RESULT >= THRESH. To have every test ratio printed, use THRESH = 0. Note that the expected value of the test ratios is O(1), so THRESH should be a reasonably small multiple of 1, e.g., 10 or 100.
bestie, if you set THRESH = 0 you're getting every single test ratio printed. Iconic but chatty.
A
A is COMPLEX*16 array, dimension (LDA,NMAX) where NMAX is the maximum value of N in NVAL.
LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,MMAX), where MMAX is the maximum value of M in MVAL.
BD
BD is DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j))))
BE
BE is DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j))))
S1
S1 is DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j))))
S2
S2 is DOUBLE PRECISION array, dimension (max(min(MVAL(j),NVAL(j))))
X
X is COMPLEX*16 array, dimension (LDX,NRHS)
LDX
LDX is INTEGER β the leading dimension of the arrays X, Y, and Z. LDX >= max(1,MMAX).
Y
Y is COMPLEX*16 array, dimension (LDX,NRHS)
Z
Z is COMPLEX*16 array, dimension (LDX,NRHS)
Q
Q β this is where part 1 stops, bestie; the next part picks up the rest of Q and the remaining parameters. π
Qβ it's aCOMPLEX*16array, dimension(LDQ,MMAX). πLDQβ anINTEGER. It's the leading dimension of the arrayQ. SoLDQ >= max(1,MMAX). Slay.PTβ aCOMPLEX*16array, dimension(LDPT,NMAX). β¨LDPTβ anINTEGER. It's the leading dimension of the arraysPT,U, andV. SoLDPT >= max(1, max(min(MVAL(j),NVAL(j)))). Periodt.Uβ aCOMPLEX*16array, dimension(LDPT,max(min(MVAL(j),NVAL(j)))). πVTβ aCOMPLEX*16array, dimension(LDPT,max(min(MVAL(j),NVAL(j)))). Iconic.WORKβ aCOMPLEX*16array, dimension(LWORK). π«ΆLWORKβ anINTEGER. 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)). No cap.RWORKβ aDOUBLE PRECISIONarray, dimension(5*max(min(M,N))). πΈNOUTβ anINTEGER. The FORTRAN unit number for printing out error messages (e.g., if a routine returnsIINFOnot equal to 0). Lowkey important.INFOβ anINTEGER. If 0, then everything ran OK. π-1:NSIZES < 0-2: SomeMM(j) < 0-3: SomeNN(j) < 0-4:NTYPES < 0-6:NRHS < 0-8:THRESH < 0-11:LDA < 1orLDA < MMAX, whereMMAXismax( MM(j) ).-17:LDB < 1orLDB < MMAX.-21:LDQ < 1orLDQ < MMAX.-23:LDP < 1orLDP < MNMAX.-27:LWORKtoo small.- If
ZLATMR,CLATMS,ZGEBRD,ZUNGBR, orZBDSQR, returns an error code, the absolute value of it is returned. π
π Some Local Variables and Parameters π
ZERO,ONEβ Real 0 and 1. Basic but essential. π―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. (Yes really, that's what it says. π)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 411 of file zchkbd.f.
π Author (generated) π
Generated automatically by Doxygen for LAPACK from the source code.
This iconic page comes from LAPACK Version 3.12.0, file /home/abui...IG/zchkbd.f(3) β no cap, bestie! β¨π
π¦ 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