Function bidiag_decomp (o2scl_linalg)¶
-
template<class mat_t, class vec_t, class vec2_t>
int o2scl_linalg::bidiag_decomp(size_t M, size_t N, mat_t &A, vec_t &tau_U, vec2_t &tau_V)¶ Factor a matrix into bidiagonal form.
Factor matrix A of size
(M,N)
with \( M\geq N \) into \( A = U B V^T \) where U and V are orthogonal and B is upper bidiagonal.After the function call, the matrix \( B \) is stored the diagonal and first superdiagonal of
A
. The matrices \( U \) and \( V \) are stored as packed sets of Householder transformations in the lower and upper triangular parts ofA
, respectively.Adapted from the GSL version which was based on algorithm 5.4.2 in [Golub96].