bdsqr#

Functions

void sbdsqr(
    const char*          uplo,
    const INT            n,
    const INT            ncvt,
    const INT            nru,
    const INT            ncc,
          f32*  restrict D,
          f32*  restrict E,
          f32*  restrict VT,
    const INT            ldvt,
          f32*  restrict U,
    const INT            ldu,
          f32*  restrict C,
    const INT            ldc,
          f32*  restrict work,
          INT*           info
);
void sbdsqr(const char *uplo, const INT n, const INT ncvt, const INT nru, const INT ncc, f32 *restrict D, f32 *restrict E, f32 *restrict VT, const INT ldvt, f32 *restrict U, const INT ldu, f32 *restrict C, const INT ldc, f32 *restrict work, INT *info)#

SBDSQR computes the singular values and, optionally, the right and/or left singular vectors from the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B using the implicit zero-shift QR algorithm.

The SVD of B has the form

B = Q * S * P**T

where S is the diagonal matrix of singular values, Q is an orthogonal matrix of left singular vectors, and P is an orthogonal matrix of right singular vectors. If left singular vectors are requested, this subroutine actually returns U*Q instead of Q, and, if right singular vectors are requested, this subroutine returns P**T*VT instead of P**T, for given real input matrices U and VT. When U and VT are the orthogonal matrices that reduce a general matrix A to bidiagonal form: A = U*B*VT, as computed by SGEBRD, then

A = (U*Q) * S * (P**T*VT)

is the SVD of A. Optionally, the subroutine may also compute Q**T*C for a given real input matrix C.

Parameters

in
uplo

= ‘U’: B is upper bidiagonal; = ‘L’: B is lower bidiagonal.

in
n

The order of the matrix B. n >= 0.

in
ncvt

The number of columns of the matrix VT. ncvt >= 0.

in
nru

The number of rows of the matrix U. nru >= 0.

in
ncc

The number of columns of the matrix C. ncc >= 0.

inout
D

Double precision array, dimension (n). On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if info=0, the singular values of B in decreasing order.

inout
E

Double precision array, dimension (n-1). On entry, the N-1 offdiagonal elements of the bidiagonal matrix B. On exit, if info = 0, E is destroyed; if info > 0, D and E will contain the diagonal and superdiagonal elements of a bidiagonal matrix orthogonally equivalent to the one given as input.

inout
VT

Double precision array, dimension (ldvt, ncvt). On entry, an N-by-NCVT matrix VT. On exit, VT is overwritten by P**T * VT. Not referenced if ncvt = 0.

in
ldvt

The leading dimension of the array VT. ldvt >= max(1,n) if ncvt > 0; ldvt >= 1 if ncvt = 0.

inout
U

Double precision array, dimension (ldu, n). On entry, an NRU-by-N matrix U. On exit, U is overwritten by U * Q. Not referenced if nru = 0.

in
ldu

The leading dimension of the array U. ldu >= max(1,nru).

inout
C

Double precision array, dimension (ldc, ncc). On entry, an N-by-NCC matrix C. On exit, C is overwritten by Q**T * C. Not referenced if ncc = 0.

in
ldc

The leading dimension of the array C. ldc >= max(1,n) if ncc > 0; ldc >=1 if ncc = 0.

out
work

Double precision array, dimension (lwork). lwork = 4*n if ncvt = nru = ncc = 0, lwork = 4*(n-1) otherwise.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: the algorithm did not converge; D and E contain the elements of a bidiagonal matrix which is orthogonally similar to the input matrix B; if info = i, i elements of E have not converged to zero.

Functions

void dbdsqr(
    const char*          uplo,
    const INT            n,
    const INT            ncvt,
    const INT            nru,
    const INT            ncc,
          f64*  restrict D,
          f64*  restrict E,
          f64*  restrict VT,
    const INT            ldvt,
          f64*  restrict U,
    const INT            ldu,
          f64*  restrict C,
    const INT            ldc,
          f64*  restrict work,
          INT*           info
);
void dbdsqr(const char *uplo, const INT n, const INT ncvt, const INT nru, const INT ncc, f64 *restrict D, f64 *restrict E, f64 *restrict VT, const INT ldvt, f64 *restrict U, const INT ldu, f64 *restrict C, const INT ldc, f64 *restrict work, INT *info)#

DBDSQR computes the singular values and, optionally, the right and/or left singular vectors from the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B using the implicit zero-shift QR algorithm.

The SVD of B has the form

B = Q * S * P**T

where S is the diagonal matrix of singular values, Q is an orthogonal matrix of left singular vectors, and P is an orthogonal matrix of right singular vectors. If left singular vectors are requested, this subroutine actually returns U*Q instead of Q, and, if right singular vectors are requested, this subroutine returns P**T*VT instead of P**T, for given real input matrices U and VT. When U and VT are the orthogonal matrices that reduce a general matrix A to bidiagonal form: A = U*B*VT, as computed by DGEBRD, then

A = (U*Q) * S * (P**T*VT)

is the SVD of A. Optionally, the subroutine may also compute Q**T*C for a given real input matrix C.

Parameters

in
uplo

= ‘U’: B is upper bidiagonal; = ‘L’: B is lower bidiagonal.

in
n

The order of the matrix B. n >= 0.

in
ncvt

The number of columns of the matrix VT. ncvt >= 0.

in
nru

The number of rows of the matrix U. nru >= 0.

in
ncc

The number of columns of the matrix C. ncc >= 0.

inout
D

Double precision array, dimension (n). On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if info=0, the singular values of B in decreasing order.

inout
E

Double precision array, dimension (n-1). On entry, the N-1 offdiagonal elements of the bidiagonal matrix B. On exit, if info = 0, E is destroyed; if info > 0, D and E will contain the diagonal and superdiagonal elements of a bidiagonal matrix orthogonally equivalent to the one given as input.

inout
VT

Double precision array, dimension (ldvt, ncvt). On entry, an N-by-NCVT matrix VT. On exit, VT is overwritten by P**T * VT. Not referenced if ncvt = 0.

in
ldvt

The leading dimension of the array VT. ldvt >= max(1,n) if ncvt > 0; ldvt >= 1 if ncvt = 0.

inout
U

Double precision array, dimension (ldu, n). On entry, an NRU-by-N matrix U. On exit, U is overwritten by U * Q. Not referenced if nru = 0.

in
ldu

The leading dimension of the array U. ldu >= max(1,nru).

inout
C

Double precision array, dimension (ldc, ncc). On entry, an N-by-NCC matrix C. On exit, C is overwritten by Q**T * C. Not referenced if ncc = 0.

in
ldc

The leading dimension of the array C. ldc >= max(1,n) if ncc > 0; ldc >=1 if ncc = 0.

out
work

Double precision array, dimension (lwork). lwork = 4*n if ncvt = nru = ncc = 0, lwork = 4*(n-1) otherwise.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: the algorithm did not converge; D and E contain the elements of a bidiagonal matrix which is orthogonally similar to the input matrix B; if info = i, i elements of E have not converged to zero.

Functions

void cbdsqr(
    const char*          uplo,
    const INT            n,
    const INT            ncvt,
    const INT            nru,
    const INT            ncc,
          f32*  restrict D,
          f32*  restrict E,
          c64*  restrict VT,
    const INT            ldvt,
          c64*  restrict U,
    const INT            ldu,
          c64*  restrict C,
    const INT            ldc,
          f32*  restrict rwork,
          INT*           info
);
void cbdsqr(const char *uplo, const INT n, const INT ncvt, const INT nru, const INT ncc, f32 *restrict D, f32 *restrict E, c64 *restrict VT, const INT ldvt, c64 *restrict U, const INT ldu, c64 *restrict C, const INT ldc, f32 *restrict rwork, INT *info)#

CBDSQR computes the singular values and, optionally, the right and/or left singular vectors from the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B using the implicit zero-shift QR algorithm.

The SVD of B has the form

B = Q * S * P**H

where S is the diagonal matrix of singular values, Q is an orthogonal matrix of left singular vectors, and P is an orthogonal matrix of right singular vectors. If left singular vectors are requested, this subroutine actually returns U*Q instead of Q, and, if right singular vectors are requested, this subroutine returns P**H*VT instead of P**H, for given complex input matrices U and VT. When U and VT are the unitary matrices that reduce a general matrix A to bidiagonal form: A = U*B*VT, as computed by CGEBRD, then

A = (U*Q) * S * (P**H*VT)

is the SVD of A. Optionally, the subroutine may also compute Q**H*C for a given complex input matrix C.

Parameters

in
uplo

= ‘U’: B is upper bidiagonal; = ‘L’: B is lower bidiagonal.

in
n

The order of the matrix B. n >= 0.

in
ncvt

The number of columns of the matrix VT. ncvt >= 0.

in
nru

The number of rows of the matrix U. nru >= 0.

in
ncc

The number of columns of the matrix C. ncc >= 0.

inout
D

Single precision array, dimension (n). On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if info=0, the singular values of B in decreasing order.

inout
E

Single precision array, dimension (n-1). On entry, the N-1 offdiagonal elements of the bidiagonal matrix B. On exit, if info = 0, E is destroyed; if info > 0, D and E will contain the diagonal and superdiagonal elements of a bidiagonal matrix orthogonally equivalent to the one given as input.

inout
VT

Complex*16 array, dimension (ldvt, ncvt). On entry, an N-by-NCVT matrix VT. On exit, VT is overwritten by P**H * VT. Not referenced if ncvt = 0.

in
ldvt

The leading dimension of the array VT. ldvt >= max(1,n) if ncvt > 0; ldvt >= 1 if ncvt = 0.

inout
U

Complex*16 array, dimension (ldu, n). On entry, an NRU-by-N matrix U. On exit, U is overwritten by U * Q. Not referenced if nru = 0.

in
ldu

The leading dimension of the array U. ldu >= max(1,nru).

inout
C

Complex*16 array, dimension (ldc, ncc). On entry, an N-by-NCC matrix C. On exit, C is overwritten by Q**H * C. Not referenced if ncc = 0.

in
ldc

The leading dimension of the array C. ldc >= max(1,n) if ncc > 0; ldc >=1 if ncc = 0.

out
rwork

Single precision array, dimension (lrwork). lrwork = 4*n if ncvt = nru = ncc = 0, lrwork = 4*(n-1) otherwise.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: the algorithm did not converge; D and E contain the elements of a bidiagonal matrix which is orthogonally similar to the input matrix B; if info = i, i elements of E have not converged to zero.

Functions

void zbdsqr(
    const char*          uplo,
    const INT            n,
    const INT            ncvt,
    const INT            nru,
    const INT            ncc,
          f64*  restrict D,
          f64*  restrict E,
          c128* restrict VT,
    const INT            ldvt,
          c128* restrict U,
    const INT            ldu,
          c128* restrict C,
    const INT            ldc,
          f64*  restrict rwork,
          INT*           info
);
void zbdsqr(const char *uplo, const INT n, const INT ncvt, const INT nru, const INT ncc, f64 *restrict D, f64 *restrict E, c128 *restrict VT, const INT ldvt, c128 *restrict U, const INT ldu, c128 *restrict C, const INT ldc, f64 *restrict rwork, INT *info)#

ZBDSQR computes the singular values and, optionally, the right and/or left singular vectors from the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B using the implicit zero-shift QR algorithm.

The SVD of B has the form

B = Q * S * P**H

where S is the diagonal matrix of singular values, Q is an orthogonal matrix of left singular vectors, and P is an orthogonal matrix of right singular vectors. If left singular vectors are requested, this subroutine actually returns U*Q instead of Q, and, if right singular vectors are requested, this subroutine returns P**H*VT instead of P**H, for given complex input matrices U and VT. When U and VT are the unitary matrices that reduce a general matrix A to bidiagonal form: A = U*B*VT, as computed by ZGEBRD, then

A = (U*Q) * S * (P**H*VT)

is the SVD of A. Optionally, the subroutine may also compute Q**H*C for a given complex input matrix C.

Parameters

in
uplo

= ‘U’: B is upper bidiagonal; = ‘L’: B is lower bidiagonal.

in
n

The order of the matrix B. n >= 0.

in
ncvt

The number of columns of the matrix VT. ncvt >= 0.

in
nru

The number of rows of the matrix U. nru >= 0.

in
ncc

The number of columns of the matrix C. ncc >= 0.

inout
D

Double precision array, dimension (n). On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if info=0, the singular values of B in decreasing order.

inout
E

Double precision array, dimension (n-1). On entry, the N-1 offdiagonal elements of the bidiagonal matrix B. On exit, if info = 0, E is destroyed; if info > 0, D and E will contain the diagonal and superdiagonal elements of a bidiagonal matrix orthogonally equivalent to the one given as input.

inout
VT

Complex*16 array, dimension (ldvt, ncvt). On entry, an N-by-NCVT matrix VT. On exit, VT is overwritten by P**H * VT. Not referenced if ncvt = 0.

in
ldvt

The leading dimension of the array VT. ldvt >= max(1,n) if ncvt > 0; ldvt >= 1 if ncvt = 0.

inout
U

Complex*16 array, dimension (ldu, n). On entry, an NRU-by-N matrix U. On exit, U is overwritten by U * Q. Not referenced if nru = 0.

in
ldu

The leading dimension of the array U. ldu >= max(1,nru).

inout
C

Complex*16 array, dimension (ldc, ncc). On entry, an N-by-NCC matrix C. On exit, C is overwritten by Q**H * C. Not referenced if ncc = 0.

in
ldc

The leading dimension of the array C. ldc >= max(1,n) if ncc > 0; ldc >=1 if ncc = 0.

out
rwork

Double precision array, dimension (lrwork). lrwork = 4*n if ncvt = nru = ncc = 0, lrwork = 4*(n-1) otherwise.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: the algorithm did not converge; D and E contain the elements of a bidiagonal matrix which is orthogonally similar to the input matrix B; if info = i, i elements of E have not converged to zero.