jimlutsko / classicalDFT

GNU General Public License v3.0
9 stars 1 forks source link

Refactor: Summation class into Arithmetic #25

Closed migduroli closed 4 years ago

migduroli commented 4 years ago

The Summation class involved the implementation of the improved Kahan–Babuška algorithm of Neumaier. Such an algorithm is also referred to as compensated summation. It significantly reduces the numerical error involved when adding a sequence of finite-precision floating-point numbers.

The goal of this issue is not only moving the implementation given in Summation.h into the module numerics, but also carrying out a proper refactor. Indeed, this class could be understood as new "double-like type" which is only used when higher accuracy addition or subtraction operations are required.

Taking advantage of this refactoring, we are going to create a new class header where all the arithmetic could be implemented at once. This follows our original goal described in #15 of re-organising the library with a more intuitive folder structure.