DayZ 1.24
Loading...
Searching...
No Matches
SimpleMovingAverage< Class T > Class Reference
Collaboration diagram for SimpleMovingAverage< Class T >:
[legend]

Private Member Functions

void SimpleMovingAverage (int pSize, T pDefaultValue=0)
 Initialize Simple Moving Average Cyclic Buffer.
 
T Add (T newSample)
 Add new value and return average value from buffer.
 

Private Attributes

T m_Sum = 0
 
int m_Pointer = 0
 
int m_Size = 0
 
ref array< Tm_Samples = new array<T>()
 

Detailed Description

Definition at line 1 of file SimpleMovingAverage.c.

Constructor & Destructor Documentation

◆ SimpleMovingAverage()

void SimpleMovingAverage< Class T >::SimpleMovingAverage ( int pSize,
T pDefaultValue = 0 )
inlineprivate

Initialize Simple Moving Average Cyclic Buffer.

Parameters
pSizesize of the buffer
pDefaultValueinitial value stored in buffer

Definition at line 13 of file SimpleMovingAverage.c.

Member Function Documentation

◆ Add()

T SimpleMovingAverage< Class T >::Add ( T newSample)
inlineprivate

Add new value and return average value from buffer.

Parameters
newSamplevalue that will be added to buffer
Returns
average value from the buffer

Definition at line 33 of file SimpleMovingAverage.c.

Member Data Documentation

◆ m_Pointer

int SimpleMovingAverage< Class T >::m_Pointer = 0
private

Definition at line 4 of file SimpleMovingAverage.c.

◆ m_Samples

ref array<T> SimpleMovingAverage< Class T >::m_Samples = new array<T>()
private

Definition at line 6 of file SimpleMovingAverage.c.

◆ m_Size

int SimpleMovingAverage< Class T >::m_Size = 0
private

Definition at line 5 of file SimpleMovingAverage.c.

◆ m_Sum

T SimpleMovingAverage< Class T >::m_Sum = 0
private

Definition at line 3 of file SimpleMovingAverage.c.


The documentation for this class was generated from the following file: