RAVENNAKIT
Loading...
Searching...
No Matches
rav::RunningAverage Class Reference

A running average. More...

#include <running_average.hpp>

Public Member Functions

void add (const double value)
 Adds a new value to the running average.
template<class U>
void add (U value)
 Adds a new value to the running average.
double average () const
size_t count () const
void reset ()
 Resets the running average.

Detailed Description

A running average.

Definition at line 34 of file running_average.hpp.

Member Function Documentation

◆ add() [1/2]

void rav::RunningAverage::add ( const double value)
inline

Adds a new value to the running average.

Parameters
valueThe value to add.

Definition at line 40 of file running_average.hpp.

◆ add() [2/2]

template<class U>
void rav::RunningAverage::add ( U value)
inline

Adds a new value to the running average.

Template Parameters
UThe type of the value to add.
Parameters
valueThe value to add.

Definition at line 51 of file running_average.hpp.

◆ average()

double rav::RunningAverage::average ( ) const
inlinenodiscard
Returns
The current average.

Definition at line 58 of file running_average.hpp.

◆ count()

size_t rav::RunningAverage::count ( ) const
inlinenodiscard
Returns
The number of values added to the running average.

Definition at line 65 of file running_average.hpp.

◆ reset()

void rav::RunningAverage::reset ( )
inline

Resets the running average.

Definition at line 72 of file running_average.hpp.


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