The Histogram class allows to collect a set of values and then compute some statistics like average, variance, standardDeviation, and percentiles.
More...
#include <vclib/math/histogram.h>
|
uint | binIndex (ScalarType elem) const |
| Returns the index of the bin which contains a given element.
|
|
|
std::vector< ScalarType > | mHist |
|
std::vector< ScalarType > | mRanges |
|
ScalarType | mMinRange = 0 |
|
ScalarType | mMaxRange = 1 |
|
ScalarType | mMin = std::numeric_limits<ScalarType>::max() |
|
ScalarType | mMax = std::numeric_limits<ScalarType>::lowest() |
|
uint | mBinNumber = 0 |
|
ScalarType | mCnt = 0 |
|
ScalarType | mSum = 0 |
|
ScalarType | mRMS = 0 |
|
template<
typename ScalarType>
class vcl::Histogram< ScalarType >
The Histogram class allows to collect a set of values and then compute some statistics like average, variance, standardDeviation, and percentiles.
- Template Parameters
-
◆ Histogram()
vcl::Histogram< ScalarType >::Histogram |
( |
ScalarType |
minRangeValue, |
|
|
ScalarType |
maxRangeValue, |
|
|
uint |
nBins, |
|
|
ScalarType |
gamma = 1.0 |
|
) |
| |
|
inline |
Set the histogram values.
This method is used to correctly initialize the bins of the histogram. n is the number of valid intervals between minv and maxv. for a more robust working, the Histogram class stores also the two out of range intervals (-inf, minv] and [maxv, +inf). Each bin is left closed (eg it contains the value). The gamma parameter is applied to modify the distribution of the ranges of the bins. Default uniform distribution.
◆ addValue()
void vcl::Histogram< ScalarType >::addValue |
( |
ScalarType |
value, |
|
|
ScalarType |
increment = 1.0 |
|
) |
| |
|
inline |
Add a new value to the histogram.
The statistics related to the histogram data (sum, RMS, etc.) are also updated.
◆ average()
Returns the average of the data.
- Returns
◆ binsNumber()
Number of intervals in the histogram.
- Returns
◆ maxBinCount()
Max number of values among all bins (including the two infinity bounded bins)
- Returns
◆ maxBinCountInRange()
Max number of values among all bins between the minRangeValue and maxRangeValue.
- Returns
◆ maxRangeValue()
Maximum value of the range where the histogram is defined.
- Returns
◆ maxValue()
Maximum value that has been added to the histogram.
- Returns
◆ minRangeValue()
Minimum value of the range where the histogram is defined.
- Returns
◆ minValue()
Minimum value that has been added to the histogram.
- Returns
◆ numberValues()
Number of values inserted in the histogram.
- Returns
◆ percentile()
ScalarType vcl::Histogram< ScalarType >::percentile |
( |
ScalarType |
frac | ) |
const |
|
inline |
Returns the value corresponding to a given percentile of the data.
The percentile range between 0 and 1.
- Parameters
-
- Returns
◆ rootMeanSquare()
Returns the Root Mean Square of the data.
- Returns
◆ standardDeviation()
Returns the standard deviation of the data.
- Returns
◆ sumValues()
Total sum of inserted values.
- Returns
◆ variance()
Returns the variance of the data.
- Returns
The documentation for this class was generated from the following file: