12#ifndef TLAPACK_TREVC_BACKSOLVE_HH
13#define TLAPACK_TREVC_BACKSOLVE_HH
89 const idx_t n = nrows(T);
99 for (idx_t i = 0; i <
k; ++i) {
103 for (idx_t i =
k + 1; i < n; ++i) {
119 idx_t i =
k - 1 -
ii;
122 if (
T11(i, i - 1) !=
TT(0)) {
132 TT a =
T11(i - 1, i - 1) -
w;
134 TT c =
T11(i, i - 1);
144 for (idx_t j = 0; j + 1 < i; ++j) {
147 for (idx_t j = i + 1; j <
k; ++j) {
164 for (idx_t j = 0; j + 1 < i; ++j) {
171 for (idx_t j = i - 1; j <
k; ++j) {
178 for (idx_t j = 0; j + 1 < i; ++j) {
179 v1[j] -=
T11(j, i - 1) *
v1[i - 1];
206 for (idx_t j = 0; j < i; ++j) {
209 for (idx_t j = i + 1; j <
k; ++j) {
228 for (idx_t j = 0; j < i; ++j) {
232 for (idx_t j = i; j <
k; ++j) {
239 for (idx_t j = 0; j < i; ++j) {
270 const idx_t n = nrows(T);
280 for (idx_t i = 0; i <
k; ++i) {
284 for (idx_t i =
k + 1; i < n; ++i) {
295 for (idx_t
ii = 0;
ii <
k; ++
ii) {
296 idx_t i =
k - 1 -
ii;
307 for (idx_t j = 0; j < i; ++j) {
310 for (idx_t j = i + 1; j <
k; ++j) {
329 for (idx_t j = 0; j < i; ++j) {
333 for (idx_t j = i; j <
k; ++j) {
340 for (idx_t j = 0; j < i; ++j) {
425 const idx_t n = nrows(T);
456 for (idx_t i = 0; i <
k; ++i) {
458 v_i[i] = -T(i,
k + 1) *
x3;
464 for (idx_t i =
k + 2; i < n; ++i) {
480 idx_t i =
k - 1 -
ii;
483 if (
T11(i, i - 1) !=
TT(0)) {
524 for (idx_t j = 0; j + 1 < i; ++j) {
528 for (idx_t j = i + 1; j <
k; ++j) {
551 for (idx_t j = 0; j + 1 < i; ++j) {
564 for (idx_t j = i - 1; j <
k; ++j) {
573 for (idx_t j = 0; j + 1 < i; ++j) {
602 for (idx_t j = 0; j < i; ++j) {
606 for (idx_t j = i + 1; j <
k; ++j) {
625 for (idx_t j = 0; j < i; ++j) {
632 for (idx_t j = i; j <
k; ++j) {
641 for (idx_t j = 0; j < i; ++j) {
#define TLAPACK_VECTOR
Macro for tlapack::concepts::Vector compatible with C++17.
Definition concepts.hpp:906
#define TLAPACK_MATRIX
Macro for tlapack::concepts::Matrix compatible with C++17.
Definition concepts.hpp:896
void ladiv(const real_t &a, const real_t &b, const real_t &c, const real_t &d, real_t &p, real_t &q)
Performs complex division in real arithmetic.
Definition ladiv.hpp:39
size_type< vector_t > iamax(const vector_t &x, const IamaxOpts< abs_f > &opts)
Return .
Definition iamax.hpp:234
#define tlapack_check(cond)
Throw an error if cond is false.
Definition exceptionHandling.hpp:98
Sort the numbers in D in increasing order (if ID = 'I') or in decreasing order (if ID = 'D' ).
Definition arrayTraits.hpp:15
void trevc_backsolve_double(const matrix_T_t &T, vector_v_t &v_r, vector_v_t &v_i, const size_type< matrix_T_t > k, const vector_colN_t &colN)
Calculate the k-th right eigenvector pair of T using backsubstitution.
Definition trevc_backsolve.hpp:415
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 > abs1(const T &x)
1-norm absolute value, |Re(x)| + |Im(x)|
Definition utils.hpp:133
T trevc_protectupdate(T ynorm, T tnorm, T xnorm, T sf_max)
Given the infinity norms of the matrices Y, T, and X, calculate a scaling factor scale in (0,...
Definition trevc_protect.hpp:138
T trevc_protectdiv(T a, T b, T sf_min, T sf_max)
Given two numbers a and b, calculate a scaling factor alpha in (0, 1] such that the division (a * alp...
Definition trevc_protect.hpp:37
void trevc_backsolve_single(const matrix_T_t &T, vector_v_t &v, const size_type< matrix_T_t > k, const vector_colN_t &colN)
Calculate the k-th right eigenvector of T using backsubstitution.
Definition trevc_backsolve.hpp:79
void trevc_2x2solve(T a, T b, T c, T d, T &x1, T &x2, T &scale, T sf_min, T sf_max)
Robustly solve a 2x2 system of equations (a b) (x1) = scale * (rhs1) (c d) (x2) (rhs2)
Definition trevc_protect.hpp:214