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 223 of file multispot5.cc.
Kahan::Kahan | ( | ) | [inline] |
Definition at line 231 of file multispot5.cc.
void Kahan::add | ( | double | i | ) | [inline] |
Add a number to the running sum.
i | Number to add |
Definition at line 237 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 225 of file multispot5.cc.
Referenced by add().
double Kahan::c [private] |
Running compenstation for low-order bits.
Definition at line 226 of file multispot5.cc.
Referenced by add().
double Kahan::t [private] |
y + sum, which loses low order bits of y. Temporary working space.
Definition at line 227 of file multispot5.cc.
Referenced by add().
double Kahan::sum |