SRC/zbbcsd.f(3)
π NAME
SRC/zbbcsd.f β bestie, this is the source file page for ZBBCSD, and it's from the Library Functions Manual. It's a LAPACK routine, it's iconic, and we're gonna get through it together β¨
πΈ SYNOPSIS
Functions/Subroutines
subroutine zbbcsd (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, rwork, lrwork, info)
ZBBCSD β that's the whole vibe of this page π«Ά
π¦ Function/Subroutine Documentation
subroutine zbbcsd (character jobu1, character jobu2, character jobv1t, character jobv2t, character trans, integer m, integer p, integer q, double precision, dimension( * ) theta, double precision, dimension( * ) phi, complex*16, dimension( ldu1, * ) u1, integer ldu1, complex*16, dimension( ldu2, * ) u2, integer ldu2, complex*16, dimension( ldv1t, * ) v1t, integer ldv1t, complex*16, dimension( ldv2t, * ) v2t, integer ldv2t, double precision, dimension( * ) b11d, double precision, dimension( * ) b11e, double precision, dimension( * ) b12d, double precision, dimension( * ) b12e, double precision, dimension( * ) b21d, double precision, dimension( * ) b21e, double precision, dimension( * ) b22d, double precision, dimension( * ) b22e, double precision, dimension( * ) rwork, integer lrwork, integer info)
ZBBCSD
π₯ Purpose
okay so. ZBBCSD computes the CS decomposition of a unitary matrix in bidiagonal-block form, and the way it does it is genuinely stunning π
[ 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 | ]**H
= [---------] [---------------] [---------] .
[ | 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. periodt. (if Q is not the smallest index, then X must be transposed and/or permuted β which like, can be done in constant time using the TRANS and SIGNS options, see ZUNCSD for details π)
the bidiagonal matrices B11, B12, B21, and B22 are represented implicitly by angles THETA(1:Q) and PHI(1:Q-1) β no cap, they're not stored as actual arrays of matrix entries, it's all angles π«
and the unitary matrices U1, U2, V1T, and V2T are input/output. the input matrices are pre- or post-multiplied by the appropriate singular vector matrices. iconic behaviour honestly.
π Parameters
JOBU1βJOBU1isCHARACTER.= 'Y':U1is updated; otherwise:U1is not updated. that's it, that's the whole flag πJOBU2βJOBU2isCHARACTER.= 'Y':U2is updated; otherwise:U2is not updated.JOBV1TβJOBV1TisCHARACTER.= 'Y':V1Tis updated; otherwise:V1Tis not updated.JOBV2TβJOBV2TisCHARACTER.= 'Y':V2Tis updated; otherwise:V2Tis not updated.TRANSβTRANSisCHARACTER.= 'T':X,U1,U2,V1T, andV2Tare stored in row-major order; otherwise:X,U1,U2,V1T, andV2Tare stored in column-major order. lowkey the most important flag here ngl π«ΆMβMisINTEGER. the number of rows and columns inX, the unitary matrix in bidiagonal-block form.PβPisINTEGER. the number of rows in the top-left block ofX.0 <= P <= M.QβQisINTEGER. the number of columns in the top-left block ofX.0 <= Q <= MIN(P,M-P,M-Q). so like,Qstays small. it's the main character but it's also the smallest index, iykyk πTHETAβTHETAisDOUBLE PRECISION array, dimension (Q). on entry: the anglesTHETA(1),...,THETA(Q)that, along withPHI(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. she transforms β¨PHIβPHIisDOUBLE PRECISION array, dimension (Q-1). the anglesPHI(1),...,PHI(Q-1)that, along withTHETA(1),...,THETA(Q), define the matrix in bidiagonal-block form.U1βU1isCOMPLEX*16 array, dimension (LDU1,P). on entry: a P-by-P matrix. on exit:U1is postmultiplied by the left singular vector matrix common to[ B11 ; 0 ]and[ B12 0 0 ; 0 -I 0 0 ]. π¦LDU1βLDU1isINTEGER. the leading dimension of the arrayU1,LDU1 >= MAX(1,P).U2βU2isCOMPLEX*16 array, dimension (LDU2,M-P). on entry: an (M-P)-by-(M-P) matrix. on exit:U2is postmultiplied by the left singular vector matrix common to[ B21 ; 0 ]and[ B22 0 0 ; 0 0 I ].LDU2βLDU2isINTEGER. the leading dimension of the arrayU2,LDU2 >= MAX(1,M-P).V1TβV1TisCOMPLEX*16 array, dimension (LDV1T,Q). on entry: a Q-by-Q matrix. on exit:V1Tis premultiplied by the conjugate transpose of the right singular vector matrix common to[ B11 ; 0 ]and[ B21 ; 0 ].LDV1TβLDV1TisINTEGER. the leading dimension of the arrayV1T,LDV1T >= MAX(1,Q).V2TβV2TisCOMPLEX*16 array, dimension (LDV2T,M-Q). on entry: an (M-Q)-by-(M-Q) matrix. on exit:V2Tis premultiplied by the conjugate transpose of the right singular vector matrix common to[ B12 0 0 ; 0 -I 0 ]and[ B22 0 0 ; 0 0 I ].LDV2TβLDV2TisINTEGER. the leading dimension of the arrayV2T,LDV2T >= MAX(1,M-Q).B11DβB11DisDOUBLE PRECISION array, dimension (Q). whenZBBCSDconverges,B11Dcontains the cosines ofTHETA(1), ..., THETA(Q). ifZBBCSDfails to converge, thenB11Dcontains the diagonal of the partially reduced top-left block. πB11EβB11EisDOUBLE PRECISION array, dimension (Q-1). whenZBBCSDconverges,B11Econtains zeros. ifZBBCSDfails to converge, thenB11Econtains the superdiagonal of the partially reduced top-left block.B12DβB12DisDOUBLE PRECISION array, dimension (Q). whenZBBCSDconverges,B12Dcontains the negative sines ofTHETA(1), ..., THETA(Q). ifZBBCSDfails to converge, thenB12Dcontains the diagonal of the partially reduced top-right block.B12EβB12EisDOUBLE PRECISION array, dimension (Q-1). whenZBBCSDconverges,B12Econtains zeros. ifZBBCSDfails to converge, thenB12Econtains the subdiagonal of the partially reduced top-right block.B21DβB21DisDOUBLE PRECISION array, dimension (Q). whenZBBCSDconverges,B21Dcontains the negative sines ofTHETA(1), ..., THETA(Q). ifZBBCSDfails to converge, thenB21Dcontains the diagonal of the partially reduced bottom-left block.B21EβB21EisDOUBLE PRECISION array, dimension (Q-1). whenZBBCSDconverges,B21Econtains zeros. ifZBBCSDfails to converge, thenB21Econtains the subdiagonal of the partially reduced bottom-left block.B22DβB22DisDOUBLE PRECISION array, dimension (Q). whenZBBCSDconverges,B22Dcontains the negative sines ofTHETA(1), ..., THETA(Q). ifZBBCSDfails to converge, thenB22Dcontains the diagonal of the partially reduced bottom-right block.B22EβB22EisDOUBLE PRECISION array, dimension (Q-1). whenZBBCSDconverges,B22Econtains zeros. ifZBBCSDfails to converge, thenB22Econtains the subdiagonal of the partially reduced bottom-right block.RWORKβRWORKisDOUBLE PRECISION array, dimension (MAX(1,LRWORK)). on exit, ifINFO = 0,RWORK(1)returns the optimalLRWORK. π§LRWORKβLRWORKisINTEGER. the dimension of the arrayRWORK.LRWORK >= MAX(1,8*Q). ifLRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theRWORKarray, returns this value as the first entry of the work array, and no error message related toLRWORKis issued byXERBLA. so like,-1is the "just tell me how much room I need" mode π«INFOβINFOisINTEGER.= 0: successful exit. slay π< 0: ifINFO = -i, the i-th argument had an illegal value. you gave it something cursed π> 0: ifZBBCSDdid not converge,INFOspecifies the number of nonzero entries inPHI, andB11D,B11E, etc., contain the partially reduced matrix. she tried, bestie π
π Internal Parameters
TOLMULβDOUBLE PRECISION, default =MAX(10,MIN(100,EPS**(-1/8))).TOLMULcontrols the convergence criterion of the QR loop. anglesTHETA(i),PHI(i)are rounded to0orPI/2when they are withinTOLMUL*EPSof either bound. so it's basically the "close enough, call it zero" slider ποΈβ¨
π References
- Brian D. Sutton. Computing the complete CS decomposition. Numer. Algorithms, 50(1):33-65, 2009. citation game strong fr fr π
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 328 of file zbbcsd.f. π
β Author
Generated automatically by Doxygen for LAPACK from the source code.
okay that's the whole page, you ate that π
no notes. this doc got spat out by Doxygen for LAPACK Version 3.12.0, and the page itself is SRC/zbbcsd.f(3) β mwah, go decompose something unitary π«ΆππΈ
π¦ 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