Sliding average class.
Macros:
Enumerations:
None.
Typedefs:
None.
Struct CapySlidingAverage :
Struct CapySlidingAverage's properties:
Size of the sliding window
Counter to memorise when the window is filled
Current average value
Struct CapySlidingAverage's methods:
Destructor
Update the average with a new value
Input argument(s):
val: the new value
Output and side effect(s):
Update the current average and counter
Functions:
Create a CapySlidingAverage
Input argument(s):
size: the size of the sliding window
Output and side effect(s):
Return a CapySlidingAverage
Allocate memory for a new CapySlidingAverage and create it
Input argument(s):
size: the size of the sliding window
Output and side effect(s):
Return a CapySlidingAverage
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapySlidingAverage* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapySlidingAverage to free