Template Class ema

Inheritance Relationships

Base Type

Class Documentation

template<class T>
class ema : public rcppsw::math::expression<T>

Calculates an Exponential Moving Average of SOMETHING.

Depends on:

  • Alpha: How much weight to give the past estimate, and how much to give the new measurement?

Public Functions

inline explicit ema(double alpha)
inline ema(double alpha, const T &result)
inline double alpha(void) const
inline ema &calc(const ema &other)
inline T calc(const T &measure)
inline ema &operator()(const ema &other)
inline T operator()(const T &measure)
inline ema operator+(const ema &other) const
inline ema &operator+=(const ema &other)
inline ema operator-(const ema &other) const
inline ema operator/(const ema &other) const
template<typename U = T, typename std::enable_if<!(std::is_floating_point<T>::value), int>::type = 0>
inline bool operator==(const ema &other) const