MySQL 9.6.0
Source Code Documentation
summation.h File Reference

Experimental API header. More...

#include <iterator>
#include <numeric>
#include <type_traits>

Go to the source code of this file.

Classes

class  mysql::math::Kahan_sum< Value_tp >
 Tracks the state of the Kahan summation algorithm, which produces a sum over a sequence of floating point numbers with very low numeric error, using an internal error compensation term. More...
 

Namespaces

namespace  mysql
 
namespace  mysql::math
 

Functions

template<class Value_t = double, std::input_iterator Iterator_t>
Value_t mysql::math::kahan_sum (const Iterator_t &first, const std::sentinel_for< Iterator_t > auto &last, Value_t init=0)
 Compute the sum of values in the given range, with very low numeric error. More...
 
template<class Result_t = long double, std::input_iterator Iterator1_t, std::input_iterator Iterator2_t>
requires std::is_arithmetic_v<Result_t> && std::unsigned_integral<decltype(*std::declval<Iterator1_t>())> && std::unsigned_integral<decltype(*std::declval<Iterator2_t>())>
Result_t mysql::math::sequence_sum_difference (const Iterator1_t &begin1, const std::sentinel_for< Iterator1_t > auto &end1, const Iterator2_t &begin2, const std::sentinel_for< Iterator2_t > auto &end2, uint64_t init=0)
 Compute the sum of values in the first sequence, minus the sum of values in the second sequence. More...
 

Detailed Description

Experimental API header.