3 Description

F08MSF (ZBDSQR) computes the singular values and, optionally, the left or right singular vectors of a real upper or lower bidiagonal matrix B. In other words, it can compute the singular value decomposition (SVD) of B as

B=UΣVT.

Here Σ is a diagonal matrix with real diagonal elements σi (the singular values of B), such that

σ1≥σ2≥⋯≥σn≥0;

U is an orthogonal matrix whose columns are the left singular vectors ui; V is an orthogonal matrix whose rows are the right singular vectors vi. Thus

Bui=σivi and BTvi=σiui, i=1,2,…,n.

To compute U and/or VT, the arrays U and/or VT must be initialized to the unit matrix before F08MSF (ZBDSQR) is called.

The routine stores the real orthogonal matrices U and VT in complex arrays U and VT, so that it may also be used to compute the SVD of a complex general matrix A which has been reduced to bidiagonal form by a unitary transformation: A=QBPH. If A is m by n with m≥n, then Q is m by n and PH is n by n; if A is n by p with n<p, then Q is n by n and PH is n by p. In this case, the matrices Q and/or PH must be formed explicitly by F08KTF (ZUNGBR) and passed to F08MSF (ZBDSQR) in the arrays U and/or VT respectively.

F08MSF (ZBDSQR) also has the capability of forming UHC, where C is an arbitrary complex matrix; this is needed when using the SVD to solve linear least squares problems.

F08MSF (ZBDSQR) uses two different algorithms. If any singular vectors are required (i.e., if NCVT>0 or NRU>0 or NCC>0), the bidiagonal QR algorithm is used, switching between zero-shift and implicitly shifted forms to preserve the accuracy of small singular values, and switching between QR and QL variants in order to handle graded matrices effectively (see Demmel and Kahan (1990)). If only singular values are required (i.e., if NCVT=NRU=NCC=0), they are computed by the differential qd algorithm (see Fernando and Parlett (1994)), which is faster and can achieve even greater accuracy.

The singular vectors are normalized so that ui=vi=1, but are determined only to within a complex factor of absolute value 1.

Note: the second dimension of the array VT
must be at least
max1,NCVT.

On entry: if NCVT>0, VT must contain an n by ncvt matrix. If the right singular vectors of B are required, ncvt=n and VT must contain the unit matrix; if the right singular vectors of A are required, VT must contain the unitary
matrix PH returned by F08KTF (ZUNGBR)
with VECT='P' .

On exit: the n by ncvt matrix VH or VH of right singular vectors, stored by rows.

On entry: if NRU>0, U must contain an nru by n matrix. If the left singular vectors of B are required, nru=n and U must contain the unit matrix; if the left singular vectors of A are required, U must contain the unitary
matrix Q returned by F08KTF (ZUNGBR)
with VECT='Q' .

On exit: the nru by n matrix U or QU of left singular vectors, stored as columns of the matrix.

6 Error Indicators and Warnings

Errors or warnings detected by the routine:

INFO<0

If INFO=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

INFO>0

The algorithm failed to converge and INFO specifies how many off-diagonals did not converge. In this case, D and E contain on exit the diagonal and off-diagonal elements, respectively, of a bidiagonal matrix orthogonally equivalent to B.

7 Accuracy

Each singular value and singular vector is computed to high relative accuracy. However, the reduction to bidiagonal form (prior to calling the routine) may exclude the possibility of obtaining high relative accuracy in the small singular values of the original matrix if its singular values vary widely in magnitude.

If σi is an exact singular value of B and σ~i is the corresponding computed value, then

σ~i-σi≤pm,nεσi

where pm,n is a modestly increasing function of m and n, and ε is the machine precision. If only singular values are computed, they are computed more accurately (i.e., the function pm,n is smaller), than when some singular vectors are also computed.

If ui is an exact left singular vector of B, and u~i is the corresponding computed left singular vector, then the angle θu~i,ui between them is bounded as follows:

θu~i,ui≤pm,nεrelgapi

where relgapi is the relative gap between σi and the other singular values, defined by

relgapi=mini≠jσi-σjσi+σj.

A similar error bound holds for the right singular vectors.

8 Further Comments

The total number of real floating point operations is roughly proportional to n2 if only the singular values are computed. About 12n2×nru additional operations are required to compute the left singular vectors and about 12n2×ncvt to compute the right singular vectors. The operations to compute the singular values must all be performed in scalar mode; the additional operations to compute the singular vectors can be vectorized and on some machines may be performed much faster.