npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::CircularBuffer< Numeric, Precise > Class Template Reference

Public Member Functions

 CircularBuffer (unsigned long sz)
 
unsigned long size () const
 
unsigned long nFills () const
 
const Numeric & at (const unsigned long i) const
 
Numeric & at (const unsigned long i)
 
const Numeric & operator[] (const unsigned long i) const
 
Numeric & operator[] (const unsigned long i)
 
bool empty () const
 
bool filled () const
 
bool operator== (const CircularBuffer &r) const
 
bool operator!= (const CircularBuffer &r) const
 
void accumulate (const Numeric &value)
 
CircularBufferoperator+= (const Numeric &r)
 
void reset ()
 
Numeric min () const
 
Numeric max () const
 
Precise sum () const
 
Precise mean () const
 
Precise stdev () const
 
Precise meanUncertainty () const
 

Constructor & Destructor Documentation

◆ CircularBuffer()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
npstat::CircularBuffer< Numeric, Precise >::CircularBuffer ( unsigned long  sz)
explicit

The constructor argument is the size of the buffer

Member Function Documentation

◆ accumulate()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
void npstat::CircularBuffer< Numeric, Precise >::accumulate ( const Numeric &  value)

Accumulate the sample

◆ at()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
const Numeric& npstat::CircularBuffer< Numeric, Precise >::at ( const unsigned long  i) const
inline

Element access which will fail if the buffer is not filled. The element with index 0 is the oldest one in the buffer.

◆ empty()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
bool npstat::CircularBuffer< Numeric, Precise >::empty ( ) const
inline

Check if the buffer is empty

◆ filled()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
bool npstat::CircularBuffer< Numeric, Precise >::filled ( ) const
inline

Check if the buffer has been completely filled

◆ max()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
Numeric npstat::CircularBuffer< Numeric, Precise >::max ( ) const

Maximum value in the accumulated sample

◆ mean()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
Precise npstat::CircularBuffer< Numeric, Precise >::mean ( ) const

Accumulated sample average

◆ meanUncertainty()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
Precise npstat::CircularBuffer< Numeric, Precise >::meanUncertainty ( ) const

Uncertainty of the population mean

◆ min()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
Numeric npstat::CircularBuffer< Numeric, Precise >::min ( ) const

Minimum value in the accumulated sample

◆ nFills()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
unsigned long npstat::CircularBuffer< Numeric, Precise >::nFills ( ) const
inline

The total number of times the buffer was filled

◆ operator!=()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
bool npstat::CircularBuffer< Numeric, Precise >::operator!= ( const CircularBuffer< Numeric, Precise > &  r) const

Logical negation of operator==

◆ operator==()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
bool npstat::CircularBuffer< Numeric, Precise >::operator== ( const CircularBuffer< Numeric, Precise > &  r) const

Comparison for equality

◆ operator[]()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
const Numeric& npstat::CircularBuffer< Numeric, Precise >::operator[] ( const unsigned long  i) const
inline

Element access without checking that the buffer is filled. The element with index 0 is the oldest one in the buffer.

◆ reset()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
void npstat::CircularBuffer< Numeric, Precise >::reset ( )
inline

Clear all accumulated data

◆ size()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
unsigned long npstat::CircularBuffer< Numeric, Precise >::size ( ) const
inline

The size of the buffer

◆ stdev()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
Precise npstat::CircularBuffer< Numeric, Precise >::stdev ( ) const

Estimate of the population standard deviation

◆ sum()

template<typename Numeric , typename Precise = typename PreciseType<Numeric>::type>
Precise npstat::CircularBuffer< Numeric, Precise >::sum ( ) const

Sum of the accumulated values


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