33template <
typename FloatType>
53 if (v > maximum) maximum = v;
54 if (v < minimum) minimum = v;
68 return count > 0 ? sum / (FloatType) count
77 return count > 0 ? (sumSquares - sum * sum / (FloatType) count) / (FloatType) count
115 KahanSum() =
default;
116 operator FloatType()
const noexcept {
return sum; }
126 FloatType sum{}, error{};
131 KahanSum sum, sumSquares;
A class that measures various statistics about a series of floating point values that it is given.
StatisticsAccumulator()=default
Constructs a new StatisticsAccumulator.
FloatType getMinValue() const noexcept
Returns the smallest of all previously added values.
FloatType getAverage() const noexcept
Returns the average (arithmetic mean) of all previously added values.
void reset() noexcept
Reset the accumulator.
FloatType getVariance() const noexcept
Returns the variance of all previously added values.
size_t getCount() const noexcept
Returns how many values have been added to this accumulator.
void addValue(FloatType v) noexcept
Add a new value to the accumulator.
FloatType getStandardDeviation() const noexcept
Returns the standard deviation of all previously added values.
FloatType getMaxValue() const noexcept
Returns the largest of all previously added values.
bool juce_isfinite(NumericType value) noexcept
The isfinite() method seems to vary between platforms, so this is a platform-independent function for...
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...