solver
1.0
|
The class encapsulating the calculation of the moving average. More...
#include <DataStructures.h>
Public Member Functions | |
MovingAverage (uint32_t length) | |
It constructs an instance of the moving average. More... | |
double | average () const |
Current value of the running average. | |
void | addValue (const T &val) |
Add a new value to the moving average. | |
bool | filled () const |
Returns whether the average is calculated from the full length. | |
void | clear () |
Remove all the values from which the running average is calculated. | |
Private Attributes | |
uint32_t | mLength |
The maximal number of values used for the calculation of the moving average. | |
std::vector< T > | mData |
The vector of values from which the running average is calculated. | |
The class encapsulating the calculation of the moving average.
T | Numerical type. |
Definition at line 340 of file DataStructures.h.
|
inline |
It constructs an instance of the moving average.
length | The number of values considered in the running average. |
Definition at line 346 of file DataStructures.h.