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

## 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.

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

- juce_core/maths/juce_StatisticsAccumulator.h

## Public Member Functions

| StatisticsAccumulator ()=default
| Constructs a new StatisticsAccumulator.
void | addValue (FloatType v) noexcept
| Add a new value to the accumulator.
void | reset () noexcept
| Reset the accumulator.
FloatType | getAverage () const noexcept
| Returns the average (arithmetic mean) of all previously added values.
FloatType | getVariance () const noexcept
| Returns the variance of all previously added values.
FloatType | getStandardDeviation () const noexcept
| Returns the standard deviation of all previously added values.
FloatType | getMinValue () const noexcept
| Returns the smallest of all previously added values.
FloatType | getMaxValue () const noexcept
| Returns the largest of all previously added values.
size_t | getCount () const noexcept
| Returns how many values have been added to this accumulator.

## Constructors and Destructors

## StatisticsAccumulator()

template<typename FloatType>

juce::StatisticsAccumulator< FloatType >::StatisticsAccumulator | ( |  | ) |

default

Constructs a new StatisticsAccumulator.

Referenced by reset().

## Member Functions

## addValue()

template<typename FloatType>

void juce::StatisticsAccumulator< FloatType >::addValue | ( | FloatType | v | ) |

inline noexcept

Add a new value to the accumulator.

This will update all running statistics accordingly.

References jassert, and juce::juce_isfinite().

## reset()

template<typename FloatType>

void juce::StatisticsAccumulator< FloatType >::reset | ( |  | ) |

inline noexcept

Reset the accumulator.

This will reset all currently saved statistcs.

References StatisticsAccumulator().

## getAverage()

template<typename FloatType>

FloatType juce::StatisticsAccumulator< FloatType >::getAverage | ( |  | ) | const

inline noexcept

Returns the average (arithmetic mean) 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

inline noexcept

Returns the variance of all previously added values.

If no values have been added yet, this will return zero.

Referenced by getStandardDeviation().

## getStandardDeviation()

template<typename FloatType>

FloatType juce::StatisticsAccumulator< FloatType >::getStandardDeviation | ( |  | ) | const

inline noexcept

Returns the standard deviation of all previously added values.

If no values have been added yet, this will return zero.

References getVariance().

## getMinValue()

template<typename FloatType>

FloatType juce::StatisticsAccumulator< FloatType >::getMinValue | ( |  | ) | const

inline noexcept

Returns the smallest of all previously added values.

If no values have been added yet, this will return positive infinity.

## getMaxValue()

template<typename FloatType>

FloatType juce::StatisticsAccumulator< FloatType >::getMaxValue | ( |  | ) | const

inline noexcept

Returns the largest of all previously added values.

If no values have been added yet, this will return negative infinity.

## getCount()

template<typename FloatType>

size_t juce::StatisticsAccumulator< FloatType >::getCount | ( |  | ) | const

inline noexcept

Returns how many values have been added to this accumulator.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited