OMNeT++ Simulation Library  6.0.3
cAbstractHistogram Class Referenceabstract

#include <cabstracthistogram.h>

Description

Interface and base class for histogram-like density estimation classes.

Inheritance diagram for cAbstractHistogram:
cStdDev cStatistic cRandom cOwnedObject cNamedObject cObject cHistogram cPrecollectionBasedDensityEst cPSquare cKSplit

Classes

struct  Bin
 Information about a histogram bin. This struct is not used internally by the histogram classes, only to return information to the user. More...
 

Public Member Functions

Constructors, destructor, assignment.
 cAbstractHistogram (const cAbstractHistogram &other)=default
 
 cAbstractHistogram (const char *name=nullptr, bool weighted=false)
 
virtual ~cAbstractHistogram ()
 
cAbstractHistogramoperator= (const cAbstractHistogram &res)
 
virtual cAbstractHistogramdup () const override
 
Accessing histogram bins.
virtual bool binsAlreadySetUp () const =0
 
virtual void setUpBins ()=0
 
virtual std::vector< double > getBinEdges () const
 
virtual std::vector< double > getBinValues () const
 
virtual int getNumBins () const =0
 
virtual double getBinEdge (int k) const =0
 
virtual double getBinValue (int k) const =0
 
virtual double getBinPDF (int k) const
 
virtual int64_t getNumUnderflows () const =0
 
virtual int64_t getNumOverflows () const =0
 
virtual double getUnderflowSumWeights () const =0
 
virtual double getOverflowSumWeights () const =0
 
virtual int64_t getNumNegInfs () const =0
 
virtual int64_t getNumPosInfs () const =0
 
virtual double getNegInfSumWeights () const =0
 
virtual double getPosInfSumWeights () const =0
 
virtual Bin getBinInfo (int k) const
 
Density and cumulated density approximation functions, random number generation.
virtual double getPDF (double x) const
 
virtual double getCDF (double x) const
 
virtual double draw () const override
 
- Public Member Functions inherited from cStdDev
 cStdDev (const cStdDev &r)
 
 cStdDev (const char *name=nullptr, bool weighted=false)
 
virtual ~cStdDev ()
 
cStdDevoperator= (const cStdDev &res)
 
virtual std::string str () const override
 
virtual void parsimPack (cCommBuffer *buffer) const override
 
virtual void parsimUnpack (cCommBuffer *buffer) override
 
virtual bool isWeighted () const override
 
virtual void collect (double value) override
 
virtual void collectWeighted (double value, double weight) override
 
virtual void merge (const cStatistic *other) override
 
virtual int64_t getCount () const override
 
virtual double getSum () const override
 
virtual double getSqrSum () const override
 
virtual double getMin () const override
 
virtual double getMax () const override
 
virtual double getMean () const override
 
virtual double getStddev () const override
 
virtual double getVariance () const override
 
virtual double getSumWeights () const override
 
virtual double getWeightedSum () const override
 
virtual double getSqrSumWeights () const override
 
virtual double getWeightedSqrSum () const override
 
virtual void clear () override
 
virtual void saveToFile (FILE *) const override
 
virtual void loadFromFile (FILE *) override
 
virtual void collect (double value)=0
 
virtual void collect (SimTime value)
 
virtual void collectWeighted (double value, double weight)
 
virtual void collectWeighted (SimTime value, double weight)
 
virtual void collectWeighted (double value, SimTime weight)
 
virtual void collectWeighted (SimTime value, SimTime weight)
 
- Public Member Functions inherited from cStatistic
 cStatistic (const cStatistic &r)
 
 cStatistic (const char *name=nullptr)
 
virtual ~cStatistic ()
 
cStatisticoperator= (const cStatistic &res)
 
virtual void collect (SimTime value)
 
virtual void collectWeighted (SimTime value, double weight)
 
virtual void collectWeighted (double value, SimTime weight)
 
virtual void collectWeighted (SimTime value, SimTime weight)
 
virtual void record ()
 
virtual void recordWithUnit (const char *unit)
 
virtual void recordAs (const char *name, const char *unit=nullptr)
 
- Public Member Functions inherited from cRandom
 cRandom (cRNG *rng)
 
 cRandom (const char *name=nullptr, cRNG *rng=nullptr)
 
virtual ~cRandom ()
 
virtual void setRNG (cRNG *rng)
 
cRNGgetRNG () const
 
- Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 
 cOwnedObject (const char *name, bool namepooling=true)
 
 cOwnedObject (const cOwnedObject &obj)
 
virtual ~cOwnedObject ()
 
cOwnedObjectoperator= (const cOwnedObject &o)
 
virtual cObjectgetOwner () const override
 
virtual bool isOwnedObject () const override
 
- Public Member Functions inherited from cNamedObject
 cNamedObject ()
 
 cNamedObject (const char *name, bool namepooling=true)
 
 cNamedObject (const cNamedObject &obj)
 
virtual ~cNamedObject ()
 
cNamedObjectoperator= (const cNamedObject &o)
 
virtual void setName (const char *s)
 
virtual const char * getName () const override
 
virtual void setNamePooling (bool b)
 
virtual bool getNamePooling ()
 
- Public Member Functions inherited from cObject
 cObject ()
 
 cObject (const cObject &other)=default
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
virtual std::string getClassAndFullName () const
 
virtual std::string getClassAndFullPath () const
 
const cObjectgetThisPtr () const
 
virtual std::ostream & printOn (std::ostream &os) const
 
virtual bool isSoftOwner () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
virtual cClassDescriptorgetDescriptor () const
 
void copyNotSupported () const
 

Additional Inherited Members

- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cSoftOwnergetOwningContext ()
 
- Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
 
virtual void drop (cOwnedObject *obj)
 
void dropAndDelete (cOwnedObject *obj)
 

Constructor & Destructor Documentation

◆ cAbstractHistogram() [1/2]

cAbstractHistogram ( const cAbstractHistogram other)
default

Copy constructor.

◆ cAbstractHistogram() [2/2]

cAbstractHistogram ( const char *  name = nullptr,
bool  weighted = false 
)
inlineexplicit

Constructor.

◆ ~cAbstractHistogram()

virtual ~cAbstractHistogram ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ operator=()

cAbstractHistogram& operator= ( const cAbstractHistogram res)
inline

Assignment operator. The name member is not copied; see cNamedObject::operator=() for details.

References cStdDev::operator=().

◆ dup()

virtual cAbstractHistogram* dup ( ) const
inlineoverridevirtual

Creates and returns an exact copy of this object. See cObject for more details.

Reimplemented from cStdDev.

Reimplemented in cKSplit, cHistogram, and cPSquare.

◆ binsAlreadySetUp()

virtual bool binsAlreadySetUp ( ) const
pure virtual

Returns true if histogram is already available. See setUpBins().

Implemented in cPrecollectionBasedDensityEst, cHistogram, and cPSquare.

◆ setUpBins()

virtual void setUpBins ( )
pure virtual

Sets up histogram bins, possibly based on data collected during a precollection phase. Calling this if the bins are already set up raises an error.

Implemented in cKSplit, cHistogram, and cPSquare.

◆ getBinEdges()

virtual std::vector<double> getBinEdges ( ) const
virtual

Returns the bin edges of the histogram. There is always one more edge than bin, except when the histogram has not been set up yet, in which case both are zero.

Reimplemented in cHistogram.

◆ getBinValues()

virtual std::vector<double> getBinValues ( ) const
virtual

Returns the bin values of the histogram. There is always one less bin than edge, except when the histogram has not been set up yet, in which case both are zero.

Reimplemented in cHistogram.

◆ getNumBins()

virtual int getNumBins ( ) const
pure virtual

Returns the number of histogram bins.

Implemented in cHistogram, cKSplit, and cPSquare.

◆ getBinEdge()

virtual double getBinEdge ( int  k) const
pure virtual

Returns the kth histogram bin edge. Legal values for k are 0 through getNumBins(), that is, there's one more edge than the number of bins. getBinEdge(0) returns the lower edge of the first bin, and getBinEdge(getNumBins()) returns the upper edge of the last bin. The lower edge is inclusive, the upper edge is exclusive.

Implemented in cHistogram, cKSplit, and cPSquare.

◆ getBinValue()

virtual double getBinValue ( int  k) const
pure virtual

Returns the total weight of the observations in the k'th bin of the histogram. (In the unweighted case, every observation is regarded as having the weight 1.0.)

Implemented in cHistogram, cKSplit, and cPSquare.

◆ getBinPDF()

virtual double getBinPDF ( int  k) const
virtual

Returns the estimated value of the Probability Density Function within bin k. This method simply divides the number of observations in bin k with the bin size and the number of total observations collected.

◆ getNumUnderflows()

virtual int64_t getNumUnderflows ( ) const
pure virtual

Returns number of observations that were below the histogram range, independent of their weights. This includes the number of collected negative infinities as well.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getNumOverflows()

virtual int64_t getNumOverflows ( ) const
pure virtual

Returns number of observations that were above the histogram range, independent of their weights. This includes the number of collected positive infinities as well.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getUnderflowSumWeights()

virtual double getUnderflowSumWeights ( ) const
pure virtual

Returns the total weight of the observations that were below the histogram range. This includes the weights of the collected negative infinities as well.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getOverflowSumWeights()

virtual double getOverflowSumWeights ( ) const
pure virtual

Returns the total weight of the observations that were above the histogram range. This includes the weights of the collected positive infinities as well.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getNumNegInfs()

virtual int64_t getNumNegInfs ( ) const
pure virtual

Returns number of observations that were negative infinity, independent of their weights.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getNumPosInfs()

virtual int64_t getNumPosInfs ( ) const
pure virtual

Returns number of observations that were positive infinity, independent of their weights.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getNegInfSumWeights()

virtual double getNegInfSumWeights ( ) const
pure virtual

Returns the total weight of the observations that were negative infinity.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getPosInfSumWeights()

virtual double getPosInfSumWeights ( ) const
pure virtual

Returns the total weight of the observations that were positive infinity.

Implemented in cHistogram, cPrecollectionBasedDensityEst, and cPSquare.

◆ getBinInfo()

virtual Bin getBinInfo ( int  k) const
virtual

Combines the functionality of getBinEdge(), getBinValue() and getBinPDF() into a single call.

◆ getPDF()

virtual double getPDF ( double  x) const
virtual

Returns the estimated value of the Probability Density Function at a given x.

◆ getCDF()

virtual double getCDF ( double  x) const
virtual

Returns the estimated value of the Cumulative Density Function at a given x.

◆ draw()

virtual double draw ( ) const
overridevirtual

Returns a random number from the distribution represented by the histogram.

Reimplemented from cStdDev.

Reimplemented in cPSquare.


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