casacore
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator > Class Template Referenceabstract

Base class of statistics algorithm class hierarchy. More...

#include <StatisticsAlgorithm.h>

Public Member Functions

virtual ~StatisticsAlgorithm ()
 
virtual void addData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 Add a dataset to an existing set of datasets on which statistics are to be calculated. More...
 
virtual void addData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
virtual void addData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void addData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void addData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 
virtual void addData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
virtual void addData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void addData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual StatisticsData::ALGORITHM algorithm () const =0
 get the algorithm that this object uses for computing stats More...
 
void deleteSortedArray ()
 delete any (partially) sorted array More...
 
virtual AccumType getMedian (CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)=0
 
virtual AccumType getMedianAndQuantiles (std::map< Double, AccumType > &quantileToValue, const std::set< Double > &quantiles, CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)=0
 The return value is the median; the quantiles are returned in the quantileToValue map. More...
 
virtual AccumType getMedianAbsDevMed (CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)=0
 get the median of the absolute deviation about the median of the data. More...
 
AccumType getQuantile (Double quantile, CountedPtr< uInt64 > knownNpts=NULL, CountedPtr< AccumType > knownMin=NULL, CountedPtr< AccumType > knownMax=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)
 
virtual std::map< Double, AccumType > getQuantiles (const std::set< Double > &quantiles, CountedPtr< uInt64 > npts=NULL, CountedPtr< AccumType > min=NULL, CountedPtr< AccumType > max=NULL, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt64 nBins=10000)=0
 get a map of quantiles to values. More...
 
virtual AccumType getStatistic (StatisticsData::STATS stat)
 get the value of the specified statistic More...
 
virtual std::pair< Int64, Int64getStatisticIndex (StatisticsData::STATS stat)=0
 certain statistics such as max and min have locations in the dataset associated with them. More...
 
virtual StatsData< AccumType > getStatistics ()
 
virtual void reset ()
 reset this object by clearing data. More...
 
virtual void setData (const DataIterator &first, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 setdata() clears any current datasets or data provider and then adds the specified data set as the first dataset in the (possibly new) set of data sets for which statistics are to be calculated. More...
 
virtual void setData (const DataIterator &first, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
virtual void setData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void setData (const DataIterator &first, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void setData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False)
 
virtual void setData (const DataIterator &first, const WeightsIterator &weightFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False)
 
virtual void setData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void setData (const DataIterator &first, const WeightsIterator &weightFirst, const MaskIterator &maskFirst, uInt nr, const DataRanges &dataRanges, Bool isInclude=True, uInt dataStride=1, Bool nrAccountsForStride=False, uInt maskStride=1)
 
virtual void setDataProvider (StatsDataProvider< CASA_STATP > *dataProvider)
 instead of settng and adding data "by hand", set the data provider that will provide all the data sets. More...
 
virtual void setStatsToCalculate (std::set< StatisticsData::STATS > &stats)
 Provide guidance to algorithms by specifying a priori which statistics the caller would like calculated. More...
 

Protected Member Functions

 StatisticsAlgorithm ()
 
StatisticsAlgorithm< CASA_STATP > & operator= (const StatisticsAlgorithm< CASA_STATP > &other)
 use copy semantics More...
 
virtual void _addData ()
 Allows derived classes to do things after data is set or added. More...
 
const vector< Int64 > & _getCounts () const
 
const vector< DataIterator > & _getData () const
 
StatsDataProvider< CASA_STATP > * _getDataProvider ()
 
const vector< uInt > & _getDataStrides () const
 
const std::map< uInt, Bool > & _getIsIncludeRanges () const
 
const std::map< uInt, MaskIterator > _getMasks () const
 
const std::map< uInt, uInt > & _getMaskStrides () const
 
const std::map< uInt, DataRanges > & _getRanges () const
 
virtual AccumType _getStatistic (StatisticsData::STATS stat)=0
 
virtual StatsData< AccumType > _getStatistics ()=0
 
const std::set< StatisticsData::STATS_getStatsToCalculate () const
 
std::vector< AccumType > & _getSortedArray ()
 
virtual const std::set< StatisticsData::STATS > & _getUnsupportedStatistics () const
 
const std::map< uInt, WeightsIterator > & _getWeights () const
 
void _setSortedArray (const vector< AccumType > &v)
 

Static Protected Member Functions

static std::map< Double, uInt64_indicesFromQuantiles (uInt64 npts, const std::set< Double > &quantiles)
 
*static std::map< uInt64, AccumType > _valuesFromArray (vector< AccumType > &myArray, const std::set< uInt64 > &indices)
 The array can be changed by paritally sorting it up to the largest index. More...
 

Private Member Functions

void _throwIfDataProviderDefined () const
 

Private Attributes

vector< DataIterator > _data
 
std::map< uInt, WeightsIterator > _weights
 maps data to weights More...
 
std::map< uInt, MaskIterator > _masks
 maps data to masks More...
 
vector< Int64_counts
 
vector< uInt_dataStrides
 
std::map< uInt, uInt_maskStrides
 
std::map< uInt, Bool_isIncludeRanges
 
std::map< uInt, DataRanges_dataRanges
 
vector< AccumType > _sortedArray
 
std::set< StatisticsData::STATS_statsToCalculate
 
std::set< StatisticsData::STATS_unsupportedStats
 
StatsDataProvider< CASA_STATP > * _dataProvider
 

Detailed Description

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
class casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >

Base class of statistics algorithm class hierarchy.

The default implementation is such that statistics are only calculated when getStatistic() or getStatistics() is called. Until then, the iterators which point to the beginning of data sets, masks, etc. are held in memory. Thus, the caller must keep all data sets available for the statistics object until these methods are called, and of course, if the actual data values are changed between adding data and calculating statistics, the updated values are used when calculating statistics. Derived classes may override this behavior.

PRECISION CONSIDERATIONS Many statistics are computed via accumulators. This can lead to precision issues, especially for large datasets. For this reason, it is highly recommended that the data type one uses as the AccumType be of higher precision, if possible, than the data type pointed to by input iterator. So for example, if one has a data set of Float values (to which the InputIterator type points to), then one should use type Double for the AccumType. In this case, the Float data values will be converted to Doubles before they are accumulated.

METHODS OF PROVIDING DATA Data may be provided in one of two mutually exclusive ways. The first way is simpler, and that is to use the setData()/addData() methods. Calling setData() will clear any previous data that was added via these methods or via a data provider (see below). Calling addData() subsequently to setData() will add a data set to the set of data sets on which statistics will be calculated. In order for this to work correctly, the iterators which are passed into these methods must still be valid when statistics are calculated (although note that some derived classes allow certain statistics to be updated as data sets are added via these methods. See specific classes for details).

The second way to provide data is via a data provider. This takes the form of a derived class of StatsDataProvider, in which various methods are implemented for retrieving various information about the data sets. Such an interface is necessary for data which does not easily lend itself to be provided via the setData()/addData() methods. For example, in the case of iterating through a lattice, a lattice iterator will overwrite the memory location of the previous chunk of data with the current chunk of data. Therefore, if one does not wish to load data from the entire lattice into memory (which is why LatticeIterator was designed in this way), one must the LatticeStatsDataProvider class, which the statistics framework will use to iteratate through the lattice, only keeping one chunk of the data of the lattice in memory at one time.

QUANTILES A quantile is a value contained in a data set, such that, it has a zero-based index of ceil(q*n)-1 in the equivalent ordered dataset, where 0 < q < 1 specifies the fractional location within the ordered dataset and n is the total number of elements. Note that, for a dataset with an odd number of elements, the median is the same as the quantile value when q = 0.5. However, there is no such correspondance between the median in a dataset with an even number of elements, since the median in that case is given by the mean of the elements of zero-based indeces n/2-1 and n/2 in the equivalent ordered dataset. Thus, in the case of a dataset with an even number of values, the median may not even exist in the dataset, while a quantile value must exist in the dataset. Note when calculating quantile values, a dataset that does not fall in specified dataset ranges, is not included via a stride specification, is masked, or has a weight of zero is not considered a member of the dataset for the pruposes of quantile calculations.

Definition at line 105 of file StatisticsAlgorithm.h.

Constructor & Destructor Documentation

◆ ~StatisticsAlgorithm()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::~StatisticsAlgorithm ( )
virtual

◆ StatisticsAlgorithm()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::StatisticsAlgorithm ( )
protected

Member Function Documentation

◆ _addData()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_addData ( )
inlineprotectedvirtual

Allows derived classes to do things after data is set or added.

Default implementation does nothing.

Reimplemented in casacore::ClassicalStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >, and casacore::ClassicalStatistics< CASA_STATP >.

Definition at line 307 of file StatisticsAlgorithm.h.

◆ _getCounts()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const vector<Int64>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getCounts ( ) const
inlineprotected

Definition at line 309 of file StatisticsAlgorithm.h.

◆ _getData()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const vector<DataIterator>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getData ( ) const
inlineprotected

Definition at line 311 of file StatisticsAlgorithm.h.

◆ _getDataProvider()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
StatsDataProvider<CASA_STATP>* casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getDataProvider ( )
inlineprotected

Definition at line 313 of file StatisticsAlgorithm.h.

◆ _getDataStrides()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const vector<uInt>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getDataStrides ( ) const
inlineprotected

Definition at line 317 of file StatisticsAlgorithm.h.

◆ _getIsIncludeRanges()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const std::map<uInt, Bool>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getIsIncludeRanges ( ) const
inlineprotected

Definition at line 319 of file StatisticsAlgorithm.h.

◆ _getMasks()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const std::map<uInt, MaskIterator> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getMasks ( ) const
inlineprotected

Definition at line 321 of file StatisticsAlgorithm.h.

◆ _getMaskStrides()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const std::map<uInt, uInt>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getMaskStrides ( ) const
inlineprotected

Definition at line 323 of file StatisticsAlgorithm.h.

◆ _getRanges()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const std::map<uInt, DataRanges>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getRanges ( ) const
inlineprotected

Definition at line 325 of file StatisticsAlgorithm.h.

◆ _getSortedArray()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::vector<AccumType>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getSortedArray ( )
inlineprotected

Definition at line 335 of file StatisticsAlgorithm.h.

◆ _getStatistic()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual AccumType casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getStatistic ( StatisticsData::STATS  stat)
protectedpure virtual

◆ _getStatistics()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual StatsData<AccumType> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getStatistics ( )
protectedpure virtual

◆ _getStatsToCalculate()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const std::set<StatisticsData::STATS> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getStatsToCalculate ( ) const
inlineprotected

Definition at line 331 of file StatisticsAlgorithm.h.

◆ _getUnsupportedStatistics()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual const std::set<StatisticsData::STATS>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getUnsupportedStatistics ( ) const
inlineprotectedvirtual

Definition at line 337 of file StatisticsAlgorithm.h.

◆ _getWeights()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
const std::map<uInt, WeightsIterator>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_getWeights ( ) const
inlineprotected

Definition at line 341 of file StatisticsAlgorithm.h.

◆ _indicesFromQuantiles()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
static std::map<Double, uInt64> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_indicesFromQuantiles ( uInt64  npts,
const std::set< Double > &  quantiles 
)
staticprotected

◆ _setSortedArray()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_setSortedArray ( const vector< AccumType > &  v)
inlineprotected

Definition at line 359 of file StatisticsAlgorithm.h.

◆ _throwIfDataProviderDefined()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_throwIfDataProviderDefined ( ) const
private

◆ _valuesFromArray()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
* static std::map<uInt64, AccumType> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_valuesFromArray ( vector< AccumType > &  myArray,
const std::set< uInt64 > &  indices 
)
staticprotected

The array can be changed by paritally sorting it up to the largest index.

Return a map of index to value in the sorted array.

Referenced by casacore::StatisticsAlgorithm< CASA_STATP, DataIterator, const Bool *, DataIterator >::_getWeights().

◆ addData() [1/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

Add a dataset to an existing set of datasets on which statistics are to be calculated.

nr is the number of points to be considered. If dataStride is greater than 1, when nrAccountsForStride=True indicates that the stride has been taken into account in the value of nr. Otherwise, it has not so that the actual number of points to include is nr/dataStride if nr % dataStride == 0 or (int)(nr/dataStride) + 1 otherwise. If one calls this method after a data provider has been set, an exception will be thrown. In this case, one should call setData(), rather than addData(), to indicate that the underlying data provider should be removed. dataRanges provide the ranges of data to include if isInclude is True, or ranges of data to exclude if isInclude is False. If a datum equals the end point of a data range, it is considered good (included) if isInclude is True, and it is considered bad (excluded) if isInclude is False.

◆ addData() [2/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

◆ addData() [3/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
const MaskIterator &  maskFirst,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ addData() [4/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
const MaskIterator &  maskFirst,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ addData() [5/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

◆ addData() [6/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

◆ addData() [7/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
const MaskIterator &  maskFirst,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ addData() [8/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::addData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
const MaskIterator &  maskFirst,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ algorithm()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual StatisticsData::ALGORITHM casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::algorithm ( ) const
pure virtual

◆ deleteSortedArray()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::deleteSortedArray ( )

delete any (partially) sorted array

◆ getMedian()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual AccumType casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedian ( CountedPtr< uInt64 knownNpts = NULL,
CountedPtr< AccumType >  knownMin = NULL,
CountedPtr< AccumType >  knownMax = NULL,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt64  nBins = 10000 
)
pure virtual

◆ getMedianAbsDevMed()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual AccumType casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedianAbsDevMed ( CountedPtr< uInt64 knownNpts = NULL,
CountedPtr< AccumType >  knownMin = NULL,
CountedPtr< AccumType >  knownMax = NULL,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt64  nBins = 10000 
)
pure virtual

◆ getMedianAndQuantiles()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual AccumType casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getMedianAndQuantiles ( std::map< Double, AccumType > &  quantileToValue,
const std::set< Double > &  quantiles,
CountedPtr< uInt64 knownNpts = NULL,
CountedPtr< AccumType >  knownMin = NULL,
CountedPtr< AccumType >  knownMax = NULL,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt64  nBins = 10000 
)
pure virtual

◆ getQuantile()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
AccumType casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getQuantile ( Double  quantile,
CountedPtr< uInt64 knownNpts = NULL,
CountedPtr< AccumType >  knownMin = NULL,
CountedPtr< AccumType >  knownMax = NULL,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt64  nBins = 10000 
)

◆ getQuantiles()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual std::map<Double, AccumType> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getQuantiles ( const std::set< Double > &  quantiles,
CountedPtr< uInt64 npts = NULL,
CountedPtr< AccumType >  min = NULL,
CountedPtr< AccumType >  max = NULL,
uInt  binningThreshholdSizeBytes = 4096 *4096,
Bool  persistSortedArray = False,
uInt64  nBins = 10000 
)
pure virtual

◆ getStatistic()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual AccumType casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getStatistic ( StatisticsData::STATS  stat)
virtual

get the value of the specified statistic

◆ getStatisticIndex()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual std::pair<Int64, Int64> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getStatisticIndex ( StatisticsData::STATS  stat)
pure virtual

certain statistics such as max and min have locations in the dataset associated with them.

This method gets those locations. The first value in the returned pair is the zero-based dataset number that was set or added. The second value is the zero-based index in that dataset. A data stride of greater than one is not accounted for, so the index represents the actual location in the data set, independent of the dataStride value.

Implemented in casacore::ClassicalStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >, casacore::ClassicalStatistics< CASA_STATP >, casacore::ConstrainedRangeStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >, and casacore::ConstrainedRangeStatistics< CASA_STATP >.

◆ getStatistics()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual StatsData<AccumType> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::getStatistics ( )
virtual

◆ operator=()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
StatisticsAlgorithm<CASA_STATP>& casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::operator= ( const StatisticsAlgorithm< CASA_STATP > &  other)
protected

use copy semantics

◆ reset()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::reset ( )
virtual

◆ setData() [1/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

setdata() clears any current datasets or data provider and then adds the specified data set as the first dataset in the (possibly new) set of data sets for which statistics are to be calculated.

See addData() for parameter meanings.

◆ setData() [2/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

◆ setData() [3/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
const MaskIterator &  maskFirst,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ setData() [4/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
const MaskIterator &  maskFirst,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ setData() [5/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

◆ setData() [6/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False 
)
virtual

◆ setData() [7/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
const MaskIterator &  maskFirst,
uInt  nr,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ setData() [8/8]

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setData ( const DataIterator &  first,
const WeightsIterator &  weightFirst,
const MaskIterator &  maskFirst,
uInt  nr,
const DataRanges dataRanges,
Bool  isInclude = True,
uInt  dataStride = 1,
Bool  nrAccountsForStride = False,
uInt  maskStride = 1 
)
virtual

◆ setDataProvider()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setDataProvider ( StatsDataProvider< CASA_STATP > *  dataProvider)
virtual

instead of settng and adding data "by hand", set the data provider that will provide all the data sets.

Calling this method will clear any other data sets that have previously been set or added.

◆ setStatsToCalculate()

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
virtual void casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::setStatsToCalculate ( std::set< StatisticsData::STATS > &  stats)
virtual

Provide guidance to algorithms by specifying a priori which statistics the caller would like calculated.

Reimplemented in casacore::ClassicalStatistics< AccumType, DataIterator, MaskIterator, WeightsIterator >, and casacore::ClassicalStatistics< CASA_STATP >.

Member Data Documentation

◆ _counts

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
vector<Int64> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_counts
private

◆ _data

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
vector<DataIterator> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_data
private

◆ _dataProvider

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
StatsDataProvider<CASA_STATP>* casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_dataProvider
private

◆ _dataRanges

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::map<uInt, DataRanges> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_dataRanges
private

◆ _dataStrides

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
vector<uInt> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_dataStrides
private

◆ _isIncludeRanges

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::map<uInt, Bool> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_isIncludeRanges
private

◆ _masks

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::map<uInt, MaskIterator> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_masks
private

◆ _maskStrides

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::map<uInt, uInt> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_maskStrides
private

◆ _sortedArray

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
vector<AccumType> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_sortedArray
private

◆ _statsToCalculate

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::set<StatisticsData::STATS> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_statsToCalculate
private

◆ _unsupportedStats

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::set<StatisticsData::STATS> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_unsupportedStats
private

◆ _weights

template<class AccumType, class DataIterator, class MaskIterator = const Bool *, class WeightsIterator = DataIterator>
std::map<uInt, WeightsIterator> casacore::StatisticsAlgorithm< AccumType, DataIterator, MaskIterator, WeightsIterator >::_weights
private

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