12#ifndef TLAPACK_TIK_BIDIAG_ELDEN_HH
13#define TLAPACK_TIK_BIDIAG_ELDEN_HH
62 const idx_t m = nrows(
A);
63 const idx_t n = ncols(
A);
64 const idx_t
k = ncols(
b);
67 std::vector<T>
tauv(n);
68 std::vector<T>
tauw(n);
76 std::vector<real_t>
d(n);
77 std::vector<real_t>
e(n - 1);
79 for (idx_t j = 0; j < n; ++j)
81 for (idx_t j = 0; j < n - 1; ++j)
97 for (idx_t i = 0; i < n; i++) {
112 for (idx_t j = 0; j <
k; ++j) {
114 b(0, j) =
cs *
b(0, j);
133 for (idx_t j = 0; j <
k; ++j) {
145 for (idx_t i = n - 1; i-- > 0;) {
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
#define TLAPACK_REAL
Macro for tlapack::concepts::Real compatible with C++17.
Definition concepts.hpp:918
void laset(uplo_t uplo, const type_t< matrix_t > &alpha, const type_t< matrix_t > &beta, matrix_t &A)
Initializes a matrix to diagonal and off-diagonal values.
Definition laset.hpp:38
void rscl(const alpha_t &alpha, vector_t &x)
Scale vector by the reciprocal of a constant, .
Definition rscl.hpp:22
void rotg(T &a, T &b, T &c, T &s)
Construct plane rotation that eliminates b, such that:
Definition rotg.hpp:39
void rot(vectorX_t &x, vectorY_t &y, const c_type &c, const s_type &s)
Apply plane rotation:
Definition rot.hpp:44
void axpy(const alpha_t &alpha, const vectorX_t &x, vectorY_t &y)
Add scaled vector, .
Definition axpy.hpp:34
int unmqr(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, matrixC_t &C, const UnmqrOpts &opts={})
Applies orthogonal matrix op(Q) to a matrix C using a blocked code.
Definition unmqr.hpp:158
int unmlq(side_t side, trans_t trans, const matrixA_t &A, const tau_t &tau, matrixC_t &C, const UnmlqOpts &opts={})
Applies orthogonal matrix op(Q) to a matrix C using a blocked code.
Definition unmlq.hpp:159
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
int bidiag(matrix_t &A, vector_t &tauv, vector_t &tauw, const BidiagOpts &opts={})
Reduces a general m by n matrix A to an upper real bidiagonal form B by a unitary transformation:
Definition bidiag.hpp:134
Multiplies the general m-by-n matrix C by Q from tlapack::geqrf()
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
constexpr internal::GeneralAccess GENERAL
General access.
Definition types.hpp:180
constexpr internal::ConjTranspose CONJ_TRANS
conjugate transpose
Definition types.hpp:264
constexpr internal::LeftSide LEFT_SIDE
left side
Definition types.hpp:294
Multiplies the general m-by-n matrix C by Q from tlapack::gelqf()