Implements Kahan algorithm for floating point accumulations.
More...
#include <hart_accurate_sum.hpp>
|
| | AccurateSum (SampleType initialSum=(SampleType) 0) |
| | Inits AccurateSum with a specific value.
|
| |
| AccurateSum & | operator= (SampleType initialSum) |
| | Assigns AccurateSum's accumulated sum to a specific value.
|
| |
| AccurateSum & | operator+= (SampleType value) |
| | Adds a value to a sum, tracking the potential floating point error.
|
| |
| | operator SampleType () const |
| | Value accumulated by the += operator.
|
| |
| template<typename RequestedType > |
| RequestedType | get () const |
| | Value accumulated by the += operator, converted to the requested type.
|
| |
| SampleType | getValue () const |
| |
template<typename SampleType>
class hart::AccurateSum< SampleType >
Implements Kahan algorithm for floating point accumulations.
- Template Parameters
-
| SampleType | Type of values to accumulate, typically float or double |
Definition at line 10 of file hart_accurate_sum.hpp.
◆ AccurateSum()
template<typename SampleType >
◆ operator=()
template<typename SampleType >
◆ operator+=()
template<typename SampleType >
Adds a value to a sum, tracking the potential floating point error.
- Parameters
-
| value | Value to add to the sum |
- Returns
- Reference to updated AccurateSum
Definition at line 33 of file hart_accurate_sum.hpp.
◆ operator SampleType()
template<typename SampleType >
| operator SampleType |
( |
| ) |
const |
|
inline |
◆ get()
template<typename SampleType >
template<typename RequestedType >
| RequestedType get |
( |
| ) |
const |
|
inline |
Value accumulated by the += operator, converted to the requested type.
Definition at line 50 of file hart_accurate_sum.hpp.
◆ getValue()
template<typename SampleType >
| SampleType getValue |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: