A class that measures various statistics about a series of floating point values that it is given. More...
#include <juce_StatisticsAccumulator.h>
Classes | |
struct | KahanSum |
Public Member Functions | |
StatisticsAccumulator ()=default | |
Constructs a new StatisticsAccumulator. More... | |
void | addValue (FloatType v) noexcept |
Add a new value to the accumulator. More... | |
FloatType | getAverage () const noexcept |
Returns the average (arithmetic mean) of all previously added values. More... | |
size_t | getCount () const noexcept |
Returns how many values have been added to this accumulator. More... | |
FloatType | getMaxValue () const noexcept |
Returns the largest of all previously added values. More... | |
FloatType | getMinValue () const noexcept |
Returns the smallest of all previously added values. More... | |
FloatType | getStandardDeviation () const noexcept |
Returns the standard deviation of all previously added values. More... | |
FloatType | getVariance () const noexcept |
Returns the variance of all previously added values. More... | |
void | reset () noexcept |
Reset the accumulator. More... | |
Private Attributes | |
size_t | count { 0 } |
FloatType | maximum { -std::numeric_limits<FloatType>::infinity() } |
FloatType | minimum { std::numeric_limits<FloatType>::infinity() } |
KahanSum | sum |
KahanSum | sumSquares |
A class that measures various statistics about a series of floating point values that it is given.
@tags{Core}
|
default |
Constructs a new StatisticsAccumulator.
|
inlinenoexcept |
Add a new value to the accumulator.
This will update all running statistics accordingly.
References juce::StatisticsAccumulator< FloatType >::count, jassert, juce::juce_isfinite(), juce::StatisticsAccumulator< FloatType >::maximum, juce::StatisticsAccumulator< FloatType >::minimum, juce::StatisticsAccumulator< FloatType >::sum, juce::StatisticsAccumulator< FloatType >::sumSquares, and juce::gl::v.
|
inlinenoexcept |
Returns the average (arithmetic mean) of all previously added values.
If no values have been added yet, this will return zero.
References juce::StatisticsAccumulator< FloatType >::count, and juce::StatisticsAccumulator< FloatType >::sum.
|
inlinenoexcept |
Returns how many values have been added to this accumulator.
References juce::StatisticsAccumulator< FloatType >::count.
|
inlinenoexcept |
Returns the largest of all previously added values.
If no values have been added yet, this will return negative infinity.
References juce::StatisticsAccumulator< FloatType >::maximum.
|
inlinenoexcept |
Returns the smallest of all previously added values.
If no values have been added yet, this will return positive infinity.
References juce::StatisticsAccumulator< FloatType >::minimum.
|
inlinenoexcept |
Returns the standard deviation of all previously added values.
If no values have been added yet, this will return zero.
References juce::StatisticsAccumulator< FloatType >::getVariance().
|
inlinenoexcept |
Returns the variance of all previously added values.
If no values have been added yet, this will return zero.
References juce::StatisticsAccumulator< FloatType >::count, juce::StatisticsAccumulator< FloatType >::sum, and juce::StatisticsAccumulator< FloatType >::sumSquares.
Referenced by juce::StatisticsAccumulator< FloatType >::getStandardDeviation().
|
inlinenoexcept |
Reset the accumulator.
This will reset all currently saved statistcs.
|
private |
|
private |
|
private |
|
private |
|
private |