casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 
template<>
uInt _getUInt (const casacore::Complex &)
 
template<>
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

template<class AccumType >
casacore::StatsHistogram< AccumType >::StatsHistogram ( )
delete
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.

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

Member Function Documentation

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.

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

In general, these versions should never actually be called

Definition at line 104 of file StatsHistogram.h.

References ThrowCc.

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

Definition at line 114 of file StatsHistogram.h.

References ThrowCc.

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

get the binWidth.

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

get the index of the bin containing the specified value

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

max limit values for all bins

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

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

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

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

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

get the number of bins

Member Data Documentation

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

Definition at line 80 of file StatsHistogram.h.

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

maximum values for all bins

Definition at line 83 of file StatsHistogram.h.

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

Definition at line 80 of file StatsHistogram.h.

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

Definition at line 80 of file StatsHistogram.h.

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: