Developer Reference for Intel® oneAPI Math Kernel Library for C
?lasd1
Computes the SVD of an upper bidiagonal matrix B of the specified size. Used by ?bdsdc .
Syntax
call slasd1 ( nl , nr , sqre , d , alpha , beta , u , ldu , vt , ldvt , idxq , iwork , work , info )
call dlasd1 ( nl , nr , sqre , d , alpha , beta , u , ldu , vt , ldvt , idxq , iwork , work , info )
void slasd1 ( lapack_int*nl , lapack_int*nr , lapack_int*sqre , float*d , float*alpha , float*beta , float*u , lapack_int*ldu , float*vt , lapack_int*ldvt , lapack_int*idxq , lapack_int*iwork , float*work , lapack_int*info );
void dlasd1 ( lapack_int*nl , lapack_int*nr , lapack_int*sqre , double*d , double*alpha , double*beta , double*u , lapack_int*ldu , double*vt , lapack_int*ldvt , lapack_int*idxq , lapack_int*iwork , double*work , lapack_int*info );
Include Files
mkl.h
Description
slasd1 dlasd1
The routine computes the SVD of an upper bidiagonal n -by- m matrix B , where n = nl + nr + 1 and m = n + sqre .
The routine ?lasd1 is called from ?lasd0 (Computes the singular values of a real upper bidiagonal n-by-m matrix B with diagonal d and off-diagonal e. Used by ?bdsdc.) .
A related subroutine ?lasd7 (Merges the two sets of singular values together into a single sorted set. Then it tries to deflate the size of the problem. Used by ?bdsdc.) handles the case in which the singular values (and the singular vectors in factored form) are desired.
?lasd1 computes the SVD as follows:
= U(out)*(D(out) 0)*VT(out)
where Z^{T} = (Z1^{T}aZ2^{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 .
The left singular vectors of the original matrix are stored in u , and the transpose of the right singular vectors are stored in vt , and the singular values are in d . The algorithm consists of three stages:
The first stage consists of deflating the size of the problem when there are multiple singular values or when there are zeros 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 ?lasd2 (Merges the two sets of singular values together into a single sorted set. Used by ?bdsdc.) .
The second stage consists of calculating the updated singular values. This is done by finding the square roots of the roots of the secular equation via the routine ?lasd4 (Computes the square root of the i-th updated eigenvalue of a positive symmetric rank-one modification to a positive diagonal matrix. Used by ?bdsdc.) (as called by ?lasd3 (Finds all square roots of the roots of the secular equation, as defined by the values in D and Z, and then updates the singular vectors by matrix multiplication. Used by ?bdsdc.) ). This routine also calculates the singular vectors of the current problem.
The final stage consists of computing the updated singular vectors directly using the updated singular values. The singular vectors for the current problem are multiplied with the singular vectors from the overall problem.
Input Parameters
nl
The row dimension of the upper block.
nl≥ 1 .
nr
The row dimension of the lower block.
nr≥ 1 .
sqre
If sqre = 0 : the lower block is an nr -by- nr square matrix. If sqre = 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
-
REAL for slasd1 DOUBLE PRECISION for dlasd1 Array, DIMENSION ( nl+nr+1 ). n = 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.
- alpha
-
REAL for slasd1 DOUBLE PRECISION for dlasd1 Contains the diagonal element associated with the added row.
- beta
-
REAL for slasd1 DOUBLE PRECISION for dlasd1 Contains the off-diagonal element associated with the added row.
- u
-
REAL for slasd1 DOUBLE PRECISION for dlasd1 Array, DIMENSION ( ldu , n ). On entry u(1:nl, 1:nl) contains the left singular vectors of the upper block; u(nl+2:n, nl+2:n) contains the left singular vectors of the lower block.
ldu
The leading dimension of the array U .
ldu≥ max(1, n) .
- vt
-
REAL for slasd1 DOUBLE PRECISION for dlasd1 Array, DIMENSION ( ldvt , m ), where m = n + sqre . On entry vt(1:nl+1, 1:nl+1)^{T} contains the right singular vectors of the upper block; vt(nl+2:m, nl+2:m)^{T} contains the right singular vectors of the lower block.
ldvt
The leading dimension of the array vt .
ldvt≥ max(1, M) .
- iwork
-
INTEGER . Workspace array, DIMENSION (4 n ).
- work
-
REAL for slasd1 DOUBLE PRECISION for dlasd1 Workspace array, DIMENSION ( 3m^{2} + 2m ).
Output Parameters
- d
-
On exit d (1: n ) contains the singular values of the modified matrix.
- alpha
-
On exit, the diagonal element associated with the added row deflated by max( abs( alpha ), abs( beta ), abs( D(I) ) ) , I = 1,n .
- beta
-
On exit, the off-diagonal element associated with the added row deflated by max( abs( alpha ), abs( beta ), abs( D(I) ) ) , I = 1,n .
- u
-
On exit u contains the left singular vectors of the bidiagonal matrix.
- vt
-
On exit vt:code:`T` contains the right singular vectors of the bidiagonal matrix.
- idxq
-
INTEGER . Array, DIMENSION ( n ). Contains the permutation which will reintegrate the subproblem just solved back into sorted order, that is, d(idxq( i = 1, n )) will be in ascending order.
info
INTEGER .
If info = 0 : successful exit.
If info = -i < 0 , the i -th argument had an illegal value.
If info = 1 , a singular value did not converge.