#include <QMCStatistic.h>
Public Member Functions | |
QMCStatistic () | |
Creates a zeroed out instance of the class and generates the MPI type if it has not been done. | |
void | zeroOut () |
Sets all of the data in the object to zero. | |
unsigned long | getNumberSamples () const |
Gets the number of data samples entered into the object. | |
double | getAverage () const |
Gets the average of the data entered into the object. | |
double | getVariance () const |
Gets the variance of the data entered into the object. | |
double | getStandardDeviation () const |
Gets the standard deviation of the data entered into the object. | |
double | getSkewness () const |
double | getKurtosis () const |
void | newSample (long double s, long double weight) |
Adds a new data sample to the object. | |
void | quickSample (long double s, long double weight) |
void | operator= (const QMCStatistic &rhs) |
Sets two object equal. | |
QMCStatistic | operator+ (const QMCStatistic &rhs) |
Returns the sum of two QMCStatistics. | |
void | reWeight (double w) |
This will multiply sum and sum2 by factor w. | |
void | toXML (ostream &strm) |
Writes the state of this object to an XML stream. | |
bool | readXML (istream &strm) |
Loads the state of this object from an XML stream. | |
Static Public Attributes | |
static MPI_Datatype | MPI_TYPE |
The MPI data type for a QMCStatistic. | |
static MPI_Op | MPI_REDUCE |
The MPI operation for performing MPI_Reduce on QMCStatistics. | |
Static Private Member Functions | |
static void | buildMpiType () |
Build MPI_TYPE. | |
static void | buildMpiReduce () |
Build MPI_REDUCE. | |
static void | Reduce_Function (QMCStatistic *in, QMCStatistic *inout, int *len, MPI_Datatype *dptr) |
An MPI function which allows MPI_Reduce to be used in adding QMCStatistics. | |
Private Attributes | |
long double | sum |
long double | sum2 |
long double | sum3 |
long double | sum4 |
long double | weights |
unsigned long | nsamples |
Static Private Attributes | |
static bool | mpiTypeCreated = false |
A flag which tells if MPI_TYPE has been generated. | |
Friends | |
ostream & | operator<< (ostream &strm, const QMCStatistic &rhs) |
Formats and prints the statistic to a stream. |
Definition at line 31 of file QMCStatistic.h.
QMCStatistic::QMCStatistic | ( | ) |
Creates a zeroed out instance of the class and generates the MPI type if it has not been done.
Definition at line 15 of file QMCStatistic.cpp.
References buildMpiReduce(), buildMpiType(), mpiTypeCreated, and zeroOut().
void QMCStatistic::zeroOut | ( | ) |
Sets all of the data in the object to zero.
Definition at line 30 of file QMCStatistic.cpp.
References nsamples.
Referenced by QMCStatistic(), and QMCProperty::zeroOut().
unsigned long QMCStatistic::getNumberSamples | ( | ) | const |
Gets the number of data samples entered into the object.
Definition at line 38 of file QMCStatistic.cpp.
References nsamples.
Referenced by QMCProperty::getBlockStandardDeviationStandardDeviation(), QMCProperty::getBlockVariance(), QMCProperty::getBlockVarianceStandardDeviation(), QMCProperty::getNumberSamples(), operator<<(), and QMCProperty::printAll().
double QMCStatistic::getAverage | ( | ) | const |
Gets the average of the data entered into the object.
Definition at line 43 of file QMCStatistic.cpp.
References nsamples, sum, and weights.
Referenced by QMCProperty::getAverage(), getKurtosis(), getSkewness(), getVariance(), operator<<(), and QMCProperty::printAll().
double QMCStatistic::getVariance | ( | ) | const |
Gets the variance of the data entered into the object.
Definition at line 49 of file QMCStatistic.cpp.
References getAverage(), nsamples, sum2, and weights.
Referenced by QMCProperty::getBlockVariance(), getKurtosis(), QMCProperty::getSeriallyCorrelatedVariance(), getSkewness(), getStandardDeviation(), and QMCProperty::printAll().
double QMCStatistic::getStandardDeviation | ( | ) | const |
Gets the standard deviation of the data entered into the object.
Definition at line 80 of file QMCStatistic.cpp.
References getVariance().
Referenced by operator<<().
double QMCStatistic::getSkewness | ( | ) | const |
Definition at line 55 of file QMCStatistic.cpp.
References getAverage(), getVariance(), nsamples, sum2, sum3, and weights.
Referenced by QMCProperty::getBlockSkewness().
double QMCStatistic::getKurtosis | ( | ) | const |
Definition at line 67 of file QMCStatistic.cpp.
References getAverage(), getVariance(), nsamples, sum2, sum3, sum4, and weights.
Referenced by QMCProperty::getBlockKurtosis().
void QMCStatistic::newSample | ( | long double | s, | |
long double | weight | |||
) |
Adds a new data sample to the object.
s | new sample data | |
weight | statistical weight of the sample |
Definition at line 85 of file QMCStatistic.cpp.
References nsamples, sum, sum2, sum3, sum4, and weights.
Referenced by QMCProperty::newSample(), and QMCProperty::operator+().
void QMCStatistic::quickSample | ( | long double | s, | |
long double | weight | |||
) |
void QMCStatistic::operator= | ( | const QMCStatistic & | rhs | ) |
QMCStatistic QMCStatistic::operator+ | ( | const QMCStatistic & | rhs | ) |
void QMCStatistic::reWeight | ( | double | w | ) |
This will multiply sum and sum2 by factor w.
w | the reweighting factor |
Definition at line 144 of file QMCStatistic.cpp.
References sum, sum2, sum3, and sum4.
Referenced by QMCProperty::reWeight().
void QMCStatistic::toXML | ( | ostream & | strm | ) |
bool QMCStatistic::readXML | ( | istream & | strm | ) |
void QMCStatistic::buildMpiType | ( | ) | [static, private] |
Build MPI_TYPE.
Definition at line 266 of file QMCStatistic.cpp.
References MPI_TYPE, nsamples, sum, sum2, sum3, sum4, and weights.
Referenced by QMCStatistic().
void QMCStatistic::buildMpiReduce | ( | ) | [static, private] |
Build MPI_REDUCE.
Definition at line 260 of file QMCStatistic.cpp.
References MPI_REDUCE, and Reduce_Function().
Referenced by QMCStatistic().
void QMCStatistic::Reduce_Function | ( | QMCStatistic * | in, | |
QMCStatistic * | inout, | |||
int * | len, | |||
MPI_Datatype * | dptr | |||
) | [static, private] |
An MPI function which allows MPI_Reduce to be used in adding QMCStatistics.
Definition at line 315 of file QMCStatistic.cpp.
Referenced by buildMpiReduce().
ostream& operator<< | ( | ostream & | strm, | |
const QMCStatistic & | rhs | |||
) | [friend] |
long double QMCStatistic::sum [private] |
Definition at line 34 of file QMCStatistic.h.
Referenced by buildMpiType(), getAverage(), newSample(), operator+(), operator=(), quickSample(), readXML(), reWeight(), and toXML().
long double QMCStatistic::sum2 [private] |
Definition at line 35 of file QMCStatistic.h.
Referenced by buildMpiType(), getKurtosis(), getSkewness(), getVariance(), newSample(), operator+(), operator=(), readXML(), reWeight(), and toXML().
long double QMCStatistic::sum3 [private] |
Definition at line 36 of file QMCStatistic.h.
Referenced by buildMpiType(), getKurtosis(), getSkewness(), newSample(), operator+(), operator=(), and reWeight().
long double QMCStatistic::sum4 [private] |
Definition at line 37 of file QMCStatistic.h.
Referenced by buildMpiType(), getKurtosis(), newSample(), operator+(), operator=(), and reWeight().
long double QMCStatistic::weights [private] |
Definition at line 38 of file QMCStatistic.h.
Referenced by buildMpiType(), getAverage(), getKurtosis(), getSkewness(), getVariance(), newSample(), operator+(), operator=(), quickSample(), readXML(), and toXML().
unsigned long QMCStatistic::nsamples [private] |
Definition at line 39 of file QMCStatistic.h.
Referenced by buildMpiType(), getAverage(), getKurtosis(), getNumberSamples(), getSkewness(), getVariance(), newSample(), operator+(), operator=(), quickSample(), readXML(), toXML(), and zeroOut().
bool QMCStatistic::mpiTypeCreated = false [static, private] |
A flag which tells if MPI_TYPE has been generated.
Definition at line 147 of file QMCStatistic.h.
Referenced by QMCStatistic().
MPI_Datatype QMCStatistic::MPI_TYPE [static] |
The MPI data type for a QMCStatistic.
Definition at line 175 of file QMCStatistic.h.
Referenced by buildMpiType(), and QMCProperty::buildMpiType().
MPI_Op QMCStatistic::MPI_REDUCE [static] |
The MPI operation for performing MPI_Reduce on QMCStatistics.
Definition at line 182 of file QMCStatistic.h.
Referenced by buildMpiReduce().