cPSquare Class Reference¶
|
API
|
Public Member Functions | |
Constructors, destructor, assignment. | |
| cPSquare (const cPSquare &r) | |
| cPSquare (const char *name=nullptr, int bins=10) | |
| virtual | ~cPSquare () |
| cPSquare & | operator= (const cPSquare &res) |
Redefined cObject member functions. | |
| virtual cPSquare * | dup () const override |
| virtual void | parsimPack (cCommBuffer *buffer) const override |
| virtual void | parsimUnpack (cCommBuffer *buffer) override |
Redefined member functions from cStatistic | |
| virtual bool | binsAlreadySetUp () const override |
| virtual void | setUpBins () override |
| virtual void | collect (double value) override |
| virtual void | collectWeighted (double value, double weight) override |
| virtual int | getNumBins () const override |
| virtual double | getBinEdge (int k) const override |
| virtual double | getBinValue (int k) const override |
| virtual int64_t | getNumUnderflows () const override |
| virtual int64_t | getNumOverflows () const override |
| virtual double | getUnderflowSumWeights () const override |
| virtual double | getOverflowSumWeights () const override |
| virtual int64_t | getNumNegInfs () const override |
| virtual int64_t | getNumPosInfs () const override |
| virtual double | getNegInfSumWeights () const override |
| virtual double | getPosInfSumWeights () const override |
| virtual double | draw () const override |
| virtual void | merge (const cStatistic *other) override |
| virtual void | clear () override |
| virtual void | saveToFile (FILE *) const override |
| virtual void | loadFromFile (FILE *) override |
| 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) |
| Public Member Functions inherited from cAbstractHistogram | |
| cAbstractHistogram (const cAbstractHistogram &other)=default | |
| cAbstractHistogram (const char *name=nullptr, bool weighted=false) | |
| virtual | ~cAbstractHistogram () |
| cAbstractHistogram & | operator= (const cAbstractHistogram &res) |
| virtual std::vector< double > | getBinEdges () const |
| virtual std::vector< double > | getBinValues () const |
| virtual double | getBinPDF (int k) const |
| virtual Bin | getBinInfo (int k) const |
| virtual double | getPDF (double x) const |
| virtual double | getCDF (double x) const |
| Public Member Functions inherited from cStdDev | |
| cStdDev (const cStdDev &r) | |
| cStdDev (const char *name=nullptr, bool weighted=false) | |
| virtual | ~cStdDev () |
| cStdDev & | operator= (const cStdDev &res) |
| virtual std::string | str () const override |
| virtual bool | isWeighted () const 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 | collect (SimTime value) |
| 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 () |
| cStatistic & | operator= (const cStatistic &res) |
| 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 | |
| virtual void | setRNG (cRNG *rng) |
| cRNG * | getRNG () const |
| Public Member Functions inherited from cOwnedObject | |
| cOwnedObject () | |
| cOwnedObject (const char *name, bool namepooling=true) | |
| cOwnedObject (const cOwnedObject &obj) | |
| virtual | ~cOwnedObject () |
| cOwnedObject & | operator= (const cOwnedObject &o) |
| virtual cObject * | getOwner () 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 () |
| cNamedObject & | operator= (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 cObject * | getThisPtr () const |
| virtual std::ostream & | printOn (std::ostream &os) const |
| virtual bool | isSoftOwner () const |
| virtual void | forEachChild (cVisitor *v) |
| cObject * | findObject (const char *name, bool deep=true) |
| virtual cClassDescriptor * | getDescriptor () const |
| void | copyNotSupported () const |
Additional Inherited Members | |
| Static Public Member Functions inherited from cOwnedObject | |
| static long | getTotalObjectCount () |
| static long | getLiveObjectCount () |
| static void | resetObjectCounters () |
| static cSoftOwner * | getOwningContext () |
| Protected Member Functions inherited from cObject | |
| virtual void | take (cOwnedObject *obj) |
| virtual void | drop (cOwnedObject *obj) |
| void | dropAndDelete (cOwnedObject *obj) |
Description
Implements the P2 algorithm, which calculates quantile values without storing the observations. See the seminal paper titled "The P^2 Algorithm for Dynamic Statistical Computing Calculation of Quantiles and Histograms Without Storing Observations" by Raj Jain and Imrich Chlamtac.
Constructor & Destructor Documentation
◆ cPSquare() [1/2]
◆ cPSquare() [2/2]
|
explicit |
Constructor.
◆ ~cPSquare()
|
virtual |
Destructor.
Member Function Documentation
◆ operator=()
Assignment operator. The name member is not copied; see cNamedObject::operator=() for details.
References cPSquare().
◆ dup()
|
inlineoverridevirtual |
Creates and returns an exact copy of this object. See cObject for more details.
Reimplemented from cAbstractHistogram.
References cPSquare().
◆ parsimPack()
|
overridevirtual |
◆ parsimUnpack()
|
overridevirtual |
◆ binsAlreadySetUp()
|
inlineoverridevirtual |
Returns true if histogram is already available. This cPSquare implementation always returns true, since the algorithm does not contain a precollection stage.
Implements cAbstractHistogram.
◆ setUpBins()
|
inlineoverridevirtual |
Transforms the array of pre-collected values into histogram structure. This cPSquare implementation does nothing.
Implements cAbstractHistogram.
◆ collect() [1/2]
|
overridevirtual |
◆ collectWeighted() [1/4]
|
overridevirtual |
Collects one observation with a given weight. Throws an error, as cPSquare does not support weighted statistics.
Reimplemented from cStdDev.
References cStatistic::collectWeighted().
◆ getNumBins()
|
overridevirtual |
Returns the number of bins used.
Implements cAbstractHistogram.
◆ getBinEdge()
|
overridevirtual |
Returns the kth bin boundary. Note that because of the P2 algorithm, bin boundaries are shifting during data collection, thus getBinValue() and other methods based on getBinValue() and getBinEdge() return approximate values.
Implements cAbstractHistogram.
◆ getBinValue()
|
overridevirtual |
Returns the number of observations in the kth histogram bin.
Implements cAbstractHistogram.
◆ getNumUnderflows()
|
inlineoverridevirtual |
Returns number of observations that were below the histogram range, independent of their weights. In cPSquare, this is always the same as the number of negative infinities.
Implements cAbstractHistogram.
◆ getNumOverflows()
|
inlineoverridevirtual |
Returns number of observations that were above the histogram range, independent of their weights. In cPSquare, this is always the same as the number of positive infinities.
Implements cAbstractHistogram.
◆ getUnderflowSumWeights()
|
inlineoverridevirtual |
Returns the total weight of the observations that were below the histogram range. In cPSquare, this is always the same as the number of negative infinities.
Implements cAbstractHistogram.
◆ getOverflowSumWeights()
|
inlineoverridevirtual |
Returns the total weight of the observations that were above the histogram range. In cPSquare, this is always the same as the number of positive infinities.
Implements cAbstractHistogram.
◆ getNumNegInfs()
|
inlineoverridevirtual |
Returns number of observations that were negative infinity, independent of their weights.
Implements cAbstractHistogram.
◆ getNumPosInfs()
|
inlineoverridevirtual |
Returns number of observations that were positive infinity, independent of their weights.
Implements cAbstractHistogram.
◆ getNegInfSumWeights()
|
inlineoverridevirtual |
Returns the total weight of the observations that were negative infinity. Since cPSquare does not support weighted statistics, this is always the same as the number of observations that were negative infinity.
Implements cAbstractHistogram.
◆ getPosInfSumWeights()
|
inlineoverridevirtual |
Returns the total weight of the observations that were positive infinity. Since cPSquare does not support weighted statistics, this is always the same as the number of observations that were positive infinity.
Implements cAbstractHistogram.
◆ draw()
|
overridevirtual |
Generates a random number based on the collected data.
Reimplemented from cAbstractHistogram.
◆ merge()
|
overridevirtual |
Merging is not supported by this class. This method throws an error.
Reimplemented from cStdDev.
◆ clear()
|
overridevirtual |
Clears the results collected so far.
Reimplemented from cStdDev.
◆ saveToFile()
|
overridevirtual |
Writes the contents of the object into a text file.
Reimplemented from cStdDev.
◆ loadFromFile()
|
overridevirtual |
Reads the object data from a file, in the format written out by saveToFile().
Reimplemented from cStdDev.
◆ collect() [2/2]
|
inlinevirtual |
Convenience method, delegates to collect(double).
Reimplemented from cStatistic.
◆ collectWeighted() [2/4]
|
inlinevirtual |
Convenience method, delegates to collectWeighted(double, double).
Reimplemented from cStatistic.
◆ collectWeighted() [3/4]
|
inlinevirtual |
Convenience method, delegates to collectWeighted(double, double).
Reimplemented from cStatistic.
◆ collectWeighted() [4/4]
Convenience method, delegates to collectWeighted(double, double).
Reimplemented from cStatistic.
Generated on for API by