# cStdDev Class Reference
[Statistical data collection]

`#include <cstat.h>`

Inheritance diagram for cStdDev:

List of all members.

## Detailed Description

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

## Public Member Functions

Constructors, destructor, assignment.
| cStdDev (const cStdDev &r)
| cStdDev (const char *name=NULL)
virtual | ~cStdDev ()
cStdDev & | operator= (const cStdDev &res)
Redefined cObject member functions.
virtual cPolymorphic * | dup () const
virtual std::string | info () const
virtual void | writeContents (std::ostream &os)
virtual void | netPack (cCommBuffer *buffer)
virtual void | netUnpack (cCommBuffer *buffer)
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 *)

## Constructor & Destructor Documentation

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

| Copy constructor.

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

| Constructor.

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

| Destructor.

## Member Function Documentation

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

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

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

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

virtual cPolymorphic* 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.

virtual std::string cStdDev::info | ( |  | ) | const`[virtual]`

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

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

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

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

| Returns the maximum of the samples collected. Implements cStatistic.

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

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

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

| Returns the minimum of the samples collected. Implements cStatistic.

virtual void cStdDev::netPack | ( | cCommBuffer * | buffer | ) | `[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, cKSplit, cPSquare, cWeightedStdDev, and cVarHistogram.

virtual void cStdDev::netUnpack | ( | cCommBuffer * | buffer | ) | `[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, 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.

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

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

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

| Returns the number of samples collected. Implements cStatistic.

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

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

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

| Returns the squared sum of the collected data. Implements cStatistic.

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

| Returns the standard deviation of the samples collected. Implements cStatistic.

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

| Returns the sum of samples collected. Implements cStatistic.

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

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

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

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

virtual void cStdDev::writeContents | ( | std::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