PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dbdsdc (f08md)
Purpose
nag_lapack_dbdsdc (f08md) computes the singular values and, optionally, the left and right singular vectors of a real by (upper or lower) bidiagonal matrix .
Syntax
[
d,
e,
u,
vt,
q,
iq,
info] = f08md(
uplo,
compq,
d,
e, 'n',
n, 'ldq',
ldq, 'ldiq',
ldiq)
[
d,
e,
u,
vt,
q,
iq,
info] = nag_lapack_dbdsdc(
uplo,
compq,
d,
e, 'n',
n, 'ldq',
ldq, 'ldiq',
ldiq)
Description
nag_lapack_dbdsdc (f08md) computes the singular value decomposition (SVD) of the (upper or lower) bidiagonal matrix
as
where
is a diagonal matrix with non-negative diagonal elements
, such that
and
and
are orthogonal matrices. The diagonal elements of
are the singular values of
and the columns of
and
are respectively the corresponding left and right singular vectors of
.
When only singular values are required the function uses the algorithm, but when singular vectors are required a divide and conquer method is used. The singular values can optionally be returned in compact form, although currently no function is available to apply or when stored in compact form.
References
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
http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates whether
is upper or lower bidiagonal.
- is upper bidiagonal.
- is lower bidiagonal.
Constraint:
or .
- 2:
– string (length ≥ 1)
-
Specifies whether singular vectors are to be computed.
- Compute singular values only.
- Compute singular values and compute singular vectors in compact form.
- Compute singular values and singular vectors.
Constraint:
, or .
- 3:
– double array
-
The dimension of the array
d
must be at least
The diagonal elements of the bidiagonal matrix .
- 4:
– double array
-
The dimension of the array
e
must be at least
The off-diagonal elements of the bidiagonal matrix .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
d.
, the order of the matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
Default:
- if , ;
- otherwise .
The dimension of the array
q. see the description of
q.
- 3:
– int64int32nag_int scalar
Default:
- if , ;
- otherwise .
The dimension of the array
iq. see the description of
iq.
Output Parameters
- 1:
– double array
-
The dimension of the array
d will be
If , the singular values of .
- 2:
– double array
-
The dimension of the array
e will be
The contents of
e are destroyed.
- 3:
– double array
-
The first dimension,
, of the array
u will be
- if , ;
- otherwise .
The second dimension of the array
u will be
if
and
otherwise.
If
, then if
,
u contains the left singular vectors of the bidiagonal matrix
.
If
,
u is not referenced.
- 4:
– double array
-
The first dimension,
, of the array
vt will be
- if , ;
- otherwise .
The second dimension of the array
vt will be
if
and
otherwise.
If
, then if
, the rows of
vt contain the right singular vectors of the bidiagonal matrix
.
If
,
vt is not referenced.
- 5:
– double array
-
The dimension of the array
q will be
If
, then if
,
q and
iq contain the left and right singular vectors in a compact form, requiring
space instead of
. In particular,
q contains all the real data in the first
elements of
q, where
is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about
).
If
,
q is not referenced.
- 6:
– int64int32nag_int array
-
The dimension of the array
iq will be
If
, then if
,
q and
iq contain the left and right singular vectors in a compact form, requiring
space instead of
. In particular,
iq contains all integer data in the first
elements of
iq, where
is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about
).
If
,
iq is not referenced.
- 7:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
uplo, 2:
compq, 3:
n, 4:
d, 5:
e, 6:
u, 7:
ldu, 8:
vt, 9:
ldvt, 10:
q, 11:
ldq, 12:
iq, 13:
ldiq, 14:
work, 15:
iwork, 16:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
-
-
The algorithm failed to compute a singular value. The update process of divide-and-conquer failed.
Accuracy
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
.
For bounds on the computed singular values, see Section 4.9.1 of
Anderson et al. (1999). See also
nag_lapack_ddisna (f08fl).
Further 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
nag_lapack_dbdsqr (f08me), but for large matrices
nag_lapack_dbdsdc (f08md) is usually much faster.
There is no complex analogue of nag_lapack_dbdsdc (f08md).
Example
This example computes the singular value decomposition of the upper bidiagonal matrix
Open in the MATLAB editor:
f08md_example
function f08md_example
fprintf('f08md example results\n\n');
uplo = 'Upper';
d = [3.62; -2.41; 1.92; -1.43];
e = [1.26; -1.53; 1.19];
compq = 'I';
[s, ~, ~, ~, ~, ~, info] = f08md( ...
uplo, compq, d, e);
disp('Singular values');
disp(s');
f08md example results
Singular values
4.0001 3.0006 1.9960 0.9998
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015