26 #ifndef SCIMATH_CONSTRAINEDRANGEQUANTILECOMPUTER_H
27 #define SCIMATH_CONSTRAINEDRANGEQUANTILECOMPUTER_H
29 #include <casacore/scimath/StatsFramework/ClassicalQuantileComputer.h>
31 #include <casacore/casa/aips.h>
42 class AccumType,
class DataIterator,
class MaskIterator=
const Bool*,
43 class WeightsIterator=DataIterator
71 uInt64 mynpts, AccumType mymin, AccumType mymax,
72 uInt binningThreshholdSizeBytes,
Bool persistSortedArray,
uInt nBins
77 uInt64 mynpts, AccumType mymin, AccumType mymax,
78 uInt binningThreshholdSizeBytes,
Bool persistSortedArray,
uInt nBins
81 void setRange(
const std::pair<AccumType, AccumType>& r) {
89 std::vector<BinCountArray>& binCounts,
91 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
93 const std::vector<AccumType>& maxLimit
97 std::vector<BinCountArray>& binCounts,
99 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
102 const std::vector<AccumType>& maxLimit
106 std::vector<BinCountArray>& binCounts,
108 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
109 const MaskIterator& maskBegin,
uInt maskStride,
111 const std::vector<AccumType>& maxLimit
115 std::vector<BinCountArray>& binCounts,
117 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
118 const MaskIterator& maskBegin,
uInt maskStride,
121 const std::vector<AccumType>& maxLimit
125 std::vector<BinCountArray>& binCounts,
127 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
130 const std::vector<AccumType>& maxLimit
134 std::vector<BinCountArray>& binCounts,
136 const DataIterator& dataBegin,
137 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
140 const std::vector<AccumType>& maxLimit
144 std::vector<BinCountArray>& binCounts,
146 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
147 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
150 const std::vector<AccumType>& maxLimit
154 std::vector<BinCountArray>& binCounts,
156 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
157 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
159 const std::vector<AccumType>& maxLimit
186 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride
192 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
198 DataArray& ary,
const DataIterator& dataBegin,
199 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride
204 DataArray& ary,
const DataIterator& dataBegin,
205 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
211 DataArray& ary,
const DataIterator& dataBegin,
212 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
213 const MaskIterator& maskBegin,
uInt maskStride
218 DataArray& ary,
const DataIterator& dataBegin,
219 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
220 const MaskIterator& maskBegin,
uInt maskStride,
226 std::vector<DataArray>& arys,
uInt64& currentCount,
227 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
233 std::vector<DataArray>& arys,
uInt64& currentCount,
234 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
240 std::vector<DataArray>& arys,
uInt64& currentCount,
241 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
242 const MaskIterator& maskBegin,
uInt maskStride,
248 std::vector<DataArray>& arys,
uInt64& currentCount,
249 const DataIterator& dataBegin,
uInt64 nr,
uInt dataStride,
250 const MaskIterator& maskBegin,
uInt maskStride,
257 std::vector<DataArray>& arys,
uInt64& currentCount,
258 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
265 std::vector<DataArray>& arys,
uInt64& currentCount,
266 const DataIterator& dataBegin,
const WeightsIterator& weightsBegin,
273 std::vector<DataArray>& arys,
uInt64& currentCount,
274 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
275 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
281 std::vector<DataArray>& arys,
uInt64& currentCount,
282 const DataIterator& dataBegin,
const WeightsIterator& weightBegin,
283 uInt64 nr,
uInt dataStride,
const MaskIterator& maskBegin,
306 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
313 uInt dataStride,
const MaskIterator& maskBegin,
uInt maskStride,
319 DataArray& ary,
const DataIterator& dataBegin,
320 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
326 DataArray& ary,
const DataIterator& dataBegin,
327 const WeightsIterator& weightsBegin,
uInt64 nr,
uInt dataStride,
333 DataArray& ary,
const DataIterator& dataBegin,
334 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
335 const MaskIterator& maskBegin,
uInt maskStride,
uInt maxElements
340 DataArray& ary,
const DataIterator& dataBegin,
341 const WeightsIterator& weightBegin,
uInt64 nr,
uInt dataStride,
342 const MaskIterator& maskBegin,
uInt maskStride,
352 std::pair<AccumType, AccumType>
_range{};
358 #ifndef CASACORE_NO_AUTO_TEMPLATES
359 #include <casacore/scimath/StatsFramework/ConstrainedRangeQuantileComputer.tcc>
#define DataArray
Commonly used types in statistics framework.
This class is used internally by ClassicalStatistics objects.
Basic concrete QuantileComputer class for data constrained to be in a specified range.
ConstrainedRangeQuantileComputer()=delete
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude, const IncludeLimits &includeLimits, uInt64 maxCount) const
weights and ranges
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, uInt maxElements) const
weights
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const IncludeLimits &includeLimits, uInt64 maxCount) const
no weights, no mask, no ranges
AccumType _myMedian
for use in macros of often repeatedly run methods
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const IncludeLimits &includeLimits, uInt64 maxCount) const
weights and mask
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const IncludeLimits &includeLimits, uInt64 maxCount) const
weights
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const std::vector< StatsHistogram< AccumType > > &binDesc, const std::vector< AccumType > &maxLimit) const
virtual AccumType getMedianAbsDevMed(uInt64 mynpts, AccumType mymin, AccumType mymax, uInt binningThreshholdSizeBytes, Bool persistSortedArray, uInt nBins)
get the median of the absolute deviation about the median of the data.
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
mask and ranges
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const std::vector< StatsHistogram< AccumType >> &binDesc, const std::vector< AccumType > &maxLimit) const
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude, uInt maxElements) const
ranges
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, uInt maxElements) const
no weights, no mask, no ranges
virtual ~ConstrainedRangeQuantileComputer()
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
ranges
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, uInt maxElements) const
weights and mask
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude, uInt maxElements) const
mask and ranges
std::pair< AccumType, AccumType > _range
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude, const IncludeLimits &includeLimits, uInt64 maxCount) const
weights, mask, ranges
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude, const std::vector< StatsHistogram< AccumType >> &binDesc, const std::vector< AccumType > &maxLimit) const
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude) const
weights and ranges
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude) const
weights, mask, ranges
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude, const IncludeLimits &includeLimits, uInt64 maxCount) const
mask and ranges
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
weights and mask
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride) const
weights
ConstrainedRangeQuantileComputer & operator=(const ConstrainedRangeQuantileComputer &other)
copy semantics
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude, const std::vector< StatsHistogram< AccumType >> &binDesc, const std::vector< AccumType > &maxLimit) const
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, uInt maxElements) const
mask
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride) const
populate an unsorted array with valid data.
ConstrainedRangeQuantileComputer(const ConstrainedRangeQuantileComputer &csq)
copy semantics
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude, const std::vector< StatsHistogram< AccumType >> &binDesc, const std::vector< AccumType > &maxLimit) const
ConstrainedRangeQuantileComputer(StatisticsDataset< CASA_STATP > *dataset)
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude, const std::vector< StatsHistogram< AccumType > > &binDesc, const std::vector< AccumType > &maxLimit) const
virtual AccumType getMedian(uInt64 mynpts, AccumType mymin, AccumType mymax, uInt binningThreshholdSizeBytes, Bool persistSortedArray, uInt nBins)
Caller is responsible for passing correct values of mynpts, mymin, and mymax; no checking is done for...
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const std::vector< StatsHistogram< AccumType > > &binDesc, const std::vector< AccumType > &maxLimit) const
void setRange(const std::pair< AccumType, AccumType > &r)
virtual StatisticsAlgorithmQuantileComputer< CASA_STATP > * clone() const
clone this object by returning a pointer to a copy
virtual void _findBins(std::vector< BinCountArray > &binCounts, std::vector< CountedPtr< AccumType >> &sameVal, std::vector< Bool > &allSame, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const std::vector< StatsHistogram< AccumType >> &binDesc, const std::vector< AccumType > &maxLimit) const
virtual void _populateArray(DataArray &ary, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride) const
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const IncludeLimits &includeLimits, uInt64 maxCount) const
virtual void _populateArrays(std::vector< DataArray > &arys, uInt64 ¤tCount, const DataIterator &dataBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude, const IncludeLimits &includeLimits, uInt64 maxCount) const
ranges
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightsBegin, uInt64 nr, uInt dataStride, const DataRanges &ranges, Bool isInclude, uInt maxElements) const
weights and ranges
virtual Bool _populateTestArray(DataArray &ary, const DataIterator &dataBegin, const WeightsIterator &weightBegin, uInt64 nr, uInt dataStride, const MaskIterator &maskBegin, uInt maskStride, const DataRanges &ranges, Bool isInclude, uInt maxElements) const
weights, mask, ranges
Represents an unfilled histogram with equal width bins for binning used for quantile computations.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
unsigned long long uInt64