f08mbf computes all or selected singular values and, optionally, the corresponding left and right singular vectors of a real (upper or lower) bidiagonal matrix .
The routine may be called by the names f08mbf, nagf_lapackeig_dbdsvdx or its LAPACK name dbdsvdx.
3Description
f08mbf computes the singular value decomposition (SVD) of a real (upper or lower) bidiagonal matrix as
where is a diagonal matrix with non-negative diagonal elements (the singular values of ), and and are orthogonal matrices. The columns of and are the left and right singular vectors of , respectively.
Given an upper bidiagonal matrix with diagonal and superdiagonal , f08mbf computes the singular value decomposition of through the eigenvalues and eigenvectors of the by tridiagonal matrix
If is a singular triplet of with , then and , , are eigenpairs of , with , and .
Given a matrix, you can either
(i)compute and change signs so that the singular values (and corresponding vectors) are already in descending order (as in f08kbf) or
(ii)compute and reorder the values (and corresponding vectors).
f08mbf implements (i) by calling f08jbf (bisection plus inverse iteration, to be replaced with a version of the Multiple Relative Robust Representation algorithm. (See Williams and Lang (2013).)
Alternative to computing all singular values of , a selected set can be computed. The set is either those singular values lying in a given interval, , or those whose index (counting from largest to smallest in magnitude) lies in a given range . In these cases, the corresponding left and right singular vectors can optionally be computed.
4References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia https://www.netlib.org/lapack/lug
Williams P and Lang B (2013) A framework for the Algorithm: theory and implementation SIAM J. Sci. Comput.35 740–766
5Arguments
1: – Character(1)Input
On entry: indicates whether is upper or lower bidiagonal.
is upper bidiagonal.
is lower bidiagonal.
Constraint:
or .
2: – Character(1)Input
On entry: indicates whether singular vectors are computed.
Only singular values are computed.
Singular values and singular vectors are computed.
Constraint:
or .
3: – Character(1)Input
On entry: indicates which singular values should be returned.
All singular values will be found.
All singular values in the half-open interval will be found.
The ilth through iuth singular values will be found.
Constraint:
, or .
4: – IntegerInput
On entry: , the order of the bidiagonal matrix .
Constraint:
.
5: – Real (Kind=nag_wp) arrayInput
On entry: the diagonal elements of the bidiagonal matrix .
6: – Real (Kind=nag_wp) arrayInput
On entry: the off-diagonal elements of the bidiagonal matrix .
7: – Real (Kind=nag_wp)Input
On entry: if , the lower bound of the interval to be searched for singular values.
On exit: the total number of singular values found. .
If , .
If , .
12: – Real (Kind=nag_wp) arrayOutput
On exit: the first ns elements contain the selected singular values in ascending order.
13: – Real (Kind=nag_wp) arrayOutput
Note: the second dimension of the array z
must be at least
if , and at least otherwise.
On exit: if , then if the first ns columns of z contain the singular vectors of the matrix corresponding to the selected singular values, with in rows to and in rows to , i.e.,
Note: the user must ensure that at least columns are supplied in the array . If , the exact value of ns is not known in advance and an upper bound of at least n must be used.
14: – IntegerInput
On entry: the first dimension of the array z as declared in the (sub)program from which f08mbf is called.
On exit: unless the routine detects an error (see Section 6).
6Error Indicators and Warnings
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
The algorithm failed to converge; eigenvectors of the associated eigenproblem did not converge. Their indices are stored in array iwork.
7Accuracy
Each computed singular value of is accurate to nearly full relative precision, no matter how tiny the singular value. The th computed singular value, , satisfies the bound
where is the machine precision and is a modest function of .
f08mbf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f08mbf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
If only singular values are required, the total number of floating-point operations is approximately proportional to . When singular vectors are required the number of operations is bounded above by approximately the same number of operations as f08mef, but for large matrices f08mbf is usually much faster.
There is no complex analogue of f08mbf.
10Example
This example computes the singular value decomposition of the upper bidiagonal matrix