SRC/sbbcsd.f(3)

πŸ’… SRC/sbbcsd.f ✨

okay so bestie, welcome to SRC/sbbcsd.f πŸ’– β€” this is a <pink>Library Functions Manual</pink> moment and honestly it's giving main character energy. Sit down, grab a strawberry πŸ“, we're doing bidiagonal-block CS decomposition together and it's gonna slay.


✨ SYNOPSIS ✨

πŸŽ€ Functions/Subroutines

subroutine sbbcsd (jobu1, jobu2, jobv1t, jobv2t, trans, m, p, q, theta,
    phi, u1, ldu1, u2, ldu2, v1t, ldv1t, v2t, ldv2t, b11d, b11e, b12d,
    b12e, b21d, b21e, b22d, b22e, work, lwork, info)

SBBCSD πŸ¦‹


🌸 Function/Subroutine Documentation 🌸

πŸ’œ the actual subroutine, spelled out

subroutine sbbcsd (character jobu1, character jobu2, character jobv1t,
    character jobv2t, character trans, integer m, integer p, integer q,
    real, dimension( * ) theta, real, dimension( * ) phi, real, dimension(
    ldu1, * ) u1, integer ldu1, real, dimension( ldu2, * ) u2, integer ldu2,
    real, dimension( ldv1t, * ) v1t, integer ldv1t, real, dimension( ldv2t,
    * ) v2t, integer ldv2t, real, dimension( * ) b11d, real, dimension( * )
    b11e, real, dimension( * ) b12d, real, dimension( * ) b12e, real,
    dimension( * ) b21d, real, dimension( * ) b21e, real, dimension( * )
    b22d, real, dimension( * ) b22e, real, dimension( * ) work, integer
    lwork, integer info)

SBBCSD β€” yeah that's the whole vibe, she's iconic πŸ‘‘


πŸ”₯ Purpose πŸ”₯

ok so SBBCSD computes the CS decomposition of an orthogonal matrix that's in bidiagonal-block form, and the way that it does this is genuinely so satisfying. look at her:

    [ B11 | B12 0  0 ]
    [  0  |  0 -I  0 ]
X = [----------------]
    [ B21 | B22 0  0 ]
    [  0  |  0  0  I ]

                              [  C | -S  0  0 ]
                  [ U1 |    ] [  0 |  0 -I  0 ] [ V1 |    ]**T
                = [---------] [---------------] [---------]   .
                  [    | U2 ] [  S |  C  0  0 ] [    | V2 ]
                              [  0 |  0  0  I ]

so X is M-by-M, its top-left block is P-by-Q, and Q must be no larger than P, M-P, or M-Q β€” no negotiations on that one bestie πŸ™ˆ (if Q is not the smallest index, then X must be transposed and/or permuted. this can be done in constant time using the TRANS and SIGNS options. see SORCSD for details.)

the bidiagonal matrices B11, B12, B21, and B22 are represented implicitly by angles THETA(1:Q) and PHI(1:Q-1) ✨

the orthogonal matrices U1, U2, V1T, and V2T are input/output. the input matrices are pre- or post-multiplied by the appropriate singular vector matrices. it's giving teamwork, fr fr 🫢


πŸ’… Parameters πŸ’…

  • JOBU1 β€” is CHARACTER. = 'Y': U1 is updated; otherwise: U1 is not updated.
  • JOBU2 β€” is CHARACTER. = 'Y': U2 is updated; otherwise: U2 is not updated.
  • JOBV1T β€” is CHARACTER. = 'Y': V1T is updated; otherwise: V1T is not updated.
  • JOBV2T β€” is CHARACTER. = 'Y': V2T is updated; otherwise: V2T is not updated.
  • TRANS β€” is CHARACTER. = 'T': X, U1, U2, V1T, and V2T are stored in row-major order; otherwise: X, U1, U2, V1T, and V2T are stored in column-major order.
  • M β€” is INTEGER. the number of rows and columns in X, the orthogonal matrix in bidiagonal-block form.
  • P β€” is INTEGER. the number of rows in the top-left block of X. 0 <= P <= M.
  • Q β€” is INTEGER. the number of columns in the top-left block of X. 0 <= Q <= MIN(P,M-P,M-Q).
  • THETA β€” is REAL array, dimension (Q). on entry, the angles THETA(1),...,THETA(Q) that, along with PHI(1), ...,PHI(Q-1), define the matrix in bidiagonal-block form. on exit, the angles whose cosines and sines define the diagonal blocks in the CS decomposition. glow-up incoming πŸ’«
  • PHI β€” is REAL array, dimension (Q-1). the angles PHI(1),...,PHI(Q-1) that, along with THETA(1),...,THETA(Q), define the matrix in bidiagonal-block form.
  • U1 β€” is REAL array, dimension (LDU1,P). on entry, a P-by-P matrix. on exit, U1 is postmultiplied by the left singular vector matrix common to [ B11 ; 0 ] and [ B12 0 0 ; 0 -I 0 0 ].
  • LDU1 β€” is INTEGER. the leading dimension of the array U1, LDU1 >= MAX(1,P). respect the leading dimension, she's load-bearing πŸŽ€
  • U2 β€” is REAL array, dimension (LDU2,M-P). on entry, an (M-P)-by-(M-P) matrix. on exit, U2 is postmultiplied by the left singular vector matrix common to [ B21 ; 0 ] and [ B22 0 0 ; 0 0 I ].
  • LDU2 β€” is INTEGER. the leading dimension of the array U2, LDU2 >= MAX(1,M-P).
  • V1T β€” is REAL array, dimension (LDV1T,Q). on entry, a Q-by-Q matrix. on exit, V1T is premultiplied by the transpose of the right singular vector matrix common to [ B11 ; 0 ] and [ B21 ; 0 ].
  • LDV1T β€” is INTEGER. the leading dimension of the array V1T, LDV1T >= MAX(1,Q).
  • V2T β€” is REAL array, dimension (LDV2T,M-Q). on entry, an (M-Q)-by-(M-Q) matrix. on exit, V2T is premultiplied by the transpose of the right singular vector matrix common to [ B12 0 0 ; 0 -I 0 0 ] and [ B22 0 0 ; 0 0 I ].
  • LDV2T β€” is INTEGER. the leading dimension of the array V2T, LDV2T >= MAX(1,M-Q).
  • B11D β€” is REAL array, dimension (Q). when SBBCSD converges, B11D contains the cosines of THETA(1), ..., THETA(Q). if SBBCSD fails to converge, then B11D contains the diagonal of the partially reduced top-left block. 😭 the failure case is real, note it.
  • B11E β€” is REAL array, dimension (Q-1). when SBBCSD converges, B11E contains zeros. if SBBCSD fails to converge, then B11E contains the superdiagonal of the partially reduced top-left block.
  • B12D β€” is REAL array, dimension (Q). when SBBCSD converges, B12D contains the negative sines of THETA(1), ..., THETA(Q). if SBBCSD fails to converge, then B12D contains the diagonal of the partially reduced top-right block.
  • B12E β€” is REAL array, dimension (Q-1). when SBBCSD converges, B12E contains zeros. if SBBCSD fails to converge, then B12E contains the subdiagonal of the partially reduced top-right block.
  • B21D β€” is REAL array, dimension (Q). when SBBCSD converges, B21D contains the negative sines of THETA(1), ..., THETA(Q). if SBBCSD fails to converge, then B21D contains the diagonal of the partially reduced bottom-left block.
  • B21E β€” is REAL array, dimension (Q-1). when SBBCSD converges, B21E contains zeros. if SBBCSD fails to converge, then B21E contains the subdiagonal of the partially reduced bottom-left block.
  • B22D β€” is REAL array, dimension (Q). when SBBCSD converges, B22D contains the negative sines of THETA(1), ..., THETA(Q). if SBBCSD fails to converge, then B22D contains the diagonal of the partially reduced bottom-right block.
  • B22E β€” is REAL array, dimension (Q-1). when SBBCSD converges, B22E contains zeros. if SBBCSD fails to converge, then B22E contains the subdiagonal of the partially reduced bottom-right block.
  • WORK β€” is REAL array, dimension (MAX(1,LWORK)). on exit, if INFO = 0, WORK(1) returns the optimal LWORK. πŸ‘‘
  • LWORK β€” is INTEGER. the dimension of the array WORK. LWORK >= MAX(1,8*Q).

if LWORK = -1, then a workspace query is assumed β€” the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the work array, and no error message related to LWORK is issued by XERBLA. it's giving "just checking the size bestie, no drama" πŸ’…

  • INFO β€” is INTEGER. = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. > 0: if SBBCSD did not converge, INFO specifies the number of nonzero entries in PHI, and B11D, B11E, etc., contain the partially reduced matrix. 🫢 heads up, this one matters.

🧚 Internal Parameters 🧚

  • TOLMUL β€” REAL, default = MAX(10,MIN(100,EPS**(-1/8))). TOLMUL controls the convergence criterion of the QR loop. angles THETA(i), PHI(i) are rounded to 0 or PI/2 when they are within TOLMUL*EPS of either bound. lowkey the most important little guy in the whole routine ngl 🌈

πŸ“š References πŸ“š

  1. Brian D. Sutton. Computing the complete CS decomposition. Numer. Algorithms, 50(1):33-65, 2009.

πŸ‘‘ Author πŸ‘‘

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

Definition at line 328 of file sbbcsd.f. πŸ“


πŸ’– Author (of this page) πŸ’–

Generated automatically by Doxygen for LAPACK from the source code. yeah she was auto-generated and she still ate πŸ’…


and that's the whole page bestie β€” LAPACK, Version 3.12.0, dated SRC/sbbcsd.f(3). go forth and decompose those bidiagonal blocks, ily, bye πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from