11#ifndef TLAPACK_BLAS_GEMV_HH
12#define TLAPACK_BLAS_GEMV_HH
82 if (m == 0 || n == 0)
return;
85 for (idx_t i = 0; i < m; ++i)
90 for (idx_t j = 0; j < n; ++j) {
92 for (idx_t i = 0; i < m; ++i) {
93 y[i] +=
tmp *
A(i, j);
99 for (idx_t j = 0; j < n; ++j) {
101 for (idx_t i = 0; i < m; ++i) {
108 for (idx_t i = 0; i < m; ++i) {
110 for (idx_t j = 0; j < n; ++j) {
111 tmp +=
A(j, i) *
x[j];
118 for (idx_t i = 0; i < m; ++i) {
120 for (idx_t j = 0; j < n; ++j) {
128#ifdef TLAPACK_USE_LAPACKPP
163 auto A_ = legacy_matrix(
A);
164 auto x_ = legacy_vector(
x);
165 auto y_ = legacy_vector(
y);
169 const auto& m =
A_.m;
170 const auto& n =
A_.n;
175 -2,
"Infs and NaNs in A or x will not propagate to y on output");
179 "Infs and NaNs in y on input will not propagate to y on output");
182 ::blas::gemv((::blas::Layout)L, (::blas::Op)
trans, m, n,
alpha,
A_.ptr,
185 T*
x2 =
const_cast<T*
>(
x_.ptr);
186 for (idx_t i = 0; i <
x_.n; ++i)
189 ::blas::gemv((::blas::Layout)L, ::blas::Op::NoTrans, m, n,
conj(
alpha),
192 for (idx_t i = 0; i <
x_.n; ++i)
#define TLAPACK_SCALAR
Macro for tlapack::concepts::Scalar compatible with C++17.
Definition concepts.hpp:915
#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 gemv(Op trans, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, const beta_t &beta, vectorY_t &y)
General matrix-vector multiply:
Definition gemv.hpp:57
#define tlapack_check_false(cond)
Throw an error if cond is true.
Definition exceptionHandling.hpp:113
#define tlapack_warning(info, detailedInfo)
Warning handler.
Definition exceptionHandling.hpp:156
Concept for types that represent tlapack::Op.
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
Op
Definition types.hpp:227
@ Conj
non-transpose conjugate
@ ConjTrans
conjugate transpose
Layout
Definition types.hpp:29
Strong zero type.
Definition StrongZero.hpp:43