10#ifndef TLAPACK_HESSENBERG_RQ_HH
11#define TLAPACK_HESSENBERG_RQ_HH
56 const idx_t n = ncols(T);
57 const idx_t
k = n - 1;
63 for (idx_t j = n - 2; j != (idx_t)-1; --j) {
64 TA temp = cl[j] * T(j, n - 1) +
sl[j] * T(j + 1, n - 1);
65 T(j + 1, n - 1) = -
conj(
sl[j]) * T(j, n - 1) + cl[j] * T(j + 1, n - 1);
69 for (idx_t i = n - 1; i > 0; --i) {
71 for (idx_t j = i - 1; j != (idx_t)-1; --j) {
72 TA temp = cl[j] * T(j, i - 1) +
sl[j] * T(j + 1, i - 1);
74 -
conj(
sl[j]) * T(j, i - 1) + cl[j] * T(j + 1, i - 1);
79 rotg(T(i, i), T(i, i - 1),
cr[i - 1],
sr[i - 1]);
80 sr[i - 1] = -
sr[i - 1];
84 auto t1 = slice(T,
range(0, i), i - 1);
85 auto t2 = slice(T,
range(0, i), i);
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
#define TLAPACK_SVECTOR
Macro for tlapack::concepts::SliceableVector compatible with C++17.
Definition concepts.hpp:909
#define TLAPACK_SMATRIX
Macro for tlapack::concepts::SliceableMatrix compatible with C++17.
Definition concepts.hpp:899
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 hessenberg_rq(T_t &T, CL_t &cl, SL_t &sl, CR_t &cr, SR_t &sr)
Applies a sequence of rotations to an upper triangular matrix T from the left (making it an upper Hes...
Definition hessenberg_rq.hpp:49
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