79 c_ = (t_ -
sum_) - y_;
T sum_
Definition: kahan_sum.hpp:24
Definition: coefficients_file_parser.cpp:10
T t_
Definition: kahan_sum.hpp:35
KahanSum()=default
compiler-generated default constructor
T y_
Definition: kahan_sum.hpp:34
T c_
Definition: kahan_sum.hpp:29
KahanSum & operator+=(const T &summand)
adds a number
Definition: kahan_sum.hpp:75
The Kahan's algorithm achieves O(1) error growth for summing N numbers.
Definition: kahan_sum.hpp:18
KahanSum(const T &zero)
A zero initializing constructor for types that cannot provide a default constructor.
Definition: kahan_sum.hpp:55
KahanSum & operator=(const KahanSum< T > &that)=default
compiler-generated copy assignment operator
const T & operator()() const
retrieves accumulated sum.
Definition: kahan_sum.hpp:89