QMCStatistic Class Reference

Statistical information on a set of data. More...

#include <QMCStatistic.h>

List of all members.

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.


Detailed Description

Statistical information on a set of data.

Definition at line 31 of file QMCStatistic.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

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

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.

Parameters:
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 
)

Definition at line 104 of file QMCStatistic.cpp.

References nsamples, sum, and weights.

void QMCStatistic::operator= ( const QMCStatistic rhs  ) 

Sets two object equal.

Definition at line 117 of file QMCStatistic.cpp.

References nsamples, sum, sum2, sum3, sum4, and weights.

QMCStatistic QMCStatistic::operator+ ( const QMCStatistic rhs  ) 

Returns the sum of two QMCStatistics.

Definition at line 127 of file QMCStatistic.cpp.

References nsamples, sum, sum2, sum3, sum4, and weights.

void QMCStatistic::reWeight ( double  w  ) 

This will multiply sum and sum2 by factor w.

Parameters:
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  ) 

Writes the state of this object to an XML stream.

Parameters:
strm XML stream

Definition at line 153 of file QMCStatistic.cpp.

References nsamples, sum, sum2, and weights.

bool QMCStatistic::readXML ( istream &  strm  ) 

Loads the state of this object from an XML stream.

Parameters:
strm XML stream
Returns:
whether the read was successful

Definition at line 182 of file QMCStatistic.cpp.

References nsamples, sum, sum2, and weights.

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().


Friends And Related Function Documentation

ostream& operator<< ( ostream &  strm,
const QMCStatistic rhs 
) [friend]

Formats and prints the statistic to a stream.

Definition at line 239 of file QMCStatistic.cpp.


Member Data Documentation

long double QMCStatistic::sum [private]

long double QMCStatistic::sum2 [private]

long double QMCStatistic::sum3 [private]

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]

unsigned long QMCStatistic::nsamples [private]

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().


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

Generated on Sat Jul 5 16:14:06 2008 for QMcBeaver by  doxygen 1.5.6