casacore
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
casacore::StatsHistogram< AccumType > Class Template Reference

Represents an unfilled histogram with equal width bins for binning used for quantile computations. More...

#include <StatsHistogram.h>

Public Member Functions

 StatsHistogram ()=delete
 
 StatsHistogram (AccumType minLimit, AccumType maxLimit, uInt nBins)
 Construct a histogram by specifying its minimum and maximum values and the number of desired bins. More...
 
 ~StatsHistogram ()
 
AccumType getBinWidth () const
 get the binWidth. More...
 
uInt getIndex (AccumType value) const
 get the index of the bin containing the specified value More...
 
const std::vector< AccumType > & getMaxBinLimits () const
 max limit values for all bins More...
 
AccumType getMaxHistLimit () const
 max limit value of entire histogram (ie max limit value of last bin) More...
 
AccumType getMinHistLimit () const
 min limit value of entire histogram (ie min limit value of first bin) More...
 
uInt getNBins () const
 get the number of bins More...
 

Private Member Functions

void _minMaxIdxRange (Int &minIdx, Int &maxIdx, AccumType value, Bool higher) const
 
uInt _getUInt (const casacore::Complex &)
 The Complex and DComplex versions are used solely to permit compilation. More...
 
uInt _getUInt (const casacore::DComplex &)
 

Static Private Member Functions

static uInt _getUInt (const AccumType &v)
 This does the obvious conversions. More...
 

Private Attributes

AccumType _binWidth
 
AccumType _minHistLimit
 
AccumType _maxHistLimit
 
uInt _nBins
 
std::vector< AccumType > _maxBinLimits
 maximum values for all bins More...
 

Detailed Description

template<class AccumType>
class casacore::StatsHistogram< AccumType >

Represents an unfilled histogram with equal width bins for binning used for quantile computations.

It is necessary to store the min/max values of the bin limits, because machine precision issues when the bin width is sufficiently small can cause slightly different results for these when different methods are used to compute them, leading to accounting errors when the histogram is filled with data.

Definition at line 47 of file StatsHistogram.h.

Constructor & Destructor Documentation

◆ StatsHistogram() [1/2]

template<class AccumType >
casacore::StatsHistogram< AccumType >::StatsHistogram ( )
delete

◆ StatsHistogram() [2/2]

template<class AccumType >
casacore::StatsHistogram< AccumType >::StatsHistogram ( AccumType  minLimit,
AccumType  maxLimit,
uInt  nBins 
)

Construct a histogram by specifying its minimum and maximum values and the number of desired bins.

No padding of the min/max values is done internally, so the caller should do that prior to construction if necessary.

◆ ~StatsHistogram()

template<class AccumType >
casacore::StatsHistogram< AccumType >::~StatsHistogram ( )

Member Function Documentation

◆ _getUInt() [1/3]

template<class AccumType >
static uInt casacore::StatsHistogram< AccumType >::_getUInt ( const AccumType &  v)
inlinestaticprivate

This does the obvious conversions.

The Complex and DComplex specializations (implemented below after the close of the class definition) are used solely to permit compilation. In general, those versions should never actually be called

Definition at line 89 of file StatsHistogram.h.

◆ _getUInt() [2/3]

uInt casacore::StatsHistogram< casacore::Complex >::_getUInt ( const casacore::Complex &  )
inlineprivate

The Complex and DComplex versions are used solely to permit compilation.

In general, these versions should never actually be called

Definition at line 104 of file StatsHistogram.h.

References ThrowCc.

◆ _getUInt() [3/3]

uInt casacore::StatsHistogram< casacore::DComplex >::_getUInt ( const casacore::DComplex &  )
inlineprivate

Definition at line 114 of file StatsHistogram.h.

References ThrowCc.

◆ _minMaxIdxRange()

template<class AccumType >
void casacore::StatsHistogram< AccumType >::_minMaxIdxRange ( Int minIdx,
Int maxIdx,
AccumType  value,
Bool  higher 
) const
private

◆ getBinWidth()

template<class AccumType >
AccumType casacore::StatsHistogram< AccumType >::getBinWidth ( ) const

get the binWidth.

Referenced by casacore::operator<<().

◆ getIndex()

template<class AccumType >
uInt casacore::StatsHistogram< AccumType >::getIndex ( AccumType  value) const

get the index of the bin containing the specified value

◆ getMaxBinLimits()

template<class AccumType >
const std::vector<AccumType>& casacore::StatsHistogram< AccumType >::getMaxBinLimits ( ) const

max limit values for all bins

◆ getMaxHistLimit()

template<class AccumType >
AccumType casacore::StatsHistogram< AccumType >::getMaxHistLimit ( ) const

max limit value of entire histogram (ie max limit value of last bin)

Referenced by casacore::operator<<().

◆ getMinHistLimit()

template<class AccumType >
AccumType casacore::StatsHistogram< AccumType >::getMinHistLimit ( ) const

min limit value of entire histogram (ie min limit value of first bin)

Referenced by casacore::operator<<().

◆ getNBins()

template<class AccumType >
uInt casacore::StatsHistogram< AccumType >::getNBins ( ) const

get the number of bins

Referenced by casacore::operator<<().

Member Data Documentation

◆ _binWidth

template<class AccumType >
AccumType casacore::StatsHistogram< AccumType >::_binWidth
private

Definition at line 80 of file StatsHistogram.h.

◆ _maxBinLimits

template<class AccumType >
std::vector<AccumType> casacore::StatsHistogram< AccumType >::_maxBinLimits
private

maximum values for all bins

Definition at line 83 of file StatsHistogram.h.

◆ _maxHistLimit

template<class AccumType >
AccumType casacore::StatsHistogram< AccumType >::_maxHistLimit
private

Definition at line 80 of file StatsHistogram.h.

◆ _minHistLimit

template<class AccumType >
AccumType casacore::StatsHistogram< AccumType >::_minHistLimit
private

Definition at line 80 of file StatsHistogram.h.

◆ _nBins

template<class AccumType >
uInt casacore::StatsHistogram< AccumType >::_nBins
private

Definition at line 81 of file StatsHistogram.h.


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