11#ifndef TLAPACK_BLAS_TRMV_HH
12#define TLAPACK_BLAS_TRMV_HH
68 const idx_t n = nrows(
A);
83 for (idx_t j = 0; j < n; ++j) {
86 for (idx_t i = 0; i < j; ++i)
87 x[i] +=
x[j] *
A(i, j);
93 for (idx_t j = n - 1; j != idx_t(-1); --j) {
95 for (idx_t i = n - 1; i >= j + 1; --i)
96 x[i] +=
x[j] *
A(i, j);
105 for (idx_t j = 0; j < n; ++j) {
108 for (idx_t i = 0; i < j; ++i)
115 for (idx_t j = n - 1; j != idx_t(-1); --j) {
117 for (idx_t i = n - 1; i >= j + 1; --i)
130 for (idx_t j = n - 1; j != idx_t(-1); --j) {
133 for (idx_t i = j - 1; i != idx_t(-1); --i)
134 tmp +=
A(i, j) *
x[i];
140 for (idx_t j = 0; j < n; ++j) {
143 for (idx_t i = j + 1; i < n; ++i)
144 tmp +=
A(i, j) *
x[i];
157 for (idx_t j = n - 1; j != idx_t(-1); --j) {
160 for (idx_t i = j - 1; i != idx_t(-1); --i)
167 for (idx_t j = 0; j < n; ++j) {
170 for (idx_t i = j + 1; i < n; ++i)
178#ifdef TLAPACK_USE_LAPACKPP
188 auto A_ = legacy_matrix(
A);
189 auto x_ = legacy_vector(
x);
193 const auto& n =
A_.n;
196 ::blas::trmv((::blas::Layout)L, (::blas::Uplo)
uplo, (::blas::Op)
trans,
197 (::blas::Diag)
diag, n,
A_.ptr,
A_.ldim,
x_.ptr,
x_.inc);
200 ::blas::trmv((::blas::Layout)L, (::blas::Uplo)
uplo, ::blas::Op::NoTrans,
201 (::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 trmv(Uplo uplo, Op trans, Diag diag, const matrixA_t &A, vectorX_t &x)
Triangular matrix-vector multiply:
Definition trmv.hpp:60
#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