TESTING/EIG/sbdt04.f(3)

πŸ“¦
version 3.12.1 Β· 3 versions
, in arch rolling

πŸ’… 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, SBDT04 itself πŸŽ€

✨ 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