ThreeB 1.1
|
Class implementing the Kahan summation algorithm to allow accurate summation of very large numbers of doubles. More...
Public Member Functions | |
Kahan () | |
void | add (double i) |
Public Attributes | |
double | sum |
Private Attributes | |
double | y |
double | c |
double | t |
Class implementing the Kahan summation algorithm to allow accurate summation of very large numbers of doubles.
Definition at line 226 of file multispot5.cc.
Kahan::Kahan | ( | ) | [inline] |
Definition at line 234 of file multispot5.cc.
void Kahan::add | ( | double | i | ) | [inline] |
Add a number to the running sum.
i | Number to add |
Definition at line 240 of file multispot5.cc.
Referenced by NegativeFreeEnergy::compute_with_mask(), and NegativeFreeEnergy::operator()().
double Kahan::y [private] |
Input with the compensation removed. Temporary working space.
Definition at line 228 of file multispot5.cc.
double Kahan::c [private] |
Running compenstation for low-order bits.
Definition at line 229 of file multispot5.cc.
double Kahan::t [private] |
y + sum, which loses low order bits of y. Temporary working space.
Definition at line 230 of file multispot5.cc.
double Kahan::sum |
running sum
Definition at line 232 of file multispot5.cc.