26 #ifndef SCIMATH_STATISTICSALGORITHM_H
27 #define SCIMATH_STATISTICSALGORITHM_H
134 class AccumType,
class DataIterator,
class MaskIterator=
const Bool *,
135 class WeightsIterator=DataIterator
169 const DataIterator& first,
uInt nr,
175 const DataIterator& first,
const MaskIterator& maskFirst,
181 const DataIterator& first,
const MaskIterator& maskFirst,
187 const DataIterator& first,
const WeightsIterator& weightFirst,
192 const DataIterator& first,
const WeightsIterator& weightFirst,
198 const DataIterator& first,
const WeightsIterator& weightFirst,
199 const MaskIterator& maskFirst,
uInt nr,
uInt dataStride=1,
204 const DataIterator& first,
const WeightsIterator& weightFirst,
205 const MaskIterator& maskFirst,
uInt nr,
const DataRanges& dataRanges,
218 uInt binningThreshholdSizeBytes=4096*4096,
225 std::map<Double, AccumType>& quantileToValue,
226 const std::set<Double>& quantiles,
230 uInt binningThreshholdSizeBytes=4096*4096,
239 uInt binningThreshholdSizeBytes=4096*4096,
248 uInt binningThreshholdSizeBytes=4096*4096,
256 uInt binningThreshholdSizeBytes=4096*4096,
277 virtual void reset();
286 const DataIterator& first,
uInt nr,
uInt dataStride=1,
296 const DataIterator& first,
const MaskIterator& maskFirst,
uInt nr,
301 const DataIterator& first,
const MaskIterator& maskFirst,
307 const DataIterator& first,
const WeightsIterator& weightFirst,
uInt nr,
312 const DataIterator& first,
const WeightsIterator& weightFirst,
uInt nr,
318 const DataIterator& first,
const WeightsIterator& weightFirst,
319 const MaskIterator& maskFirst,
uInt nr,
uInt dataStride=1,
324 const DataIterator& first,
const WeightsIterator& weightFirst,
325 const MaskIterator& maskFirst,
uInt nr,
const DataRanges& dataRanges,
375 virtual const std::set<StatisticsData::STATS>&
383 const std::set<StatisticsData::STATS>& stats
399 #ifndef CASACORE_NO_AUTO_TEMPLATES
400 #include <casacore/scimath/StatsFramework/StatisticsAlgorithm.tcc>
virtual void setStatsToCalculate(std::set< StatisticsData::STATS > &stats)
Provide guidance to algorithms by specifying a priori which statistics the caller would like calculat...
virtual AccumType getMedianAbsDevMed(CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)=0
get the median of the absolute deviation about the median of the data.
virtual const std::set< StatisticsData::STATS > & _getUnsupportedStatistics() const
virtual void _addData()
Allows derived classes to do things after data is set or added.
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 fi...
virtual StatsData< AccumType > _getStatistics()=0
StatisticsDataset< CASA_STATP > _dataset
void _setUnsupportedStatistics(const std::set< StatisticsData::STATS > &stats)
Derived classes should normally call this in their constructors, if applicable.
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
virtual LocationType getStatisticIndex(StatisticsData::STATS stat)=0
certain statistics such as max and min have locations in the dataset associated with them...
virtual AccumType getMedian(CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)=0
virtual ~StatisticsAlgorithm()
virtual AccumType _getStatistic(StatisticsData::STATS stat)=0
AccumType getQuantile(Double quantile, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)
Purposefully not virtual.
ALGORITHM
implemented algorithms
StatisticsDataset< CASA_STATP > & _getDataset()
Referenced counted pointer for constant data.
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
virtual void setDataProvider(StatsDataProvider< CASA_STATP > *dataProvider)
instead of setting and adding data "by hand", set the data provider that will provide all the data se...
StatisticsAlgorithm & operator=(const StatisticsAlgorithm &other)
use copy semantics, except for the data provider which uses reference semantics
std::pair< Int64, Int64 > LocationType
virtual AccumType getMedianAndQuantiles(std::map< Double, AccumType > &quantileToValue, const std::set< Double > &quantiles, CountedPtr< uInt64 > knownNpts=nullptr, CountedPtr< AccumType > knownMin=nullptr, CountedPtr< AccumType > knownMax=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)=0
The return value is the median; the quantiles are returned in the quantileToValue map...
virtual StatisticsAlgorithm< CASA_STATP > * clone() const =0
Clone this instance.
const StatisticsDataset< CASA_STATP > & _getDataset() const
These methods are purposefully not virtual.
virtual StatisticsData::ALGORITHM algorithm() const =0
get the algorithm that this object uses for computing stats
bool Bool
Define the standard types used by Casacore.
void _resetExceptDataset()
const std::set< StatisticsData::STATS > _getStatsToCalculate() const
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.
StatsData< AccumType > getStatistics()
Return statistics.
std::set< StatisticsData::STATS > _statsToCalculate
std::set< StatisticsData::STATS > _unsupportedStats
AccumType getStatistic(StatisticsData::STATS stat)
get the value of the specified statistic.
virtual std::map< Double, AccumType > getQuantiles(const std::set< Double > &quantiles, CountedPtr< uInt64 > npts=nullptr, CountedPtr< AccumType > min=nullptr, CountedPtr< AccumType > max=nullptr, uInt binningThreshholdSizeBytes=4096 *4096, Bool persistSortedArray=False, uInt nBins=10000)=0
get a map of quantiles to values.
virtual void reset()
reset this object by clearing data.
Base class of statistics algorithm class hierarchy.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.