Class SlidingWindow

template<typename NT>
class SlidingWindow

A sliding window, which allows to get the relative error of approximations

Template Parameters:

NT – Numeric type

Public Functions

inline SlidingWindow(int windowSize)

Constructor

Parameters:

windowSize[in] The size of the window

inline void push(NT approximation)

Adds an approximation in the window

Parameters:

approximation[in] The new approximation

inline double getRelativeError()
Returns:

The relative error between the youngest and oldest approximations

Public Members

std::list<NT> approximations

The stored approximations.

int windowSize

The size of the window.

int numEntries

The number of entries in list approximations.