lasd6(3)
π lasd6(3) β Library Functions Manual π
okay bestie, so this is lasd6 from the lasd6(3) manual page β it's a LAPACK internal, it's the divide-and-conquer step that merges your subproblems, and yes it's giving very much "the glue that holds the whole SVD together." π§
β¨ NAME β¨
lasd6 β literally lasd6: D&C step: merge subproblems. that's it, that's the name, she's not mysterious. π
πΈ SYNOPSIS πΈ
Functions
subroutine dlasd6βDLASD6computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used bysbdsdc.
subroutine dlasd6 (icompq, nl, nr, sqre, d, vf, vl, alpha, beta, idxq,
perm, givptr, givcol, ldgcol, givnum, ldgnum, poles, difl, difr, z,
k, c, s, work, iwork, info)
subroutine slasd6βSLASD6computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used bysbdsdc.
subroutine slasd6 (icompq, nl, nr, sqre, d, vf, vl, alpha, beta, idxq,
perm, givptr, givcol, ldgcol, givnum, ldgnum, poles, difl, difr, z,
k, c, s, work, iwork, info)
π¦ Detailed Description π¦
so the "detailed description" section up top is lowkey just vibes β no extra tea here. everything you actually came for is living down in Function Documentation, so scroll with me. β¬οΈ
π Function Documentation π
subroutine dlasd6
here's her full signature, character for character, no edits, no notes:
subroutine dlasd6 (integer icompq, integer nl, integer nr, integer sqre,
double precision, dimension( * ) d, double precision, dimension( * ) vf,
double precision, dimension( * ) vl, double precision alpha, double
precision beta, integer, dimension( * ) idxq, integer, dimension( * )
perm, integer givptr, integer, dimension( ldgcol, * ) givcol, integer
ldgcol, double precision, dimension( ldgnum, * ) givnum, integer ldgnum,
double precision, dimension( ldgnum, * ) poles, double precision,
dimension( * ) difl, double precision, dimension( * ) difr, double
precision, dimension( * ) z, integer k, double precision c, double
precision s, double precision, dimension( * ) work, integer, dimension(
* ) iwork, integer info)
DLASD6 computes the SVD of an updated upper bidiagonal matrix obtained by merging two smaller ones by appending a row. Used by sbdsdc.
π«Ά Purpose
okay so picture this: DLASD6 computes the SVD of an updated upper bidiagonal matrix B obtained by merging two smaller ones by appending a row. this routine is used only for the problem which requires all singular values and optionally singular vector matrices in factored form. so like, factored form is her whole personality, she does not do the other thing. β¨
B is an N-by-M matrix with N = NL + NR + 1 and M = N + SQRE. a related subroutine, DLASD1, handles the case in which all singular values and singular vectors of the bidiagonal matrix are desired β that's her cousin, different assignment, don't mix them up. π
DLASD6 computes the SVD as follows:
( D1(in) 0 0 0 )
B = U(in) * ( Z1**T a Z2**T b ) * VT(in)
( 0 0 D2(in) 0 )
= U(out) * ( D(out) 0) * VT(out)
where Z**T = (Z1**T a Z2**T b) = u**T VT**T, and u is a vector of dimension M with ALPHA and BETA in the NL+1 and NL+2 th entries and zeros elsewhere; and the entry b is empty if SQRE = 0. yes she said "the NL+1 and NL+2 th entries," we're not fixing it, that's the original, periodt. π
the singular values of B can be computed using D1, D2, the first components of all the right singular vectors of the lower block, and the last components of all the right singular vectors of the upper block. these components are stored and updated in VF and VL, respectively, in DLASD6. hence U and VT are not explicitly referenced β iconique, no notes, she doesn't need them. π
the singular values are stored in D. the algorithm consists of two stages:
- the first stage consists of deflating the size of the problem when there are multiple singular values or if there is a zero in the Z vector. for each such occurrence the dimension of the secular equation problem is reduced by one. this stage is performed by the routine
DLASD7. π₯ - the second stage consists of calculating the updated singular values. this is done by finding the roots of the secular equation via the routine
DLASD4(as called byDLASD8). this routine also updates VF and VL and computes the distances between the updated singular values and the old singular values. π
DLASD6 is called from DLASDA.
π Parameters
ICOMPQβICOMPQisINTEGER. specifies whether singular vectors are to be computed in factored form:= 0: Compute singular values only.= 1: Compute singular vectors in factored form as well.
NLβNLisINTEGER. the row dimension of the upper block.NL >= 1.NRβNRisINTEGER. the row dimension of the lower block.NR >= 1.SQREβSQREisINTEGER.= 0: the lower block is an NR-by-NR square matrix.= 1: the lower block is an NR-by-(NR+1) rectangular matrix.
the bidiagonal matrix has row dimension N = NL + NR + 1, and column dimension M = N + SQRE.
DβDisDOUBLE PRECISIONarray, dimension ( NL+NR+1 ). on entryD(1:NL,1:NL)contains the singular values of the upper block, andD(NL+2:N)contains the singular values of the lower block. on exitD(1:N)contains the singular values of the modified matrix. πVFβVFisDOUBLE PRECISIONarray, dimension ( M ). on entry,VF(1:NL+1)contains the first components of all right singular vectors of the upper block; andVF(NL+2:M)contains the first components of all right singular vectors of the lower block. on exit,VFcontains the first components of all right singular vectors of the bidiagonal matrix.VLβVLisDOUBLE PRECISIONarray, dimension ( M ). on entry,VL(1:NL+1)contains the last components of all right singular vectors of the upper block; andVL(NL+2:M)contains the last components of all right singular vectors of the lower block. on exit,VLcontains the last components of all right singular vectors of the bidiagonal matrix. (yes VF is firsts and VL is lasts, that's the bit, don't swap them bestie π)ALPHAβALPHAisDOUBLE PRECISION. contains the diagonal element associated with the added row.BETAβBETAisDOUBLE PRECISION. contains the off-diagonal element associated with the added row.IDXQβIDXQisINTEGERarray, dimension ( N ). this contains the permutation which will reintegrate the subproblem just solved back into sorted order, i.e.D( IDXQ( I = 1, N ) )will be in ascending order.PERMβPERMisINTEGERarray, dimension ( N ). the permutations (from deflation and sorting) to be applied to each block. Not referenced ifICOMPQ = 0. π«GIVPTRβGIVPTRisINTEGER. the number of Givens rotations which took place in this subproblem. Not referenced ifICOMPQ = 0.GIVCOLβGIVCOLisINTEGERarray, dimension ( LDGCOL, 2 ). each pair of numbers indicates a pair of columns to take place in a Givens rotation. Not referenced ifICOMPQ = 0.LDGCOLβLDGCOLisINTEGER. leading dimension ofGIVCOL, must be at least N.GIVNUMβGIVNUMisDOUBLE PRECISIONarray, dimension ( LDGNUM, 2 ). each number indicates the C or S value to be used in the corresponding Givens rotation. Not referenced ifICOMPQ = 0.LDGNUMβLDGNUMisINTEGER. the leading dimension ofGIVNUMandPOLES, must be at least N.POLESβPOLESisDOUBLE PRECISIONarray, dimension ( LDGNUM, 2 ). on exit,POLES(1,*)is an array containing the new singular values obtained from solving the secular equation, andPOLES(2,*)is an array containing the poles in the secular equation. Not referenced ifICOMPQ = 0. πDIFLβDIFLisDOUBLE PRECISIONarray, dimension ( N ). on exit,DIFL(I)is the distance between I-th updated (undeflated) singular value and the I-th (undeflated) old singular value.DIFRβDIFRisDOUBLE PRECISIONarray, dimension ( LDDIFR, 2 ) ifICOMPQ = 1and dimension ( K ) ifICOMPQ = 0. on exit,DIFR(I,1) = D(I) - DSIGMA(I+1),DIFR(K,1)is not defined and will not be referenced.
if ICOMPQ = 1, DIFR(1:K,2) is an array containing the normalizing factors for the right singular vector matrix.
see DLASD8 for details on DIFL and DIFR. π
ZβZisDOUBLE PRECISIONarray, dimension ( M ). the first elements of this array contain the components of the deflation-adjusted updating row vector.KβKisINTEGER. contains the dimension of the non-deflated matrix, this is the order of the related secular equation.1 <= K <=N.CβCisDOUBLE PRECISION.Ccontains garbage ifSQRE =0and the C-value of a Givens rotation related to the right null space ifSQRE = 1. π (yes, literally garbage. she said what she said.)SβSisDOUBLE PRECISION.Scontains garbage ifSQRE =0and the S-value of a Givens rotation related to the right null space ifSQRE = 1.WORKβWORKisDOUBLE PRECISIONarray, dimension ( 4 * M ).IWORKβIWORKisINTEGERarray, dimension ( 3 * N ).INFOβINFOisINTEGER.= 0: successful exit. slay. β< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = 1, a singular value did not converge. π
heads up bestie:CandSholding "garbage" is not a vibe, it's a documented fact β ifSQRE = 0just don't go reading them, fr fr.
π§ Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Contributors:
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
β Definition at line 309 of file dlasd6.f.
β¨ Parameters β¨
Okay bestie, this is the whole parameter lineup β every single one, no skips, no cap. π«Ά
π
ICOMPQ
ICOMPQ is INTEGER β itβs the vibe check for whether weβre computing singular vectors in factored form:
= 0: compute singular values only.= 1: compute singular vectors in factored form as well.
πΈ NL
NL is INTEGER β the row dimension of the upper block. NL >= 1.
π¦ NR
NR is INTEGER β the row dimension of the lower block. NR >= 1.
π SQRE
SQRE is INTEGER:
= 0: the lower block is anNR-by-NRsquare matrix.= 1: the lower block is anNR-by-(NR+1)rectangular matrix.
The bidiagonal matrix has row dimension N = NL + NR + 1, and column dimension M = N + SQRE.
π D
D is REAL array, dimension (NL+NR+1). On entry D(1:NL,1:NL) contains the singular values of the upper block, and D(NL+2:N) contains the singular values of the lower block. On exit D(1:N) contains the singular values of the modified matrix.
π VF
VF is REAL array, dimension (M). On entry, VF(1:NL+1) contains the first components of all right singular vectors of the upper block; and VF(NL+2:M) contains the first components of all right singular vectors of the lower block. On exit, VF contains the first components of all right singular vectors of the bidiagonal matrix.
πΌ VL
VL is REAL array, dimension (M). On entry, VL(1:NL+1) contains the last components of all right singular vectors of the upper block; and VL(NL+2:M) contains the last components of all right singular vectors of the lower block. On exit, VL contains the last components of all right singular vectors of the bidiagonal matrix.
π ALPHA
ALPHA is REAL β contains the diagonal element associated with the added row.
π BETA
BETA is REAL β contains the off-diagonal element associated with the added row.
π§ IDXQ
IDXQ is INTEGER array, dimension (N). This contains the permutation which will reintegrate the subproblem just solved back into sorted order, i.e. D( IDXQ( I = 1, N ) ) will be in ascending order.
π¦ PERM
PERM is INTEGER array, dimension ( N ). The permutations (from deflation and sorting) to be applied to each block. Not referenced if ICOMPQ = 0.
π₯ GIVPTR
GIVPTR is INTEGER β the number of Givens rotations which took place in this subproblem. Not referenced if ICOMPQ = 0.
π GIVCOL
GIVCOL is INTEGER array, dimension ( LDGCOL, 2 ). Each pair of numbers indicates a pair of columns to take place in a Givens rotation. Not referenced if ICOMPQ = 0.
π«Ά LDGCOL
LDGCOL is INTEGER β leading dimension of GIVCOL, must be at least N.
β¨ GIVNUM
GIVNUM is REAL array, dimension ( LDGNUM, 2 ). Each number indicates the C or S value to be used in the corresponding Givens rotation. Not referenced if ICOMPQ = 0.
π LDGNUM
LDGNUM is INTEGER β the leading dimension of GIVNUM and POLES, must be at least N.
π¬ POLES
POLES is REAL array, dimension ( LDGNUM, 2 ). On exit, POLES(1,*) is an array containing the new singular values obtained from solving the secular equation, and POLES(2,*) is an array containing the poles in the secular equation. Not referenced if ICOMPQ = 0.
πΊ DIFL
DIFL is REAL array, dimension ( N ). On exit, DIFL(I) is the distance between I-th updated (undeflated) singular value and the I-th (undeflated) old singular value.
π DIFR
DIFR is REAL array,
- dimension
( LDDIFR, 2 )ifICOMPQ = 1and - dimension
( K )ifICOMPQ = 0.
On exit, DIFR(I,1) = D(I) - DSIGMA(I+1), DIFR(K,1) is not defined and will not be referenced.
If ICOMPQ = 1, DIFR(1:K,2) is an array containing the normalizing factors for the right singular vector matrix.
See SLASD8 for details on DIFL and DIFR.
π¦ Z
Z is REAL array, dimension ( M ). The first elements of this array contain the components of the deflation-adjusted updating row vector.
π K
K is INTEGER β contains the dimension of the non-deflated matrix. This is the order of the related secular equation. 1 <= K <=N.
π C
C is REAL β C contains garbage if SQRE =0 and the C-value of a Givens rotation related to the right null space if SQRE = 1.
π S
S is REAL β S contains garbage if SQRE =0 and the S-value of a Givens rotation related to the right null space if SQRE = 1.
πΏ WORK
WORK is REAL array, dimension ( 4 * M ).
π IWORK
IWORK is INTEGER array, dimension ( 3 * N ).
π« INFO
INFO is INTEGER:
= 0: successful exit.< 0: ifINFO = -i, thei-th argument had an illegal value.> 0: ifINFO = 1, a singular value did not converge.
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π«Ά Contributors π«Ά
Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
Definition at line 309 of file slasd6.f.
π€ Author (the auto-generated one) π€
Generated automatically by Doxygen for LAPACK from the source code.
And thatβs the whole iconic page, bestie! This masterpiece is from LAPACK Version 3.12.0, and youβre looking at lasd6(3). Slay, periodt. π
β¨
π¦ 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