12#ifndef TLAPACK_TREVC_FORWARDSOLVE_HH
13#define TLAPACK_TREVC_FORWARDSOLVE_HH
83 const idx_t n = nrows(T);
95 for (idx_t i = 0; i <
k; ++i) {
99 for (idx_t i =
k + 1; i < n; ++i) {
113 while (i < size(
v3)) {
115 if (i + 1 < size(
v3)) {
116 if (
T33(i + 1, i) !=
TT(0)) {
138 for (idx_t j = 0; j < size(
v3); ++j) {
144 for (idx_t j = 0; j < i; ++j) {
146 v3[i + 1] -=
T33(j, i + 1) *
v3[j];
155 TT c =
T33(i, i + 1);
165 for (idx_t j = 0; j < i; ++j) {
168 for (idx_t j = i + 2; j < size(
v3); ++j) {
190 for (idx_t j = 0; j < size(
v3); ++j) {
196 for (idx_t j = 0; j < i; ++j) {
208 for (idx_t j = 0; j < i; ++j) {
211 for (idx_t j = i + 1; j < size(
v3); ++j) {
242 const idx_t n = nrows(T);
254 for (idx_t i = 0; i <
k; ++i) {
258 for (idx_t i =
k + 1; i < n; ++i) {
271 for (idx_t i = 0; i < size(
v3); ++i) {
281 for (idx_t j = 0; j < size(
v3); ++j) {
287 for (idx_t j = 0; j < i; ++j) {
299 for (idx_t j = 0; j < i; ++j) {
302 for (idx_t j = i + 1; j < size(
v3); ++j) {
381 const idx_t n = nrows(T);
414 for (idx_t i = 0; i <
k; ++i) {
422 for (idx_t i =
k + 2; i < n; ++i) {
424 v_i[i] = -T(
k + 1, i) *
y3;
436 while (i < size(
v4_r)) {
438 if (i + 1 < size(
v4_r)) {
439 if (
T44(i + 1, i) !=
TT(0)) {
469 for (idx_t j = 0; j < size(
v4_r); ++j) {
476 for (idx_t j = 0; j < i; ++j) {
508 for (idx_t j = 0; j < i; ++j) {
512 for (idx_t j = i + 2; j < size(
v4_r); ++j) {
538 for (idx_t j = 0; j < size(
v4_r); ++j) {
545 for (idx_t j = 0; j < i; ++j) {
563 for (idx_t j = 0; j < i; ++j) {
567 for (idx_t j = i + 1; j < size(
v4_r); ++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
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
void trevc_forwardsolve_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 left eigenvector pair of T using forward substitution.
Definition trevc_forwardsolve.hpp:371
constexpr T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
void trevc_forwardsolve_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 left eigenvector of T using forward substitution.
Definition trevc_forwardsolve.hpp:73
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_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