11#ifndef TLAPACK_BLAS_TRSV_HH
12#define TLAPACK_BLAS_TRSV_HH
72 const idx_t n = nrows(
A);
87 for (idx_t j = n - 1; j != idx_t(-1); --j) {
93 for (idx_t i = j - 1; i != idx_t(-1); --i) {
94 x[i] -=
x[j] *
A(i, j);
100 for (idx_t j = 0; j < n; ++j) {
105 for (idx_t i = j + 1; i < n; ++i) {
106 x[i] -=
x[j] *
A(i, j);
115 for (idx_t j = n - 1; j != idx_t(-1); --j) {
121 for (idx_t i = j - 1; i != idx_t(-1); --i) {
128 for (idx_t j = 0; j < n; ++j) {
133 for (idx_t i = j + 1; i < n; ++i) {
146 for (idx_t j = 0; j < n; ++j) {
148 for (idx_t i = 0; i < j; ++i) {
149 tmp -=
A(i, j) *
x[i];
159 for (idx_t j = n - 1; j != idx_t(-1); --j) {
161 for (idx_t i = j + 1; i < n; ++i) {
162 tmp -=
A(i, j) *
x[i];
179 for (idx_t j = 0; j < n; ++j) {
181 for (idx_t i = 0; i < j; ++i) {
192 for (idx_t j = n - 1; j != idx_t(-1); --j) {
194 for (idx_t i = j + 1; i < n; ++i) {
206#ifdef TLAPACK_USE_LAPACKPP
216 auto A_ = legacy_matrix(
A);
217 auto x_ = legacy_vector(
x);
221 const auto& n =
A_.n;
224 ::blas::trsv((::blas::Layout)L, (::blas::Uplo)
uplo, (::blas::Op)
trans,
225 (::blas::Diag)
diag, n,
A_.ptr,
A_.ldim,
x_.ptr,
x_.inc);
228 ::blas::trsv((::blas::Layout)L, (::blas::Uplo)
uplo, ::blas::Op::NoTrans,
229 (::blas::Diag)
diag, n,
A_.ptr,
A_.ldim,
x_.ptr,
x_.inc);
#define TLAPACK_LEGACY_VECTOR
Macro for tlapack::concepts::LegacyVector compatible with C++17.
Definition concepts.hpp:954
#define TLAPACK_LEGACY_MATRIX
Macro for tlapack::concepts::LegacyMatrix compatible with C++17.
Definition concepts.hpp:951
#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 conjugate(vector_t &x)
Conjugates a vector.
Definition conjugate.hpp:24
void trsv(Uplo uplo, Op trans, Diag diag, const matrixA_t &A, vectorX_t &x)
Solve the triangular matrix-vector equation.
Definition trsv.hpp:64
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
Concept for types that represent tlapack::Diag.
Concept for types that represent tlapack::Op.
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 T conj(const T &x) noexcept
Extends std::conj() to real datatypes.
Definition utils.hpp:100
Diag
Definition types.hpp:197
@ Unit
The main diagonal is assumed to consist of 1's.
@ NonUnit
The main diagonal is not assumed to consist of 1's.
constexpr auto diag(T &A, int diagIdx=0) noexcept
Get the Diagonal of an Eigen Matrix.
Definition eigen.hpp:576
Op
Definition types.hpp:227
@ Conj
non-transpose conjugate
@ ConjTrans
conjugate transpose
Uplo
Definition types.hpp:50
@ Upper
0 <= i <= j, 0 <= j <= n.
@ Lower
0 <= i <= m, 0 <= j <= i.
Layout
Definition types.hpp:29