LMMS
Loading...
Searching...
No Matches
juce::StatisticsAccumulator< FloatType > Class Template Reference

#include <juce_StatisticsAccumulator.h>

Classes

struct  KahanSum

Public Member Functions

 StatisticsAccumulator ()=default
void addValue (FloatType v) noexcept
void reset () noexcept
FloatType getAverage () const noexcept
FloatType getVariance () const noexcept
FloatType getStandardDeviation () const noexcept
FloatType getMinValue () const noexcept
FloatType getMaxValue () const noexcept
size_t getCount () const noexcept

Private Attributes

size_t count { 0 }
KahanSum sum
KahanSum sumSquares
FloatType minimum { std::numeric_limits<FloatType>::infinity() }
FloatType maximum { -std::numeric_limits<FloatType>::infinity() }

Detailed Description

template<typename FloatType>
class juce::StatisticsAccumulator< FloatType >

A class that measures various statistics about a series of floating point values that it is given.

@tags{Core}

Constructor & Destructor Documentation

◆ StatisticsAccumulator()

template<typename FloatType>
juce::StatisticsAccumulator< FloatType >::StatisticsAccumulator ( )
default

Constructs a new StatisticsAccumulator.

Member Function Documentation

◆ addValue()

template<typename FloatType>
void juce::StatisticsAccumulator< FloatType >::addValue ( FloatType v)
inlinenoexcept

Add a new value to the accumulator. This will update all running statistics accordingly.

◆ getAverage()

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::getAverage ( ) const
inlinenoexcept

Returns the average (arithmetic mean) of all previously added values. If no values have been added yet, this will return zero.

◆ getCount()

template<typename FloatType>
size_t juce::StatisticsAccumulator< FloatType >::getCount ( ) const
inlinenoexcept

Returns how many values have been added to this accumulator.

◆ getMaxValue()

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::getMaxValue ( ) const
inlinenoexcept

Returns the largest of all previously added values. If no values have been added yet, this will return negative infinity.

◆ getMinValue()

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::getMinValue ( ) const
inlinenoexcept

Returns the smallest of all previously added values. If no values have been added yet, this will return positive infinity.

◆ getStandardDeviation()

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::getStandardDeviation ( ) const
inlinenoexcept

Returns the standard deviation of all previously added values. If no values have been added yet, this will return zero.

◆ getVariance()

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::getVariance ( ) const
inlinenoexcept

Returns the variance of all previously added values. If no values have been added yet, this will return zero.

◆ reset()

template<typename FloatType>
void juce::StatisticsAccumulator< FloatType >::reset ( )
inlinenoexcept

Reset the accumulator. This will reset all currently saved statistcs.

Member Data Documentation

◆ count

template<typename FloatType>
size_t juce::StatisticsAccumulator< FloatType >::count { 0 }
private

◆ maximum

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::maximum { -std::numeric_limits<FloatType>::infinity() }
private

◆ minimum

template<typename FloatType>
FloatType juce::StatisticsAccumulator< FloatType >::minimum { std::numeric_limits<FloatType>::infinity() }
private

◆ sum

template<typename FloatType>
KahanSum juce::StatisticsAccumulator< FloatType >::sum
private

◆ sumSquares

template<typename FloatType>
KahanSum juce::StatisticsAccumulator< FloatType >::sumSquares
private

The documentation for this class was generated from the following file: