16 #ifndef __OMNETPP_CSTDDEV_H 17 #define __OMNETPP_CSTDDEV_H 20 #include "cstatistic.h" 37 double sumWeightedValues;
38 double sumSquaredWeights;
39 double sumWeightedSquaredValues;
42 void copy(
const cStdDev& other);
45 void assertUnweighted()
const;
59 explicit cStdDev(
const char *name=
nullptr,
bool weighted=
false);
85 virtual std::string str()
const override;
92 virtual void parsimPack(
cCommBuffer *buffer)
const override;
99 virtual void parsimUnpack(
cCommBuffer *buffer)
override;
113 virtual void collect(
double value)
override;
121 virtual void collectWeighted(
double value,
double weight)
override;
127 virtual void merge(
const cStatistic *other)
override;
132 virtual int64_t
getCount()
const override {
return numValues;}
139 virtual double getSum()
const override {assertUnweighted();
return sumWeightedValues;}
146 virtual double getSqrSum()
const override {assertUnweighted();
return sumWeightedSquaredValues;}
152 virtual double getMin()
const override;
158 virtual double getMax()
const override;
164 virtual double getMean()
const override;
170 virtual double getStddev()
const override;
176 virtual double getVariance()
const override;
206 virtual double draw()
const override;
211 virtual void clear()
override;
216 virtual void saveToFile(FILE *)
const override;
222 virtual void loadFromFile(FILE *)
override;
226 #if defined(__clang__) || defined(__GNUC__) 227 #pragma GCC diagnostic push 228 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 267 #if defined(__clang__) || defined(__GNUC__) 268 #pragma GCC diagnostic pop virtual void collect(double value)=0
cWeightedStdDev(const cWeightedStdDev &r)
Definition: cstddev.h:252
virtual double getWeightedSum() const override
Definition: cstddev.h:188
cStdDev & operator=(const cStdDev &res)
cStdDev(const cStdDev &r)
Definition: cstddev.h:54
virtual double getSum() const override
Definition: cstddev.h:139
virtual cStdDev * dup() const override
Definition: cstddev.h:79
cWeightedStdDev & operator=(const cWeightedStdDev &res)
Definition: cstddev.h:257
virtual void collectWeighted(double value, double weight)
Buffer for the communications layer of parallel simulation.
Definition: ccommbuffer.h:41
cWeightedStdDev(const char *name=nullptr)
Definition: cstddev.h:247
virtual double getSqrSumWeights() const override
Definition: cstddev.h:194
Statistics class to collect doubles and calculate weighted statistics from them. One application is t...
Definition: cstddev.h:239
virtual double getWeightedSqrSum() const override
Definition: cstddev.h:200
virtual double getSumWeights() const override
Definition: cstddev.h:182
virtual cWeightedStdDev * dup() const override
Definition: cstddev.h:263
Definition: cabstracthistogram.h:21
virtual int64_t getCount() const override
Definition: cstddev.h:132
virtual ~cStdDev()
Definition: cstddev.h:64
Statistics class to collect min, max, mean, and standard deviation.
Definition: cstddev.h:29
virtual bool isWeighted() const override
Definition: cstddev.h:108
virtual double getSqrSum() const override
Definition: cstddev.h:146
cStatistic is an abstract class for computing statistical properties of a random variable.
Definition: cstatistic.h:34