Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
Public Member Functions | Private Attributes | List of all members
CMedianFilter< T > Class Template Reference

Median filter over a stream of values. More...

#include <util.h>

Public Member Functions

 CMedianFilter (unsigned int size, T initial_value)
 
void input (T value)
 
median () const
 
int size () const
 
std::vector< T > sorted () const
 

Private Attributes

std::vector< T > vValues
 
std::vector< T > vSorted
 
unsigned int nSize
 

Detailed Description

template<typename T>
class CMedianFilter< T >

Median filter over a stream of values.

Returns the median of the last N numbers

Definition at line 462 of file util.h.

Constructor & Destructor Documentation

template<typename T>
CMedianFilter< T >::CMedianFilter ( unsigned int  size,
initial_value 
)
inline

Definition at line 469 of file util.h.

Member Function Documentation

template<typename T>
void CMedianFilter< T >::input ( value)
inline

Definition at line 477 of file util.h.

template<typename T>
T CMedianFilter< T >::median ( ) const
inline

Definition at line 490 of file util.h.

template<typename T>
int CMedianFilter< T >::size ( ) const
inline

Definition at line 504 of file util.h.

template<typename T>
std::vector<T> CMedianFilter< T >::sorted ( ) const
inline

Definition at line 509 of file util.h.

Member Data Documentation

template<typename T>
unsigned int CMedianFilter< T >::nSize
private

Definition at line 467 of file util.h.

template<typename T>
std::vector<T> CMedianFilter< T >::vSorted
private

Definition at line 466 of file util.h.

template<typename T>
std::vector<T> CMedianFilter< T >::vValues
private

Definition at line 465 of file util.h.


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