?bdsdc

Computes the singular value decomposition of a real bidiagonal matrix using a divide and conquer method.

Syntax

FORTRAN 77:

call sbdsdc(uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq, work, iwork, info)

call dbdsdc(uplo, compq, n, d, e, u, ldu, vt, ldvt, q, iq, work, iwork, info)

FORTRAN 95:

call bdsdc(d, e [,u] [,vt] [,q] [,iq] [,uplo] [,info])

C:

lapack_int LAPACKE_<?>bdsdc( int matrix_order, char uplo, char compq, lapack_int n, <datatype>* d, <datatype>* e, <datatype>* u, lapack_int ldu, <datatype>* vt, lapack_int ldvt, <datatype>* q, lapack_int* iq );

Include Files

Description

The routine computes the Singular Value Decomposition (SVD) of a real n-by-n (upper or lower) bidiagonal matrix B: B = U*Σ*VT, using a divide and conquer method, where Σ is a diagonal matrix with non-negative diagonal elements (the singular values of B), and U and V are orthogonal matrices of left and right singular vectors, respectively. ?bdsdc can be used to compute all singular values, and optionally, singular vectors or singular vectors in compact form.

This rotuine uses ?lasd0, ?lasd1, ?lasd2, ?lasd3, ?lasd4, ?lasd5, ?lasd6, ?lasd7, ?lasd8, ?lasd9, ?lasda, ?lasdq, ?lasdt.

Input Parameters

The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.

uplo

CHARACTER*1. Must be 'U' or 'L'.

If uplo = 'U', B is an upper bidiagonal matrix.

If uplo = 'L', B is a lower bidiagonal matrix.

compq

CHARACTER*1. Must be 'N', 'P', or 'I'.

If compq = 'N', compute singular values only.

If compq = 'P', compute singular values and compute singular vectors in compact form.

If compq = 'I', compute singular values and singular vectors.

n

INTEGER. The order of the matrix B (n 0).

d, e, work

REAL for sbdsdc

DOUBLE PRECISION for dbdsdc.

Arrays:

d(*) contains the n diagonal elements of the bidiagonal matrix B.

The dimension of d must be at least max(1, n).

e(*) contains the off-diagonal elements of the bidiagonal matrix B.

The dimension of e must be at least max(1, n).

work(*) is a workspace array.

The dimension of work must be at least:

max(1, 4*n), if compq = 'N';

max(1, 6*n), if compq = 'P';

max(1, 3*n2+4*n), if compq = 'I'.

ldu

INTEGER. The leading dimension of the output array u; ldu 1.

If singular vectors are desired, then ldu max(1, n).

ldvt

INTEGER. The leading dimension of the output array vt; ldvt 1.

If singular vectors are desired, then ldvt max(1, n).

iwork

INTEGER. Workspace array, dimension at least max(1, 8*n).

Output Parameters

d

If info = 0, overwritten by the singular values of B.

e

On exit, e is overwritten.

u, vt, q

REAL for sbdsdc

DOUBLE PRECISION for dbdsdc.

Arrays: u(ldu,*), vt(ldvt,*), q(*).

If compq = 'I', then on exit u contains the left singular vectors of the bidiagonal matrix B, unless info 0 (seeinfo). For other values of compq, u is not referenced.

The second dimension of u must be at least max(1,n).

if compq = 'I', then on exit vtT contains the right singular vectors of the bidiagonal matrix B, unless info 0 (seeinfo). For other values of compq, vt is not referenced. The second dimension of vt must be at least max(1,n).

If compq = 'P', then on exit, if info = 0, q and iq contain the left and right singular vectors in a compact form. Specifically, q contains all the REAL (for sbdsdc) or DOUBLE PRECISION (for dbdsdc) data for singular vectors. For other values of compq, q is not referenced. See Application notes for details.

iq

INTEGER.

Array: iq(*).

If compq = 'P', then on exit, if info = 0, q and iq contain the left and right singular vectors in a compact form. Specifically, iq contains all the INTEGER data for singular vectors. For other values of compq, iq is not referenced. See Application notes for details.

info

INTEGER.

If info = 0, the execution is successful.

If info = -i, the i-th parameter had an illegal value.

If info = i, the algorithm failed to compute a singular value. The update process of divide and conquer failed.

Fortran 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or restorable arguments, see Fortran 95 Interface Conventions.

Specific details for the routine bdsdc interface are the following:

d

Holds the vector of length n.

e

Holds the vector of length n.

u

Holds the matrix U of size (n,n).

vt

Holds the matrix VT of size (n,n).

q

Holds the vector of length (ldq), where

ldq  n*(11 + 2*smlsiz + 8*int(log_2(n/(smlsiz + 1)))) and smlsiz is returned by ilaenv and is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about 25).

compq

Restored based on the presence of arguments u, vt, q, and iq as follows:

compq = 'N', if none of u, vt, q, and iq are present,

compq = 'I', if both u and vt are present. Arguments u and vt must either be both present or both omitted,

compq = 'P', if both q and iq are present. Arguments q and iq must either be both present or both omitted.

Note that there will be an error condition if all of u, vt, q, and iq arguments are present simultaneously.

See Also


Submit feedback on this help topic