Aria
2.8.0
|
Use for computing a running average of a number of elements. More...
#include <ariaUtil.h>
Public Member Functions | |
void | add (double val) |
Adds a value to the average. An old value is discarded if the number of elements to average has been reached. | |
ArRunningAverage (size_t numToAverage) | |
Constructor, give it the number of elements to store to compute the average. | |
void | clear (void) |
Clears the average. | |
double | getAverage (void) const |
Gets the average. | |
size_t | getCurrentNumAveraged (void) |
Gets the number of values currently averaged so far. | |
size_t | getNumToAverage (void) const |
Gets the number of elements. | |
bool | getUseRootMeanSquare (void) |
Gets if this is using a the root mean square average or just the normal average. | |
void | setNumToAverage (size_t numToAverage) |
Sets the number of elements. | |
void | setUseRootMeanSquare (bool useRootMeanSquare) |
Sets if this is using a the root mean square average or just the normal average. | |
~ArRunningAverage () | |
Destructor. | |
Protected Attributes | |
size_t | myNum |
size_t | myNumToAverage |
double | myTotal |
bool | myUseRootMeanSquare |
std::list< double > | myVals |
Use for computing a running average of a number of elements.