๐ Constructor
๐ Syntaxโ
// Passing only size as an argument
DataTomeAnalysis<class TypeOfArray, class TypeOfSum> yourTimeseriesName(size_t size);
- Template parameter. TypeOfArray is the type of the array elements. TypeOfSum is the type of the sum of the array elements, it is equal to TypeOfArray by default.
- Passing only size as an argument.
The class will create an array with the size passed as an argument and, by default, all positions will initialize with 0.
๐ฎ Exampleโ
// This will create an MovingAverage of size 10, int type, and acumulator type as int
DataTomeAnalysis<int> intAverage(10);
// This will create an MovingAverage of size 10, int type, and acumulator type as long int
DataTomeAnalysis<int, long int> intAverage(10);
โฑ Complexityโ
Constant (O(1)).