9namespace uni20::linalg::backends::cpu::detail
13template <uni20::Real Real>
class CompensatedRealSum {
28 correction_ += (sum_ - next) +
value;
32 correction_ += (
value - next) + sum_;
37 [[nodiscard]]
Real value()
const {
return sum_ + correction_; }
45template <uni20::RealOrComplex Scalar>
class CompensatedSum {
53 real_.add(
value.real());
54 imaginary_.add(
value.imag());
66 return Scalar{real_.value(), imaginary_.value()};
75 CompensatedRealSum<real_type> real_;
76 CompensatedRealSum<real_type> imaginary_;
Concept for complex scalar types.
Definition scalar_concepts.hpp:75
Concept for real scalar types (float, double, etc.).
Definition scalar_concepts.hpp:69
Concept for numeric scalar types (integer, real, or complex).
Definition scalar_concepts.hpp:81
locale_t value
Definition data_table.cpp:49
typename make_real< T >::type make_real_t
Alias for the underlying real-valued type of T.
Definition scalar_traits.hpp:168
constexpr bool isfinite(I const &x) noexcept
Returns whether an integer scalar is finite.
Definition math.hpp:121
Scalar math helper utilities.
constexpr auto abs(basic_half_int< T > value) -> basic_half_int< T >
Return the absolute value of a half-integer.
Definition half_int.hpp:431
Return the sum of two element values.
Definition elementwise_functions.hpp:102