OMNeT++ Simulation Library  5.6.1
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 cLegacyHistogramBase cLegacyHistogram cVarHistogram cDoubleHistogram cLongHistogram

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)
 
 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 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
 
Methods deprecated due to renaming.
virtual _OPPDEPRECATED bool isTransformed () const final
 
virtual _OPPDEPRECATED void transform () final
 
virtual _OPPDEPRECATED int getNumCells () const final
 
virtual _OPPDEPRECATED double getBasepoint (int k) const final
 
virtual _OPPDEPRECATED double getCellValue (int k) const final
 
virtual _OPPDEPRECATED double getCellPDF (int k) const final
 
virtual _OPPDEPRECATED int64_t getUnderflowCell () const final
 
virtual _OPPDEPRECATED int64_t getOverflowCell () const final
 
virtual _OPPDEPRECATED Bin getCellInfo (int k) const final
 
- 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
 
- 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)
 
virtual _OPPDEPRECATED double getWeights () const final
 
virtual _OPPDEPRECATED void collect2 (double value, double weight) final
 
virtual _OPPDEPRECATED void collect2 (SimTime value, double weight) final
 
virtual _OPPDEPRECATED void collect2 (double value, SimTime weight) final
 
virtual _OPPDEPRECATED void collect2 (SimTime value, SimTime weight) final
 
virtual _OPPDEPRECATED double random () const final
 
virtual _OPPDEPRECATED void clearResult () final
 
- 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
 
virtual bool isSoftOwner () const
 
- 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)
 
virtual ~cObject ()
 
virtual const char * getClassName () const
 
bool isName (const char *s) const
 
virtual const char * getFullName () const
 
virtual std::string getFullPath () const
 
const cObjectgetThisPtr () const
 
virtual _OPPDEPRECATED std::string info () const
 
virtual _OPPDEPRECATED std::string detailedInfo () const
 
virtual void forEachChild (cVisitor *v)
 
cObjectfindObject (const char *name, bool deep=true)
 
void copyNotSupported () const
 

Additional Inherited Members

- Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
 
static long getLiveObjectCount ()
 
static void resetObjectCounters ()
 
static cDefaultListgetDefaultOwner ()
 
- 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)
inline

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's operator=() for more 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 cDoubleHistogram, cLongHistogram, cKSplit, cHistogram, cVarHistogram, 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, cVarHistogram, cPSquare, and cLegacyHistogramBase.

◆ getNumBins()

virtual int getNumBins ( ) const
pure virtual

Returns the number of histogram bins.

Implemented in cHistogram, cKSplit, cPSquare, and cLegacyHistogramBase.

◆ 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, cLegacyHistogram, cKSplit, cVarHistogram, 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, cLegacyHistogram, cKSplit, cVarHistogram, 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.

Reimplemented in cLegacyHistogram, and cVarHistogram.

◆ getCDF()

virtual double getCDF ( double  x) const
virtual

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

Reimplemented in cLegacyHistogram, and cVarHistogram.

◆ draw()

virtual double draw ( ) const
overridevirtual

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

Reimplemented from cStdDev.

Reimplemented in cLegacyHistogram, cPSquare, and cVarHistogram.

◆ isTransformed()

virtual _OPPDEPRECATED bool isTransformed ( ) const
inlinefinalvirtual

Deprecated, use binsAlreadySetUp() instead.

◆ transform()

virtual _OPPDEPRECATED void transform ( )
inlinefinalvirtual

Deprecated, use setUpBins() instead.

◆ getNumCells()

virtual _OPPDEPRECATED int getNumCells ( ) const
inlinefinalvirtual

Deprecated, use getNumBins() instead.

◆ getBasepoint()

virtual _OPPDEPRECATED double getBasepoint ( int  k) const
inlinefinalvirtual

Deprecated, use getBinEdge() instead.

◆ getCellValue()

virtual _OPPDEPRECATED double getCellValue ( int  k) const
inlinefinalvirtual

Deprecated, use getBinValue() instead.

◆ getCellPDF()

virtual _OPPDEPRECATED double getCellPDF ( int  k) const
inlinefinalvirtual

Deprecated, use getBinPDF() instead.

◆ getUnderflowCell()

virtual _OPPDEPRECATED int64_t getUnderflowCell ( ) const
inlinefinalvirtual

Deprecated, use getNumUnderflows() instead.

◆ getOverflowCell()

virtual _OPPDEPRECATED int64_t getOverflowCell ( ) const
inlinefinalvirtual

Deprecated, use getNumUnderflows() instead.

◆ getCellInfo()

virtual _OPPDEPRECATED Bin getCellInfo ( int  k) const
inlinefinalvirtual

Deprecated, use getBinInfo() instead.


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