SDRVBD(3)

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

πŸ’… SDRVBD(3) β€” Library Functions Manual πŸŽ€

okay bestie so this is sdrvbd.f(3) straight out of the Library Functions Manual β€” LAPACK's own SVD test-driver, and she is thorough. buckle up πŸ¦‹


🌸 NAME 🌸

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

like, that's the whole path, no cap. it's the file, that's the name, we don't make the rules πŸ’€


✨ SYNOPSIS ✨

Functions/Subroutines

  • subroutine SDRVBD β€” the one, the only, the main character πŸ‘‘
subroutine SDRVBD (nsizes, mm, nn, ntypes, dotype, iseed, thresh, a,
    lda, u, ldu, vt, ldvt, asav, usav, vtsav, s, ssav, e, work, lwork,
    iwork, nout, info)

SDRVBD. that's it. that's the synopsis. iconic behavior honestly 🫢


πŸ¦‹ Function/Subroutine Documentation πŸ¦‹

the full signature, typed out, no shortcuts

subroutine SDRVBD (integer nsizes, integer, dimension( * ) mm, integer,
    dimension( * ) nn, integer ntypes, logical, dimension( * ) dotype,
    integer, dimension( 4 ) iseed, real thresh, real, dimension( lda, * ) a,
    integer lda, real, dimension( ldu, * ) u, integer ldu, real, dimension(
    ldvt, * ) vt, integer ldvt, real, dimension( lda, * ) asav, real,
    dimension( ldu, * ) usav, real, dimension( ldvt, * ) vtsav, real,
    dimension( * ) s, real, dimension( * ) ssav, real, dimension( * ) e,
    real, dimension( * ) work, integer lwork, integer, dimension( * ) iwork,
    integer nout, integer info)

SDRVBD πŸ’–


🌈 Purpose 🌈

okay so literally what she does: SDRVBD checks the singular value decomposition (SVD) drivers SGESVD, SGESDD, SGESVDQ, SGESVJ, SGEJSV, and DGESVDX. (yes, DGESVDX is in there too, she's the double-precision guest star, don't ask πŸ’…)

Both SGESVD and SGESDD factor A = U diag(S) VT, where U and VT are orthogonal and diag(S) is diagonal with the entries of the array S on its diagonal. The entries of S are the singular values, nonnegative and stored in decreasing order. U and VT can be optionally not computed, overwritten on A, or computed partially. (she's flexible like that ✨)

A is M by N. Let MNMIN = min( M, N ). S has dimension MNMIN. U can be M by M or M by MNMIN. VT can be N by N or MNMIN by N.

When SDRVBD is called, a number of matrix sizes (M's and N's) and a number of matrix types are specified. For each size (M,N) and each type of matrix, and for the minimal workspace as well as workspace adequate to permit blocking, an M x N matrix will be generated and used to test the SVD routines. For each matrix, A will be factored as A = U diag(S) VT and the following 12 tests computed: (12 tests!! she's an overachiever, we stan 🌟)

fr fr this is where it gets spicy. every single test, in order, coming right up πŸ‘‡

Test for SGESVD

  • (1) | A - U diag(S) VT | / ( |A| max(M,N) ulp )
  • (2) | I - U'U | / ( M ulp )
  • (3) | I - VT VT' | / ( N ulp )
  • (4) S contains MNMIN nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)
  • (5) | U - Upartial | / ( M ulp ) where Upartial is a partially computed U.
  • (6) | VT - VTpartial | / ( N ulp ) where VTpartial is a partially computed VT.
  • (7) | S - Spartial | / ( MNMIN ulp |S| ) where Spartial is the vector of singular values from the partial SVD

Test for SGESDD

  • (8) | A - U diag(S) VT | / ( |A| max(M,N) ulp )
  • (9) | I - U'U | / ( M ulp )
  • (10) | I - VT VT' | / ( N ulp )
  • (11) S contains MNMIN nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)
  • (12) | U - Upartial | / ( M ulp ) where Upartial is a partially computed U.
  • (13) | VT - VTpartial | / ( N ulp ) where VTpartial is a partially computed VT.
  • (14) | S - Spartial | / ( MNMIN ulp |S| ) where Spartial is the vector of singular values from the partial SVD

Test for SGESVDQ

yes the numbering jumps, no we are not fixing it, that's canon 😭
  • (36) | A - U diag(S) VT | / ( |A| max(M,N) ulp )
  • (37) | I - U'U | / ( M ulp )
  • (38) | I - VT VT' | / ( N ulp )
  • (39) S contains MNMIN nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)

Test for SGESVJ

  • (15) | A - U diag(S) VT | / ( |A| max(M,N) ulp )
  • (16) | I - U'U | / ( M ulp )
  • (17) | I - VT VT' | / ( N ulp )
  • (18) S contains MNMIN nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)

Test for SGEJSV

  • (19) | A - U diag(S) VT | / ( |A| max(M,N) ulp )
  • (20) | I - U'U | / ( M ulp )
  • (21) | I - VT VT' | / ( N ulp )
  • (22) S contains MNMIN nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)

Test for SGESVDX( 'V', 'V', 'A' )/SGESVDX( 'N', 'N', 'A' )

  • (23) | A - U diag(S) VT | / ( |A| max(M,N) ulp )
  • (24) | I - U'U | / ( M ulp )
  • (25) | I - VT VT' | / ( N ulp )
  • (26) S contains MNMIN nonnegative values in decreasing order. (Return 0 if true, 1/ULP if false.)
  • (27) | U - Upartial | / ( M ulp ) where Upartial is a partially computed U.
  • (28) | VT - VTpartial | / ( N ulp ) where VTpartial is a partially computed VT.
  • (29) | S - Spartial | / ( MNMIN ulp |S| ) where Spartial is the vector of singular values from the partial SVD

Test for SGESVDX( 'V', 'V', 'I' )

  • (30) | U' A VT''' - diag(S) | / ( |A| max(M,N) ulp )
  • (31) | I - U'U | / ( M ulp )
  • (32) | I - VT VT' | / ( N ulp )

Test for SGESVDX( 'V', 'V', 'V' )

  • (33) | U' A VT''' - diag(S) | / ( |A| max(M,N) ulp )
  • (34) | I - U'U | / ( M ulp )
  • (35) | I - VT VT' | / ( N ulp )

and now, the sizes and types πŸŽ€

The sizes are specified by the arrays MM(1:NSIZES) and NN(1:NSIZES); the value of each element pair (MM(j),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 matrix of the form U D V, where U and V are orthogonal and D has evenly spaced entries 1, ..., ULP with random signs on the diagonal.
  4. Same as (3), but multiplied by the underflow-threshold / ULP.
  5. Same as (3), but multiplied by the overflow-threshold * ULP.

(five whole types, she really said "let me cook" πŸ”₯)


πŸ’œ Parameters πŸ’œ

NSIZES

NSIZES is INTEGER The number of matrix sizes (M,N) contained in the vectors MM and NN.

MM

MM is INTEGER array, dimension (NSIZES) The values of the matrix row dimension M.

NN

NN is INTEGER array, dimension (NSIZES) The values of the matrix column dimension N.

NTYPES

NTYPES is INTEGER The number of elements in DOTYPE. If it is zero, SDRVBD 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.

ISEED

ISEED is INTEGER array, dimension (4) On entry, 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. On exit, ISEED is changed and can be used in the next call to SDRVBD to continue the same random number sequence.

okay this one matters: the elements should be between 0 and 4095 (not, they get reduced mod 4096), and ISEED(4) must be odd. don't come for me, that's just the rules πŸ™ˆ

THRESH

THRESH is REAL The threshold value for the test ratios. A result is included in the output file if RESULT >= THRESH. The test ratios are scaled to be O(1), so THRESH should be a small multiple of 1, e.g., 10 or 100. To have every test ratio printed, use THRESH = 0.

A

A is REAL array, dimension (LDA,NMAX) where NMAX is the maximum value of N in NN.

LDA

LDA is INTEGER The leading dimension of the array A. LDA >= max(1,MMAX), where MMAX is the maximum value of M in MM.

U

U is REAL array, dimension (LDU,MMAX)

LDU

LDU is INTEGER The leading dimension of the array U. LDU >= max(1,MMAX).

VT

VT is REAL array, dimension (LDVT,NMAX)

LDVT

LDVT is INTEGER The leading dimension of the array VT. LDVT >= max(1,NMAX).

ASAV

ASAV is REAL array, dimension (LDA,NMAX)

USAV

USAV is REAL array, dimension (LDU,MMAX)

VTSAV

VTSAV is REAL array, dimension (LDVT,NMAX)

S

S is REAL array, dimension (max(min(MM,NN)))

SSAV

SSAV is REAL array, dimension (max(min(MM,NN)))

E

E is REAL array, dimension (max(min(MM,NN)))

WORK

WORK is REAL array, dimension (LWORK)

LWORK

LWORK is INTEGER The number of entries in WORK. This must be at least max(3*MN+MX,5*MN-4)+2*MN**2 for all pairs pairs (MN,MX)=( min(MM(j),NN(j), max(MM(j),NN(j)) )

lowkey obsessed with how the original says "pairs pairs" β€” leaving that exactly as-is, it's part of the lore πŸ’€

IWORK

IWORK is INTEGER array, dimension at least 8*min(M,N)

NOUT πŸ’œ

NOUT is INTEGER bestie β€” it's the FORTRAN unit number for printing out error messages, like when a routine comes back with IINFO not equal to 0. Basically it's the little mailbox where the complaints get dropped off. πŸ“¬


INFO 🌸

INFO is INTEGER, and she's the vibe check of the whole run. If it's 0, then everything ran OK β€” we love a flawless no-notes moment, periodt. ✨

Otherwise, here's the whole receipts list, no cap:

  • -1: NSIZES < 0
  • -2: Some MM(j) < 0
  • -3: Some NN(j) < 0
  • -4: NTYPES < 0
  • -7: THRESH < 0
  • -10: LDA < 1 or LDA < MMAX, where MMAX is max( MM(j) ).
  • -12: LDU < 1 or LDU < MMAX.
  • -14: LDVT < 1 or LDVT < NMAX, where NMAX is max( NN(j) ).
  • -21: LWORK too small.
  • If SLATMS, or SGESVD returns an error code, the absolute value of it is returned.
🫢 Note the vibe: those last two are a whole different flavour of INFO β€” when SLATMS or SGESVD hands back an error code, you get the absolute value of it. Not the signed one. The abs. iykyk.

πŸ‘‘ Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

Definition at line 363 of file sdrvbd.f.


πŸŽ€ Author

Generated automatically by Doxygen for LAPACK from the source code β€” so like, nobody hand-wrote this bit, the tooling did it. Slay, automation. πŸ’…


That's the whole page, bestie!! πŸ¦‹ This was LAPACK Version 3.12.0, living at /home/abui...IG/sdrvbd.f(3) β€” screenshot it, bookmark it, tattoo it on your forearm, whatever works for you. Go forth and read your INFO codes with main character energy. πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from