Main Page Modules Class Hierarchy Compound List File List Compound Members

# cWeightedStdDev Class Reference

`#include <cstat.h>`

Inheritance diagram for cWeightedStdDev::

List of all members.

## Public Methods

Constructors, destructor, assignment.
| cWeightedStdDev (const cWeightedStdDev &r)
| cWeightedStdDev (const char *name=NULL)
virtual | ~cWeightedStdDev ()
cWeightedStdDev& | operator= (const cWeightedStdDev &res)
Redefined cObject member functions.
virtual cObject* | dup () const
virtual int | netPack ()
virtual int | netUnpack ()
Redefined cStatistic functions.
virtual void | collect (double val)
virtual void | collect2 (double val, double weight)
virtual void | clearResult ()
virtual double | weights () const
virtual double | mean () const
virtual double | variance () const
virtual void | saveToFile (FILE *) const
virtual void | loadFromFile (FILE *)

## Detailed Description

Statistics class to collect doubles and calculate weighted statistics of them. It can be used for example to calculate time average.

## Constructor & Destructor Documentation

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

| Constructors, destructor, duplication and assignment.

cWeightedStdDev::cWeightedStdDev ( | const char * name = NULL )`[inline, explicit]`

| Constructors, destructor, duplication and assignment.

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

| Constructors, destructor, duplication and assignment.

## Member Function Documentation

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

| Clears the results collected so far. Reimplemented from cStdDev.

void cWeightedStdDev::collect ( | double val )`[inline, virtual]`

| Collects one value. Reimplemented from cStdDev.

void cWeightedStdDev::collect2 ( | double val,
| double weight )`[virtual]`

| Collects one value with a given weight. Reimplemented from cStatistic.

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

| Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cStdDev.

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

| Reads the object data from a file, in the format written out by saveToFile(). Reimplemented from cStdDev.

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

| Returns the mean of the samples collected. Reimplemented from cStdDev.

int cWeightedStdDev::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 cStdDev.

int cWeightedStdDev::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 cStdDev.

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

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

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

| Writes the contents of the object into a text file. Reimplemented from cStdDev.

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

| Returns the variance of the samples collected. Reimplemented from cStdDev.

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

| Returns the sum of weights of the samples collected. Reimplemented from cStdDev.

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

- cstat.h