Multi Resolution Molecular Dynamics 0.4.0
Multi Resolution Molecular Dynamics
Loading...
Searching...
No Matches
mrmd::util::ExponentialMovingAverage Class Reference

Calculates the exponential moving average (EMA) for values added with append. More...

#include <util/ExponentialMovingAverage.hpp>

Public Member Functions

 ExponentialMovingAverage (const real_t &weightingFactor)
 operator real_t () const
real_t toReal () const
void append (const real_t &val)

Detailed Description

Calculates the exponential moving average (EMA) for values added with append.

Reference: https://en.wikipedia.org/wiki/Exponential_smoothing

Example:

exp.append(2_r);
EXPECT_FLOAT_EQ(exp, 2_r);
exp.append(3_r);
EXPECT_FLOAT_EQ(exp, 2.1_r);

Constructor & Destructor Documentation

◆ ExponentialMovingAverage()

mrmd::util::ExponentialMovingAverage::ExponentialMovingAverage ( const real_t & weightingFactor)
inlineexplicit

Member Function Documentation

◆ append()

void mrmd::util::ExponentialMovingAverage::append ( const real_t & val)
inline

◆ operator real_t()

mrmd::util::ExponentialMovingAverage::operator real_t ( ) const
inline

◆ toReal()

real_t mrmd::util::ExponentialMovingAverage::toReal ( ) const
inline

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