Definition at line 31 of file KahanSum.h.
#include <KahanSum.h>
◆ KahanSum() [1/2]
MathLib::KahanSum::KahanSum |
( |
double const | value = 0 | ) |
|
|
inlineexplicitconstexpr |
Definition at line 34 of file KahanSum.h.
constexpr double value() const
◆ KahanSum() [2/2]
MathLib::KahanSum::KahanSum |
( |
ranges::range auto const & | range | ) |
|
|
inlineexplicitconstexpr |
◆ operator()()
double MathLib::KahanSum::operator() |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator+()
KahanSum MathLib::KahanSum::operator+ |
( |
double const | increment | ) |
const |
|
inlineconstexpr |
Definition at line 44 of file KahanSum.h.
45 {
47 return result += increment;
48 }
constexpr KahanSum(double const value=0)
◆ operator+=()
KahanSum & MathLib::KahanSum::operator+= |
( |
double const | increment | ) |
|
|
inlineconstexpr |
◆ operator-()
KahanSum MathLib::KahanSum::operator- |
( |
double const | increment | ) |
const |
|
inlineconstexpr |
Definition at line 50 of file KahanSum.h.
51 {
53 return result += -increment;
54 }
◆ operator-=()
KahanSum & MathLib::KahanSum::operator-= |
( |
double const | increment | ) |
|
|
inlineconstexpr |
Definition at line 56 of file KahanSum.h.
57 {
58 return *this += -increment;
59 }
◆ value()
double MathLib::KahanSum::value |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
KahanSum const & | x ) |
|
friend |
Definition at line 73 of file KahanSum.h.
74 {
75 auto const precision = os.precision();
76 return os << std::setprecision(
77 std::numeric_limits<double>::max_digits10)
78 << x.value() << " (± " << x.correction_ << ')'
79 << std::setprecision(precision);
80 }
◆ correction_
double MathLib::KahanSum::correction_ = 0. |
|
private |
◆ value_
double MathLib::KahanSum::value_ |
|
private |
The documentation for this class was generated from the following file: