Accumulate measurement values. More...
#include <senf/Utils/StatisticAccumulator.hh>
Public Member Functions | |
StatisticAccumulator () | |
StatisticAccumulator (T const &value) | |
StatisticAccumulator (T const &sum, T const &sumSquared, T const &min, T const &max, unsigned count) | |
StatisticAccumulator (senf::StatisticsData const &data) | |
void | clear () |
Reset accumulated values. More... | |
void | accumulate (T const &value) |
Gather value to be accumulated. More... | |
T | min () const |
Returns current minimal value. More... | |
T | max () const |
Returns current maximal value. More... | |
T | sum () const |
Returns current sum value. More... | |
T | sum2 () const |
Returns current squared sum value. More... | |
float | avg () const |
Returns arithmetic average value. More... | |
float | rms () const |
Returns root mean square value. More... | |
float | stddev () const |
Returns standard deviation value. More... | |
unsigned | count () const |
Returns count of accumulated values. More... | |
void | data (StatisticsData &data_) const |
Returns the accumulated data as a tuple. More... | |
StatisticsData | data () const |
Returns the accumulated data as a tuple. More... | |
operator bool () const | |
Returns true if valid data is present. More... | |
StatisticAccumulator< T > | operator+= (StatisticAccumulator< T > const &other) |
StatisticAccumulator< T > | operator*= (const float &scale) |
Accumulate measurement values.
The accumulator mainly do the preliminary work for the senf::Statistic class. It accumulates certain values within an interval to be used by senf::Statistics
This class provides the average, standard deviation, min, max values over one interval, means until clear() is called. It rather directly calculates the results then collection all single values provided by calling accumulate().
Definition at line 68 of file StatisticAccumulator.hh.
senf::StatisticAccumulator< T >::StatisticAccumulator | ( | ) |
senf::StatisticAccumulator< T >::StatisticAccumulator | ( | T const & | value | ) |
senf::StatisticAccumulator< T >::StatisticAccumulator | ( | T const & | sum, |
T const & | sumSquared, | ||
T const & | min, | ||
T const & | max, | ||
unsigned | count | ||
) |
senf::StatisticAccumulator< T >::StatisticAccumulator | ( | senf::StatisticsData const & | data | ) |
void senf::StatisticAccumulator< T >::accumulate | ( | T const & | value | ) |
Gather value to be accumulated.
This method accumulates a value.
[in] | value | to be accumulated value |
float senf::StatisticAccumulator< T >::avg | ( | ) | const |
Returns arithmetic average value.
This method returns the arithmetic average value of the current accumulation.
void senf::StatisticAccumulator< T >::clear | ( | ) |
Reset accumulated values.
This member reset all values.
unsigned senf::StatisticAccumulator< T >::count | ( | ) | const |
Returns count of accumulated values.
This method returns count of accumulated values of the current accumulation.
void senf::StatisticAccumulator< T >::data | ( | StatisticsData & | data_ | ) | const |
Returns the accumulated data as a tuple.
This method returns the accumulated information as a tuple.
StatisticsData senf::StatisticAccumulator< T >::data | ( | ) | const |
Returns the accumulated data as a tuple.
This method returns the accumulated information as a tuple.
T senf::StatisticAccumulator< T >::max | ( | ) | const |
Returns current maximal value.
This method returns the maximal value of the current accumulation.
T senf::StatisticAccumulator< T >::min | ( | ) | const |
Returns current minimal value.
This method returns the minimal value of the current accumulation.
|
explicit |
Returns true if valid data is present.
This method indicates if valid data is present
StatisticAccumulator<T> senf::StatisticAccumulator< T >::operator*= | ( | const float & | scale | ) |
StatisticAccumulator<T> senf::StatisticAccumulator< T >::operator+= | ( | StatisticAccumulator< T > const & | other | ) |
float senf::StatisticAccumulator< T >::rms | ( | ) | const |
Returns root mean square value.
This method returns the root mean square value of the current accumulation.
float senf::StatisticAccumulator< T >::stddev | ( | ) | const |
Returns standard deviation value.
This method returns the standard deviation value of the current accumulation.
T senf::StatisticAccumulator< T >::sum | ( | ) | const |
Returns current sum value.
This method returns the sum value of the current accumulation.
T senf::StatisticAccumulator< T >::sum2 | ( | ) | const |
Returns current squared sum value.
This method returns the squared sum value of the current accumulation.