37 init(numValues, initValue);
41 void init(
int numValues, T initValue)
43 assert(numValues > 0 &&
"Num. of values must be greater than zero");
45 _values.resize(numValues, initValue);
47 _sum = initValue * numValues;
55 assert(
_values.size() > 0 &&
"_value vector not initialized");
Averaged template class provides an average value from a fixed size array.
void init(int numValues, T initValue)
Initializes the average value array to a given value.
vector< T > _values
value array
float _oneOverNumValues
multiplier instead of divider
void set(T value)
Sets the current value in the value array and builds the average.
int _currentValueIndex
current value index within _values
Averaged(int numValues, T initValue=0)
Utils provides utilities for string & file handling, logging and math functions.
Utils::Averaged< float > AvgFloat