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

#include <MultivariateSumAccumulator.hh>

Public Types

typedef Precise precise_type
 

Public Member Functions

 MultivariateSumAccumulator ()
 
unsigned long dim () const
 
unsigned long count () const
 
const Precise * data () const
 
template<typename T >
void accumulate (const T *data, const unsigned long len)
 
template<typename T >
void accumulateSample (const T *data, const unsigned long len, const unsigned long chunkSize)
 
void accumulate (const MultivariateSumAccumulator &r)
 
MultivariateSumAccumulatoroperator+= (const MultivariateSumAccumulator &r)
 
void reset ()
 
const Precise & sum (const unsigned long i) const
 
Precise mean (const unsigned long i) const
 
std::vector< Precise > meanVector () const
 
bool operator== (const MultivariateSumAccumulator &r) const
 
bool operator!= (const MultivariateSumAccumulator &r) const
 

Detailed Description

template<typename Precise = long double>
class npstat::MultivariateSumAccumulator< Precise >

Class for accumulating multivariate sums and calculating corresponding averages. The first call to the "accumulate" method after construction (or upon reset) will be used to determine the input array length. All subsequent "accumulate" calls until the next "reset" must use the same array length.

Constructor & Destructor Documentation

◆ MultivariateSumAccumulator()

template<typename Precise = long double>
npstat::MultivariateSumAccumulator< Precise >::MultivariateSumAccumulator ( )
inline

Only default constructor is necessary

Member Function Documentation

◆ accumulate() [1/2]

template<typename Precise = long double>
void npstat::MultivariateSumAccumulator< Precise >::accumulate ( const MultivariateSumAccumulator< Precise > &  r)
inline

Add the sample from another accumulator

◆ accumulate() [2/2]

template<typename Precise = long double>
template<typename T >
void npstat::MultivariateSumAccumulator< Precise >::accumulate ( const T *  data,
const unsigned long  len 
)
inline

Accumulate sums for an array of numbers

◆ accumulateSample()

template<typename Precise = long double>
template<typename T >
void npstat::MultivariateSumAccumulator< Precise >::accumulateSample ( const T *  data,
const unsigned long  len,
const unsigned long  chunkSize 
)
inline

Accumulate sums for a sample

◆ count()

template<typename Precise = long double>
unsigned long npstat::MultivariateSumAccumulator< Precise >::count ( ) const
inline

Number of times "accumulate" was called since last reset

◆ data()

template<typename Precise = long double>
const Precise* npstat::MultivariateSumAccumulator< Precise >::data ( ) const
inline

Get the sums accumulated so far

◆ dim()

template<typename Precise = long double>
unsigned long npstat::MultivariateSumAccumulator< Precise >::dim ( ) const
inline

Dimensionality of the data

◆ mean()

template<typename Precise = long double>
Precise npstat::MultivariateSumAccumulator< Precise >::mean ( const unsigned long  i) const
inline

Retrieve the mean for a particular index

◆ meanVector()

template<typename Precise = long double>
std::vector<Precise> npstat::MultivariateSumAccumulator< Precise >::meanVector ( ) const
inline

Retrieve the vector of means

◆ operator!=()

template<typename Precise = long double>
bool npstat::MultivariateSumAccumulator< Precise >::operator!= ( const MultivariateSumAccumulator< Precise > &  r) const
inline

Logical negation of operator==

◆ operator==()

template<typename Precise = long double>
bool npstat::MultivariateSumAccumulator< Precise >::operator== ( const MultivariateSumAccumulator< Precise > &  r) const
inline

Comparison for equality

◆ reset()

template<typename Precise = long double>
void npstat::MultivariateSumAccumulator< Precise >::reset ( )
inline

Reset all accumulators

◆ sum()

template<typename Precise = long double>
const Precise& npstat::MultivariateSumAccumulator< Precise >::sum ( const unsigned long  i) const
inline

Retrieve the sum for a particular index


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