16#ifndef QGSSTATISTICALSUMMARY_H
17#define QGSSTATISTICALSUMMARY_H
80 void calculate(
const QList<double> &values );
96 void addValue(
double value );
112 void addVariant(
const QVariant &value );
133 int count()
const {
return mCount; }
143 double sum()
const {
return mSum; }
149 double mean()
const {
return mMean; }
156 double median()
const {
return mMedian; }
162 double min()
const {
return mMin; }
168 double max()
const {
return mMax; }
174 double range()
const {
return std::isnan( mMax ) || std::isnan( mMin ) ? std::numeric_limits<double>::quiet_NaN() : mMax - mMin; }
182 double first()
const {
return mFirst; }
190 double last()
const {
return mLast; }
198 double stDev()
const {
return mStdev; }
213 int variety()
const {
return mValueCount.count(); }
258 double interQuartileRange()
const {
return std::isnan( mThirdQuartile ) || std::isnan( mFirstQuartile ) ? std::numeric_limits<double>::quiet_NaN() : mThirdQuartile - mFirstQuartile; }
288 double mFirstQuartile;
289 double mThirdQuartile;
292 QMap< double, int > mValueCount;
293 QList< double > mValues;
294 bool mRequiresAllValueStorage =
false;
295 bool mRequiresHisto =
false;
Statistic
Available generic statistics.
QFlags< Statistic > Statistics
Statistics to be calculated for generic values.
Calculator for summary statistics for a list of doubles.
double firstQuartile() const
Returns the first quartile of the values.
double sum() const
Returns calculated sum of values.
double mean() const
Returns calculated mean of values.
double last() const
Returns the last value obtained.
double majority() const
Returns majority of values.
int countMissing() const
Returns the number of missing (null) values.
double interQuartileRange() const
Returns the inter quartile range of the values.
double median() const
Returns calculated median of values.
double minority() const
Returns minority of values.
double sampleStDev() const
Returns sample standard deviation.
double min() const
Returns calculated minimum from values.
virtual ~QgsStatisticalSummary()=default
double first() const
Returns the first value obtained.
Qgis::Statistics statistics() const
Returns flags which specify which statistics will be calculated.
double stDev() const
Returns population standard deviation.
double thirdQuartile() const
Returns the third quartile of the values.
int count() const
Returns calculated count of values.
double range() const
Returns calculated range (difference between maximum and minimum values).
double max() const
Returns calculated maximum from values.
int variety() const
Returns variety of values.