Embedded Template Library 1.0
etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false > Class Template Reference

#include <pseudo_moving_average.h>

Public Types

typedef T value_type
 
typedef private_pseudo_moving_average::add_insert_iterator< this_tadd_insert_iterator
 

Public Member Functions

 pseudo_moving_average (const T initial_value)
 
void clear (const T initial_value)
 
void add (T new_value)
 
value () const
 
add_insert_iterator input ()
 

Static Public Attributes

static ETL_CONSTANT size_t SAMPLE_SIZE = SAMPLE_SIZE_
 The number of samples averaged over.
 
static ETL_CONSTANT size_t SCALING = SCALING_
 The sample scaling factor.
 

Detailed Description

template<typename T, const size_t SAMPLE_SIZE_, const size_t SCALING_>
class etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false >

Pseudo Moving Average For integral types.

Template Parameters
TThe sample value type.
SAMPLE_SIZEThe number of samples to average over.
SCALINGThe scaling factor applied to samples. Default = 1.

Constructor & Destructor Documentation

◆ pseudo_moving_average()

template<typename T , const size_t SAMPLE_SIZE_, const size_t SCALING_>
etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false >::pseudo_moving_average ( const T  initial_value)
inline

Constructor

Parameters
initial_valueThe initial value for the average.

Member Function Documentation

◆ add()

template<typename T , const size_t SAMPLE_SIZE_, const size_t SCALING_>
void etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false >::add ( new_value)
inline

Adds a new sample to the average.

Parameters
new_valueThe value to add.

◆ clear()

template<typename T , const size_t SAMPLE_SIZE_, const size_t SCALING_>
void etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false >::clear ( const T  initial_value)
inline

Clears the average.

Parameters
initial_valueThe initial value for the average.

◆ input()

template<typename T , const size_t SAMPLE_SIZE_, const size_t SCALING_>
add_insert_iterator etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false >::input ( )
inline

Gets an iterator for input.

Returns
An iterator.

◆ value()

template<typename T , const size_t SAMPLE_SIZE_, const size_t SCALING_>
T etl::pseudo_moving_average< T, SAMPLE_SIZE_, SCALING_, true, false >::value ( ) const
inline

Gets the current pseudo moving average.

Returns
The current average.

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