MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
wrapping_arithmetic.hpp File Reference
#include <cmath>
#include <type_traits>

Namespaces

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

Macros

#define MTL5_WRAPS_ON_PURPOSE

Typedefs

template<typename T>
using mtl::detail::wrap_op_t = std::common_type_t<std::make_unsigned_t<T>, unsigned int>
 The type the modular arithmetic is actually performed in: the unsigned counterpart of T, or unsigned int when that is narrower than int.

Functions

template<typename T>
MTL5_WRAPS_ON_PURPOSE constexpr T mtl::detail::wrap_add (T a, T b) noexcept
template<typename T>
MTL5_WRAPS_ON_PURPOSE constexpr T mtl::detail::wrap_sub (T a, T b) noexcept
template<typename T>
MTL5_WRAPS_ON_PURPOSE constexpr T mtl::detail::wrap_mul (T a, T b) noexcept
template<typename Result, typename A, typename B>
constexpr Result mtl::detail::generic_fma (Result acc, const A &a, const B &b)
 acc + a * b for the generic element-wise loops: wrapping when the result type is integral, the plain expression otherwise.
template<typename Result, typename A>
constexpr Result mtl::detail::generic_add (Result acc, const A &a)
 acc + a for the generic element-wise loops: wrapping when the result type is integral, the plain expression otherwise (#461).
template<typename T>
constexpr auto mtl::detail::generic_abs (const T &a)
 |a|, wrapping, for the norm accumulations (#461).
template<typename Result, typename A, typename B>
constexpr Result mtl::detail::generic_mul (const A &a, const B &b)
 a * b delivered in Result: wrapping when Result is integral, the plain expression otherwise (#461).

Variables

template<typename T>
constexpr bool mtl::detail::is_wrapping_integer_v
 Integral types these helpers wrap.

Macro Definition Documentation

◆ MTL5_WRAPS_ON_PURPOSE

#define MTL5_WRAPS_ON_PURPOSE