lasq1#

Functions

void slasq1(
    const INT           n,
          f32* restrict D,
          f32* restrict E,
          f32* restrict work,
          INT*          info
);
void slasq1(const INT n, f32 *restrict D, f32 *restrict E, f32 *restrict work, INT *info)#

SLASQ1 computes the singular values of a real N-by-N bidiagonal matrix with diagonal D and off-diagonal E.

The singular values are computed to high relative accuracy, in the absence of denormalization, underflow and overflow.

The algorithm was first presented in “Accurate singular values and differential qd algorithms” by K. V. Fernando and B. N. Parlett, Numer. Math., Vol-67, No. 2, pp. 191-230, 1994.

Parameters

in
n

The number of rows and columns in the matrix. n >= 0.

inout
D

Double precision array, dimension (n). On entry, D contains the diagonal elements of the bidiagonal matrix whose SVD is desired. On normal exit, D contains the singular values in decreasing order.

inout
E

Double precision array, dimension (n). On entry, elements E[0:n-2] contain the off-diagonal elements of the bidiagonal matrix whose SVD is desired. On exit, E is overwritten.

out
work

Double precision array, dimension (4*n).

out
info

  • = 0: successful exit

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

  • > 0: the algorithm failed

  • = 1, a split was marked by a positive value in E

  • = 2, current block of Z not diagonalized after 100*N iterations (in inner while loop). On exit D and E represent a matrix with the same singular values which the calling subroutine could use to finish the computation, or even feed back into SLASQ1

  • = 3, termination criterion of outer while loop not met (program created more than N unreduced blocks)

Functions

void dlasq1(
    const INT           n,
          f64* restrict D,
          f64* restrict E,
          f64* restrict work,
          INT*          info
);
void dlasq1(const INT n, f64 *restrict D, f64 *restrict E, f64 *restrict work, INT *info)#

DLASQ1 computes the singular values of a real N-by-N bidiagonal matrix with diagonal D and off-diagonal E.

The singular values are computed to high relative accuracy, in the absence of denormalization, underflow and overflow.

The algorithm was first presented in “Accurate singular values and differential qd algorithms” by K. V. Fernando and B. N. Parlett, Numer. Math., Vol-67, No. 2, pp. 191-230, 1994.

Parameters

in
n

The number of rows and columns in the matrix. n >= 0.

inout
D

Double precision array, dimension (n). On entry, D contains the diagonal elements of the bidiagonal matrix whose SVD is desired. On normal exit, D contains the singular values in decreasing order.

inout
E

Double precision array, dimension (n). On entry, elements E[0:n-2] contain the off-diagonal elements of the bidiagonal matrix whose SVD is desired. On exit, E is overwritten.

out
work

Double precision array, dimension (4*n).

out
info

  • = 0: successful exit

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

  • > 0: the algorithm failed

  • = 1, a split was marked by a positive value in E

  • = 2, current block of Z not diagonalized after 100*N iterations (in inner while loop). On exit D and E represent a matrix with the same singular values which the calling subroutine could use to finish the computation, or even feed back into DLASQ1

  • = 3, termination criterion of outer while loop not met (program created more than N unreduced blocks)