MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
symv.hpp File Reference
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <limits>
#include <type_traits>
#include <vector>
#include <mtl/concepts/scalar.hpp>
#include <mtl/concepts/vector.hpp>
#include <mtl/concepts/matrix.hpp>
#include <mtl/math/identity.hpp>
#include <mtl/math/accumulator_traits.hpp>
#include <mtl/detail/same_object.hpp>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/interface/dispatch_traits.hpp>
#include <mtl/detail/column_sweep.hpp>

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Functions

template<std::size_t R, typename Acc, typename TA, typename TX>
void mtl::detail::symv_strip_scatter (std::size_t len, const TA *const *p, const TX *xr, Acc *acc)
 acc[j] += p[0][j] x[0] + p[1][j] x[1] + ... in row order, for j < len: R rows' contributions to the entries left of the strip.
template<std::size_t R, typename Acc, typename TA, typename X>
MTL5_NO_LOOP_VECTORIZE void mtl::detail::symv_strip_gather (std::size_t len, const TA *const *p, Acc *s, const X &x, std::size_t j0)
 s[r] += p[r][j] x[j] in ascending j, for j < len: each row's own sum, R independent chains sharing each x[j] (see MTL5_NO_LOOP_VECTORIZE).
template<typename Accumulator = void, Scalar S, Matrix M, Vector VX, Vector VY>
void mtl::symv (const S &alpha, const M &A, const VX &x, const S &beta, VY &y)
 Symmetric matrix-vector product: y = alpha*A*x + beta*y, A assumed symmetric.

Variables

template<typename Accumulator, typename M, typename VX, typename VY>
constexpr bool mtl::detail::symv_dispatches_blas_v
 Whether symv<Accumulator>(alpha, A, x, beta, y) calls ?symv (for sizes that fit an int).
template<typename M>
constexpr bool mtl::detail::symv_uses_row_loop_v = row_major_contiguous_v<M>
 Whether the generic symv<void> makes one row-wise pass over a row-major A's lower triangle (#724).
constexpr std::size_t mtl::detail::symv_strip_rows = 8
 Rows per strip of the row-major symv (#236), and columns per block of a strip's pass over the columns left of it: 8 rows of 256 doubles are 16 KB, in L1 for the second of the two loops below.
constexpr std::size_t mtl::detail::symv_strip_block = 256
constexpr std::size_t mtl::detail::symv_strip_min_n = 128