Public Member Functions | Protected Member Functions | Protected Attributes

Stats::WindowedCalc< T > Class Template Reference

RunCalc manager which buffers a part of the data. More...

List of all members.

Public Member Functions

 WindowedCalc (const RunCalcSetup &rcs, int sz)
 ~WindowedCalc ()
void clear ()
WindowedCalcaddValue (T data, T weight=1)
WindowedCalcoperator+= (T t)
int getIndex (Type) const
 Only use for Min, Max or Median.
double getValue (Type) const
count () const
double average () const
double variance () const
double normvariance () const
sum () const
sqSum () const
double rms () const
double stdDev () const
mostFreq () const
min (int *i=0) const
max (int *i=0) const
extreme (int *i=0) const
median (int *i=0) const

Protected Member Functions

void fillCalc (RunCalc< T > &) const

Protected Attributes

RunCalc< T > calc_
const int sz_
T * wts_
T * vals_
int posidx_
bool empty_
bool full_
bool needcalc_

Detailed Description

template<class T>
class Stats::WindowedCalc< T >

RunCalc manager which buffers a part of the data.

Allows calculating running stats on a window only. Once the window is full, WindowedCalc will replace the first value added (fifo).


Constructor & Destructor Documentation

template<class T >
Stats::WindowedCalc< T >::WindowedCalc ( const RunCalcSetup rcs,
int  sz 
) [inline]
template<class T >
Stats::WindowedCalc< T >::~WindowedCalc (  )  [inline]

Member Function Documentation

template<class T >
WindowedCalc< T > & Stats::WindowedCalc< T >::addValue ( data,
weight = 1 
) [inline]
template<class T >
double Stats::WindowedCalc< T >::average (  )  const [inline]
template<class T >
void Stats::WindowedCalc< T >::clear (  )  [inline]
template<class T >
T Stats::WindowedCalc< T >::count (  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::extreme ( int *  i = 0  )  const [inline]
template<class T >
void Stats::WindowedCalc< T >::fillCalc ( RunCalc< T > &  calc  )  const [inline, protected]
template<class T >
int Stats::WindowedCalc< T >::getIndex ( Type  t  )  const [inline]

Only use for Min, Max or Median.

template<class T >
double Stats::WindowedCalc< T >::getValue ( Type  t  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::max ( int *  i = 0  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::median ( int *  i = 0  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::min ( int *  i = 0  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::mostFreq (  )  const [inline]
template<class T >
double Stats::WindowedCalc< T >::normvariance (  )  const [inline]
template<class T >
WindowedCalc& Stats::WindowedCalc< T >::operator+= ( t  )  [inline]
template<class T >
double Stats::WindowedCalc< T >::rms (  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::sqSum (  )  const [inline]
template<class T >
double Stats::WindowedCalc< T >::stdDev (  )  const [inline]
template<class T >
T Stats::WindowedCalc< T >::sum (  )  const [inline]
template<class T >
double Stats::WindowedCalc< T >::variance (  )  const [inline]

Member Data Documentation

template<class T >
RunCalc<T> Stats::WindowedCalc< T >::calc_ [protected]
template<class T >
bool Stats::WindowedCalc< T >::empty_ [protected]
template<class T >
bool Stats::WindowedCalc< T >::full_ [protected]
template<class T >
bool Stats::WindowedCalc< T >::needcalc_ [protected]
template<class T >
int Stats::WindowedCalc< T >::posidx_ [protected]
template<class T >
const int Stats::WindowedCalc< T >::sz_ [protected]
template<class T >
T* Stats::WindowedCalc< T >::vals_ [protected]
template<class T >
T* Stats::WindowedCalc< T >::wts_ [protected]