TESTING/EIG/sbdt04.f(3)
π TESTING/EIG/sbdt04.f β the bidiagonal SVD vibe check
okay so bestie, welcome to TESTING/EIG/sbdt04.f, a manual page from the LAPACK library (yes, that LAPACK, the linear algebra icon herself β¨). It's real, it's here, and it's lowkey giving "quality control for your singular value decomposition."
πΈ SYNOPSIS β functions & subroutines
subroutine sbdt04 (uplo, n, d, e, s, ns, u, ldu, vt, ldvt, work, resid)β the one and only,SBDT04itself π
β¨ Function/Subroutine Documentation β¨
subroutine sbdt04 (character uplo, integer n, real, dimension( * ) d, real, dimension( * ) e, real, dimension( * ) s, integer ns, real, dimension( ldu, * ) u, integer ldu, real, dimension( ldvt, * ) vt, integer ldvt, real, dimension( * ) work, real resid)
SBDT04 β say it with me π«Ά
π― Purpose
fortran !> SBDT04 reconstructs a bidiagonal matrix B from its (partial) SVD: !> S = U' * B * V > where U and V are orthogonal matrices and S is diagonal. > > The test ratio to test the singular value decomposition is > RESID = norm( S - U' * B * V ) / ( n * norm(B) * EPS ) > where VT = V' and EPS is the machine precision. >
So basically: it takes a bidiagonal matrix B, rebuilds it from its (possibly partial) singular value decomposition, and then checks how badly reality diverged from the math. That ratio? That's the receipts π₯. EPS is the machine precision, VT is V', and norm is doing its thing.
π§Έ Parameters
UPLO
fortran !> UPLO is CHARACTER*1 !> Specifies whether the matrix B is upper or lower bidiagonal. !> = 'U': Upper bidiagonal !> = 'L': Lower bidiagonal
Pick your fighter: 'U' for upper bidiagonal, 'L' for lower. That's it, that's the whole choice π
N
fortran !> N is INTEGER !> The order of the matrix B.
How big is B? This many. The order, the main character energy of the whole operation π
D
fortran !> D is REAL array, dimension (N) !> The n diagonal elements of the bidiagonal matrix B.
The N diagonal elements of B. The main diagonal, the backbone, the moment β¨
E
fortran !> E is REAL array, dimension (N-1) !> The (n-1) superdiagonal elements of the bidiagonal matrix B !> if UPLO = 'U', or the (n-1) subdiagonal elements of B if !> UPLO = 'L'.
The off-diagonal bestie: (n-1) superdiagonals when UPLO = 'U', or (n-1) subdiagonals when UPLO = 'L'. It literally does both depending on the vibe check π¦
S
fortran !> S is REAL array, dimension (NS) !> The singular values from the (partial) SVD of B, sorted in !> decreasing order.
The singular values from the (partial) SVD of B, sorted in decreasing order. Big to small, no exceptions, we love a sorted queen π
NS
fortran !> NS is INTEGER !> The number of singular values/vectors from the (partial) !> SVD of B.
How many singular values/vectors we actually kept from the (partial) SVD. It's giving "we don't always need all of them" π
U
fortran !> U is REAL array, dimension (LDU,NS) !> The n by ns orthogonal matrix U in S = U' * B * V.
The n by ns orthogonal matrix U in S = U' * B * V. Orthogonal legend π
LDU
fortran !> LDU is INTEGER !> The leading dimension of the array U. LDU >= max(1,N)
The leading dimension of U. And it better be LDU >= max(1,N) β no cap, respect the bound π€
VT
fortran !> VT is REAL array, dimension (LDVT,N) !> The n by ns orthogonal matrix V in S = U' * B * V.
The n by ns orthogonal matrix V in S = U' * B * V. Note the plot twist: it arrives as VT, i.e. V'. Transposed and thriving π§
LDVT
fortran !> LDVT is INTEGER !> The leading dimension of the array VT.
The leading dimension of VT, plain and simple π
WORK
fortran !> WORK is REAL array, dimension (2*N)
Scratch workspace, dimension (2*N). Our behind-the-scenes icon β
RESID
fortran !> RESID is REAL !> The test ratio: norm(S - U' * B * V) / ( n * norm(B) * EPS )
The final verdict fr fr: norm(S - U' * B * V) / ( n * norm(B) * EPS ). Low number = slay. High number = π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 129 of file sbdt04.f.
tiny print bestie: this page was Generated automatically by Doxygen for LAPACK from the source code β so if it looks a little typed-by-a-robot, that's because it was π«Ά
okay that's the whole page, no notes. LAPACK, Version 3.12.0 π thanks for reading, 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