Main Page Modules Class Hierarchy Compound List File List Compound Members

# cStdDev Class Reference

`#include <cstat.h>`

Inheritance diagram for cStdDev::

List of all members.

## Public Methods

Constructors, destructor, assignment.
| cStdDev (const cStdDev &r)
| cStdDev (const char *name=NULL)
virtual | ~cStdDev ()
cStdDev& | operator= (const cStdDev &res)
Redefined cObject member functions.
virtual cObject* | dup () const
virtual void | info (char *buf)
virtual void | writeContents (ostream &os)
virtual int | netPack ()
virtual int | netUnpack ()
Redefined cStatistic functions.
virtual void | collect (double val)
virtual long | samples () const
virtual double | weights () const
virtual double | sum () const
virtual double | sqrSum () const
virtual double | min () const
virtual double | max () const
virtual double | mean () const
virtual double | stddev () const
virtual double | variance () const
virtual double | random () const
virtual void | clearResult ()
virtual void | saveToFile (FILE *) const
virtual void | loadFromFile (FILE *)

## Detailed Description

Statistics class to collect min, max, mean, standard deviation.

## Constructor & Destructor Documentation

cStdDev::cStdDev ( | const cStdDev & r )`[inline]`

| Copy constructor.

cStdDev::cStdDev ( | const char * name = NULL )`[explicit]`

| Constructor.

cStdDev::~cStdDev ( | )`[inline, virtual]`

| Destructor.

## Member Function Documentation

void cStdDev::clearResult ( | )`[virtual]`

| Clears the results collected so far. Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cHistogramBase, cWeightedStdDev, and cVarHistogram.

void cStdDev::collect ( | double val )`[virtual]`

| Collects one value. Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cLongHistogram, and cWeightedStdDev.

cObject * cStdDev::dup ( | ) const`[inline, virtual]`

| Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cObject. Reimplemented in cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, cWeightedStdDev, and cVarHistogram.

void cStdDev::info ( | char * buf )`[virtual]`

| Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details. Reimplemented from cObject.

void cStdDev::loadFromFile ( | FILE * )`[virtual]`

| Reads the object data from a file written out by saveToFile() (or written by hand) Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cKSplit, cPSquare, cWeightedStdDev, and cVarHistogram.

double cStdDev::max ( | ) const`[inline, virtual]`

| Returns the maximum of the samples collected. Reimplemented from cStatistic.

double cStdDev::mean ( | ) const`[inline, virtual]`

| Returns the mean of the samples collected. Reimplemented from cStatistic. Reimplemented in cWeightedStdDev.

double cStdDev::min ( | ) const`[inline, virtual]`

| Returns the minimum of the samples collected. Reimplemented from cStatistic.

int cStdDev::netPack ( | )`[virtual]`

| Serializes the object into a PVM or MPI send buffer. Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, cWeightedStdDev, and cVarHistogram.

int cStdDev::netUnpack ( | )`[virtual]`

| Deserializes the object from a PVM or MPI receive buffer Used by the simulation kernel for parallel execution. See cObject for more details. Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, cWeightedStdDev, and cVarHistogram.

cStdDev & cStdDev::operator= ( | const cStdDev & res )

| Assignment operator. The name member doesn't get copied; see cObject's operator=() for more details.

double cStdDev::random ( | ) const`[virtual]`

| Returns numbers from a normal distribution with the current mean and standard deviation. Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cLongHistogram, cDoubleHistogram, cKSplit, cPSquare, and cVarHistogram.

long cStdDev::samples ( | ) const`[inline, virtual]`

| Returns the number of samples collected. Reimplemented from cStatistic.

void cStdDev::saveToFile ( | FILE * ) const`[virtual]`

| Writes the contents of the object into a text file. Reimplemented from cStatistic. Reimplemented in cDensityEstBase, cHistogramBase, cEqdHistogramBase, cKSplit, cPSquare, cWeightedStdDev, and cVarHistogram.

double cStdDev::sqrSum ( | ) const`[inline, virtual]`

| Returns the squared sum of the collected data. Reimplemented from cStatistic.

double cStdDev::stddev ( | ) const`[virtual]`

| Returns the standard deviation of the samples collected. Reimplemented from cStatistic.

double cStdDev::sum ( | ) const`[inline, virtual]`

| Returns the sum of samples collected. Reimplemented from cStatistic.

double cStdDev::variance ( | ) const`[virtual]`

| Returns the variance of the samples collected. Reimplemented from cStatistic. Reimplemented in cWeightedStdDev.

double cStdDev::weights ( | ) const`[inline, virtual]`

| Returns the sum of weights of the samples collected. Reimplemented from cStatistic. Reimplemented in cWeightedStdDev.

void cStdDev::writeContents ( | ostream & os )`[virtual]`

| Writes textual information about this object to the stream. See cObject for more details. Reimplemented from cObject. Reimplemented in cDensityEstBase, cKSplit, and cPSquare.

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

- cstat.h