Embedded Template Library 1.0
etl::pseudo_moving_average< T, SAMPLE_SIZE_, 1U, false, true > 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 (const T new_value)
 
value () const
 
add_insert_iterator input ()
 

Static Public Attributes

static ETL_CONSTANT size_t SAMPLE_SIZE = SAMPLE_SIZE_
 

Detailed Description

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

Pseudo Moving Average For floating point types.

Template Parameters
TThe sample value type.
SAMPLE_SIZEThe number of samples to average over.

Constructor & Destructor Documentation

◆ pseudo_moving_average()

template<typename T , const size_t SAMPLE_SIZE_>
etl::pseudo_moving_average< T, SAMPLE_SIZE_, 1U, false, true >::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_>
void etl::pseudo_moving_average< T, SAMPLE_SIZE_, 1U, false, true >::add ( const T  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_>
void etl::pseudo_moving_average< T, SAMPLE_SIZE_, 1U, false, true >::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_>
add_insert_iterator etl::pseudo_moving_average< T, SAMPLE_SIZE_, 1U, false, true >::input ( )
inline

Gets an iterator for input.

Returns
An iterator.

◆ value()

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

Gets the current pseudo moving average.

Returns
The current average.

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