npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0
npstat::StatAccumulatorArr Class Reference

#include <StatAccumulatorArr.hh>

Public Member Functions

 StatAccumulatorArr (const unsigned long dim)
 
unsigned long dim () const
 
unsigned long count () const
 
double min (unsigned long i) const
 
double max (unsigned long i) const
 
double mean (unsigned long i) const
 
double stdev (unsigned long i) const
 
double meanUncertainty (unsigned long i) const
 
template<typename T >
void accumulate (const T *data, const unsigned long len)
 
void accumulate (const StatAccumulatorArr &acc)
 
StatAccumulatorArroperator+= (const StatAccumulatorArr &r)
 
template<typename T >
StatAccumulatorArroperator+= (const std::vector< T > &r)
 
void reset ()
 
template<typename T >
void min (T *arr, const unsigned long len) const
 
template<typename T >
void max (T *arr, const unsigned long len) const
 
template<typename T >
void mean (T *arr, const unsigned long len) const
 
template<typename T >
void stdev (T *arr, const unsigned long len) const
 
template<typename T >
void meanUncertainty (T *arr, const unsigned long len) const
 
template<typename ConvertibleToLongDouble >
StatAccumulatorArroperator*= (const ConvertibleToLongDouble &r)
 
template<typename ConvertibleToLongDouble >
StatAccumulatorArroperator/= (const ConvertibleToLongDouble &r)
 
template<typename ConvertibleToLDouble >
StatAccumulatorArr operator* (const ConvertibleToLDouble &r) const
 
template<typename ConvertibleToLDouble >
StatAccumulatorArr operator/ (const ConvertibleToLDouble &r) const
 
StatAccumulatorArr operator+ (const StatAccumulatorArr &r) const
 
bool operator== (const StatAccumulatorArr &r) const
 
bool operator!= (const StatAccumulatorArr &r) const
 
gs::ClassId classId () const
 
bool write (std::ostream &of) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static void restore (const gs::ClassId &id, std::istream &in, StatAccumulatorArr *acc)
 

Detailed Description

Single-pass accumulator of statistical summaries for some set of arrays. Equivalent in functionality to a vector of "StatAccumulator" objects but has a more convenient interface.

Constructor & Destructor Documentation

◆ StatAccumulatorArr()

npstat::StatAccumulatorArr::StatAccumulatorArr ( const unsigned long  dim)
inlineexplicit

"dim" is the expected array length

Member Function Documentation

◆ accumulate() [1/2]

void npstat::StatAccumulatorArr::accumulate ( const StatAccumulatorArr acc)

Add the sample from another accumulator

◆ accumulate() [2/2]

template<typename T >
void npstat::StatAccumulatorArr::accumulate ( const T *  data,
const unsigned long  len 
)
inline

Process an array

◆ classId()

gs::ClassId npstat::StatAccumulatorArr::classId ( ) const
inline

Method related to "geners" I/O

◆ count()

unsigned long npstat::StatAccumulatorArr::count ( ) const
inline

Number of observations processed so far

◆ dim()

unsigned long npstat::StatAccumulatorArr::dim ( ) const
inline

Array length

◆ max() [1/2]

template<typename T >
void npstat::StatAccumulatorArr::max ( T *  arr,
const unsigned long  len 
) const
inline

Maximum values in the processed sample

◆ max() [2/2]

double npstat::StatAccumulatorArr::max ( unsigned long  i) const

Maximum value in the processed sample for the given dimension

◆ mean() [1/2]

template<typename T >
void npstat::StatAccumulatorArr::mean ( T *  arr,
const unsigned long  len 
) const
inline

Accumulated sample averages

◆ mean() [2/2]

double npstat::StatAccumulatorArr::mean ( unsigned long  i) const

Accumulated sample average for the given dimension

◆ meanUncertainty() [1/2]

template<typename T >
void npstat::StatAccumulatorArr::meanUncertainty ( T *  arr,
const unsigned long  len 
) const
inline

Uncertainties of the population means

◆ meanUncertainty() [2/2]

double npstat::StatAccumulatorArr::meanUncertainty ( unsigned long  i) const

Uncertainty of the population mean for the given dimension

◆ min() [1/2]

template<typename T >
void npstat::StatAccumulatorArr::min ( T *  arr,
const unsigned long  len 
) const
inline

Minimum values in the processed sample

◆ min() [2/2]

double npstat::StatAccumulatorArr::min ( unsigned long  i) const

Minimum value in the processed sample for the given dimension

◆ operator!=()

bool npstat::StatAccumulatorArr::operator!= ( const StatAccumulatorArr r) const
inline

Logical negation of operator==

◆ operator*()

template<typename ConvertibleToLDouble >
StatAccumulatorArr npstat::StatAccumulatorArr::operator* ( const ConvertibleToLDouble &  r) const
inline

Binary multiplication by a double

◆ operator*=()

template<typename ConvertibleToLongDouble >
StatAccumulatorArr& npstat::StatAccumulatorArr::operator*= ( const ConvertibleToLongDouble &  r)
inline

The effect of "operator*=" is the same as if all values were multiplied by "r" for each "accumulate" call

◆ operator+()

StatAccumulatorArr npstat::StatAccumulatorArr::operator+ ( const StatAccumulatorArr r) const
inline

Binary sum with another accumulator

◆ operator/()

template<typename ConvertibleToLDouble >
StatAccumulatorArr npstat::StatAccumulatorArr::operator/ ( const ConvertibleToLDouble &  r) const
inline

Binary division by a double

◆ operator/=()

template<typename ConvertibleToLongDouble >
StatAccumulatorArr& npstat::StatAccumulatorArr::operator/= ( const ConvertibleToLongDouble &  r)
inline

The effect of "operator/=" is the same as if all values were divided by "r" for each "accumulate" call

◆ operator==()

bool npstat::StatAccumulatorArr::operator== ( const StatAccumulatorArr r) const

Comparison for equality

◆ reset()

void npstat::StatAccumulatorArr::reset ( )
inline

Clear all accumulators

◆ stdev() [1/2]

template<typename T >
void npstat::StatAccumulatorArr::stdev ( T *  arr,
const unsigned long  len 
) const
inline

Estimates of the population standard deviation

◆ stdev() [2/2]

double npstat::StatAccumulatorArr::stdev ( unsigned long  i) const

Estimate of the population standard deviation for the given dimension


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