#include <Accumulator.h>
Public Member Functions | |
Accumulator () | |
void | addEntry (double value, double weight=1.) |
double | mean () const |
unsigned long | nEntries () const |
double | sigma () const |
double | variance () const |
double | weightedMean () const |
Private Attributes | |
unsigned long | n_ |
double | sum_ |
double | sumOfSquares_ |
double | sumOfWeights_ |
double | weightedSum_ |
For validation purposes. This program calculates mean and RMS of a distribution
Rick Wilkinson
Definition at line 12 of file Accumulator.h.
Accumulator::Accumulator | ( | ) |
Definition at line 4 of file Accumulator.cc.
void Accumulator::addEntry | ( | double | value, |
double | weight = 1. |
||
) |
Definition at line 14 of file Accumulator.cc.
References n_, sum_, sumOfSquares_, sumOfWeights_, relativeConstraints::value, histoStyle::weight, and weightedSum_.
double Accumulator::mean | ( | ) | const |
|
inline |
|
inline |
Definition at line 23 of file Accumulator.h.
References mathSSE::sqrt(), and variance().
Referenced by operator<<().
double Accumulator::variance | ( | ) | const |
Definition at line 28 of file Accumulator.cc.
References cuy::denominator, mean(), n_, cuy::numerator, sum_, and sumOfSquares_.
Referenced by sigma().
double Accumulator::weightedMean | ( | ) | const |
|
private |
Definition at line 34 of file Accumulator.h.
Referenced by addEntry(), mean(), nEntries(), and variance().
|
private |
Definition at line 30 of file Accumulator.h.
Referenced by addEntry(), mean(), and variance().
|
private |
Definition at line 31 of file Accumulator.h.
Referenced by addEntry(), and variance().
|
private |
Definition at line 33 of file Accumulator.h.
Referenced by addEntry(), and weightedMean().
|
private |
Definition at line 32 of file Accumulator.h.
Referenced by addEntry(), and weightedMean().