|
FEAT 3
Finite Element Analysis Toolbox
|
Kahan Summation accumulator class template. More...
#include <kahan_accumulator.hpp>
Public Member Functions | |
| KahanAccumulator () | |
| default constructor More... | |
| KahanAccumulator (DT_ val) | |
| constructor More... | |
| void | clear () |
| clears the accumulator, i.e. sets all values to zero More... | |
| operator DT_ () const | |
| returns the value of the sum More... | |
| KahanAccumulator & | operator+= (DT_ val) |
| updates the summed accumulator with a new summand More... | |
Public Attributes | |
| DT_ | correction |
| the current correction More... | |
| DT_ | value |
| the current sum value More... | |
Kahan Summation accumulator class template.
This class implements the Kahan summation algorithm for a given floating point data type, see e.g. https://en.wikipedia.org/wiki/Kahan_summation_algorithm
Definition at line 19 of file kahan_accumulator.hpp.
|
inline |
default constructor
Definition at line 28 of file kahan_accumulator.hpp.
|
inlineexplicit |
constructor
Definition at line 35 of file kahan_accumulator.hpp.
|
inline |
clears the accumulator, i.e. sets all values to zero
Definition at line 42 of file kahan_accumulator.hpp.
References FEAT::KahanAccumulator< DT_ >::correction, and FEAT::KahanAccumulator< DT_ >::value.
Referenced by FEAT::Statistics::reset_times().
|
inline |
returns the value of the sum
Definition at line 58 of file kahan_accumulator.hpp.
|
inline |
updates the summed accumulator with a new summand
Definition at line 48 of file kahan_accumulator.hpp.
References FEAT::KahanAccumulator< DT_ >::correction, and FEAT::KahanAccumulator< DT_ >::value.
| DT_ FEAT::KahanAccumulator< DT_ >::correction |
the current correction
Definition at line 25 of file kahan_accumulator.hpp.
Referenced by FEAT::KahanAccumulator< DT_ >::clear(), and FEAT::KahanAccumulator< DT_ >::operator+=().
| DT_ FEAT::KahanAccumulator< DT_ >::value |
the current sum value
Definition at line 23 of file kahan_accumulator.hpp.
Referenced by FEAT::KahanAccumulator< DT_ >::clear(), FEAT::Statistics::get_formatted_times(), FEAT::KahanAccumulator< double >::operator double(), and FEAT::KahanAccumulator< DT_ >::operator+=().