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

#include <MultivariateWeightedSumAccumulator.hh>

Public Types

typedef Precise precise_type
 

Public Member Functions

 MultivariateWeightedSumAccumulator ()
 
Precise weightSum () const
 
unsigned long dim () const
 
unsigned long ncalls () const
 
double maxWeight () const
 
const Precise * data () const
 
Precise averageWeight () const
 
template<typename T >
void accumulate (const T *data, const unsigned long len, const double w)
 
void reset ()
 
const Precise & sum (const unsigned long i) const
 
Precise mean (const unsigned long i) const
 
std::vector< Precise > meanVector () const
 

Detailed Description

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

Class for accumulating weighted 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

◆ MultivariateWeightedSumAccumulator()

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

Only default constructor is necessary

Member Function Documentation

◆ accumulate()

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

Accumulate sums for a weighted array of numbers

◆ averageWeight()

template<typename Precise = long double>
Precise npstat::MultivariateWeightedSumAccumulator< Precise >::averageWeight ( ) const
inline

Calculate average weight

◆ data()

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

Get the sums accumulated so far

◆ dim()

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

Dimensionality of the data

◆ maxWeight()

template<typename Precise = long double>
double npstat::MultivariateWeightedSumAccumulator< Precise >::maxWeight ( ) const
inline

Maximum weight among those so far accumulated

◆ mean()

template<typename Precise = long double>
Precise npstat::MultivariateWeightedSumAccumulator< 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::MultivariateWeightedSumAccumulator< Precise >::meanVector ( ) const
inline

Retrieve the vector of means

◆ ncalls()

template<typename Precise = long double>
unsigned long npstat::MultivariateWeightedSumAccumulator< Precise >::ncalls ( ) const
inline

Number of times "accumulate" was called since last reset

◆ reset()

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

Reset all accumulators

◆ sum()

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

Retrieve the sum for a particular index

◆ weightSum()

template<typename Precise = long double>
Precise npstat::MultivariateWeightedSumAccumulator< Precise >::weightSum ( ) const
inline

The sum of weights so far accumulated


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