|
Click
|
Parameters for a EWMA with constant scaling factor and user-settable alpha. More...
#include <click/ewma.hh>
Public Types | |
| typedef T | value_type |
| typedef U | signed_value_type |
Public Member Functions | |
| StabilityEWMAXParameters () | |
| Construct a StabilityEWMAXParameters with initial alpha 1/16. | |
| unsigned | stability_shift () const |
| Return the current stability shift. | |
| void | set_stability_shift (unsigned stability_shift) |
| Set the current stability shift. | |
| unsigned | compensation () const |
| Return this EWMA's compensation. | |
Static Public Member Functions | |
| static unsigned | scale () |
| Return this EWMA's scaling factor (bits of fraction). | |
| static value_type | scaled_one () |
| Return this EWMA's scaled value for one. | |
Parameters for a EWMA with constant scaling factor and user-settable alpha.
The StabilityEWMAXParameters template class is used as a template argument to DirectEWMAX. It defines a EWMA with fixed constant scaling factor. StabilityEWMAXParameters's first template argument is the EWMA's scaling factor, its second template argument is the EWMA's value type, and the third template argument is the EWMA's signed value type.
Example: DirectEWMAX<StabilityEWMAXParameters<10, unsigned, int> > defines a EWMA with user-settable alpha (stability shift) initially equal to 1/16, scaling factor 10, and value type unsigned.
A DirectEWMAX<StabilityEWMAXParameters<...> > object has stability_shift() and set_stability_shift() methods.
|
inline |
Construct a StabilityEWMAXParameters with initial alpha 1/16.
|
inline |
Return the current stability shift.
The current alpha equals 1. / (2 ** stability_shift()).
|
inline |
Set the current stability shift.
| stability_shift | new value |
|
inlinestatic |
Return this EWMA's scaling factor (bits of fraction).
|
inlinestatic |
Return this EWMA's scaled value for one.
|
inline |
Return this EWMA's compensation.