Main Page Modules Class Hierarchy Compound List File List Compound Members

# cLongHistogram Class Reference

`#include <chist.h>`

Inheritance diagram for cLongHistogram::

List of all members.

## Public Methods
Constructors, destructor, assignment.
| cLongHistogram (const cLongHistogram &r)
| cLongHistogram (const char *name=NULL, int numcells=10)
virtual | ~cLongHistogram ()
cLongHistogram& | operator= (const cLongHistogram &)
Redefined cObject member functions.
virtual cObject* | dup () const
virtual int | netPack ()
virtual int | netUnpack ()
Redefined member functions from cStatistic and its subclasses.
virtual void | collect (double val)
virtual double | random () const
## Protected Methods
virtual void | setupRange ()

## Detailed Description

Equidistant histogram for integers. cLongHistogram is derived from cEqdHistogramBase which contains most of the functionality.

The histogram is set up in the following way:

- the cell size is always integer: 1, 2, 3 etc.
- rangemin, rangemax and the cell boundaries are at halves. For example 1.5, 10.5. This is done so to prevent misunderstandings.
- the number of cells is exactly num_cells
- the range_ext_factor is also kept. The actual histogram range will be: (min, max) extended range_ext_factor times and rounded up to the nearest integer multiple of num_cells.

## Constructor & Destructor Documentation

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

| Copy constructor.

cLongHistogram::cLongHistogram ( | const char * name = NULL,
| int numcells = 10 )`[explicit]`

| Constructor.

cLongHistogram::~cLongHistogram ( | )`[virtual]`

| Destructor.

## Member Function Documentation

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

| Collects one value. FIXME: truncates + collects Reimplemented from cDensityEstBase.

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

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

int cLongHistogram::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 cEqdHistogramBase.

int cLongHistogram::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 cEqdHistogramBase.

cLongHistogram & cLongHistogram::operator= ( | const cLongHistogram & )`[inline]`

| Assignment is not supported by this class: this method throws a cException when called.

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

| Returns a random number based on the distribution collected. If no values have been collected, it returns 0; when in initial collection phase, it returns one of the stored observations; after the histogram has been set up, a random integer is returned. Reimplemented from cDensityEstBase.

void cLongHistogram::setupRange ( | )`[protected, virtual]`

| Called internally by transform(), this method should determine and set up the histogram range Reimplemented from cEqdHistogramBase.

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

- chist.h