12#ifndef TLAPACK_GESVD_HH
13#define TLAPACK_GESVD_HH
65template <TLAPACK_SMATRIX matrix_t, TLAPACK_SVECTOR r_vector_t>
82 const idx_t m = nrows(
A);
83 const idx_t n = ncols(
A);
84 const idx_t
k = min(m, n);
91 std::vector<type_t<r_vector_t>>
e_;
99 for (idx_t i = 0; i <
k; ++i) {
101 if (i + 1 < n)
e[i] =
real(
A(i, i + 1));
106 for (idx_t i = 0; i <
k; ++i) {
108 if (i + 1 < m)
e[i] =
real(
A(i + 1, i));
int ungbr_q(const size_type< matrix_t > k, matrix_t &A, const vector_t &tau, const UngbrOpts &opts={})
Generates the unitary matrix Q determined by gebrd when reducing a matrix A to bidiagonal form: A = Q...
Definition ungbr.hpp:201
int gebrd(matrix_t &A, vector_t &tauv, vector_t &tauw, const GebrdOpts &opts={})
Reduces a general m by n matrix A to an upper real bidiagonal form B by a unitary transformation:
Definition gebrd.hpp:202
int ungbr_p(const size_type< matrix_t > k, matrix_t &A, const vector_t &tau, const UngbrOpts &opts={})
Generates the unitary matrix P**H determined by gebrd when reducing a matrix A to bidiagonal form: A ...
Definition ungbr.hpp:311
void lacpy(uplo_t uplo, const matrixA_t &A, matrixB_t &B)
Copies a matrix from A to B.
Definition lacpy.hpp:38
int svd_qr(Uplo uplo, bool want_u, bool want_vt, d_t &d, e_t &e, matrix_t &U, matrix_t &Vt)
Computes the singular values and, optionally, the right and/or left singular vectors from the singula...
Definition svd_qr.hpp:85
int gesvd(bool want_u, bool want_vt, matrix_t &A, r_vector_t &s, matrix_t &U, matrix_t &Vt, const GesvdOpts &opts={})
Computes the singular values and, optionally, the right and/or left singular vectors from the singula...
Definition gesvd.hpp:66
Concept for types that represent tlapack::Uplo.
Sort the numbers in D in increasing order (if ID = 'I') or in decreasing order (if ID = 'D' ).
Definition arrayTraits.hpp:15
typename traits::real_type_traits< Types..., int >::type real_type
The common real type of the list of types.
Definition scalar_type_traits.hpp:113
constexpr real_type< T > real(const T &x) noexcept
Extends std::real() to real datatypes.
Definition utils.hpp:71
@ Upper
0 <= i <= j, 0 <= j <= n.
@ Lower
0 <= i <= m, 0 <= j <= i.
Options struct for gesvd.
Definition gesvd.hpp:25
float shapethresh
Definition gesvd.hpp:28