#include <chist.h>
Inheritance diagram for cDoubleHistogram:
cDoubleHistogram is derived from cEqdHistogramBase which contains most of the functionality.
Examples:
The following histogram will determine the range from the first few observations, then it set up 10 equal-size cells on it:
cDoubleHistogram hist("hist");
This one will create 30 cells, after determining the range from the first few observations:
cDoubleHistogram hist("hist"); hist.setNumCells(30);
To explicitly control the cells, you can use the following:
cDoubleHistogram hist("hist"); hist.setRange(0,3); hist.setNumCells(30);
If you only know that the numbers will be nonnegative, but you don't know their ranges, you can use the following (which will set up 20 cells, between 0 and an auto-determined limit):
cDoubleHistogram hist("hist"); hist.setRangeAutoUpper(0); hist.setNumCells(20);
Public Member Functions | |
Constructors, destructor, assignment. | |
cDoubleHistogram (const cDoubleHistogram &r) | |
cDoubleHistogram (const char *name=NULL, int numcells=-1) | |
virtual | ~cDoubleHistogram () |
cDoubleHistogram & | operator= (const cDoubleHistogram &) |
Redefined cObject member functions. | |
virtual cPolymorphic * | dup () const |
Redefined member functions from cStatistic and its subclasses. | |
virtual double | random () const |
Protected Member Functions | |
virtual void | setupRange () |
|
Copy constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Creates and returns an exact copy of this object. See cObject for more details. Reimplemented from cStdDev. |
|
Assignment is not supported by this class: this method throws a cRuntimeError when called.
|
|
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 cStdDev. |
|
Called internally by transform(), this method should determine and set up the histogram range. It also calculates the cell size. Reimplemented from cEqdHistogramBase. |