26 #ifndef SCIMATH_STATISTICSUTILITIES_H
27 #define SCIMATH_STATISTICSUTILITIES_H
69 Double& npts, AccumType&
sum, AccumType&
mean,
const AccumType& datum
78 Double& npts, AccumType& sumweights, AccumType& wsum, AccumType& wmean,
79 const AccumType& datum,
const AccumType& weight
83 Double& npts, AccumType&
sum, AccumType&
mean, AccumType& nvariance,
84 AccumType& sumsq,
const AccumType& datum
89 Double& npts, AccumType& sumweights, AccumType& wsum, AccumType& wmean,
90 AccumType& wnvariance, AccumType& wsumsq,
const AccumType& datum,
91 const AccumType& weight
98 template <
class LocationType>
inline static void accumulate (
99 Double& npts, AccumType&
sum, AccumType&
mean, AccumType& nvariance,
100 AccumType& sumsq, AccumType& datamin, AccumType& datamax,
105 template <
class LocationType,
class DataType>
107 Double& npts, AccumType&
sum, AccumType&
mean, AccumType& nvariance,
108 AccumType& sumsq, DataType& datamin, DataType& datamax,
113 template <
class LocationType>
115 Double& npts, AccumType& sumofweights, AccumType&
sum, AccumType&
mean,
116 AccumType& nvariance, AccumType& sumsq, AccumType& datamin,
118 const AccumType& datum,
const AccumType& weight,
125 template <
class LocationType>
131 template <
class LocationType>
144 Double& npts, AccumType& nvariance, AccumType& sumsq,
145 const AccumType& datum,
const AccumType& center
150 Double& npts, AccumType& sumweights, AccumType& wnvariance,
151 AccumType& wsumsq,
const AccumType& datum,
const AccumType& weight,
152 const AccumType& center
157 template <
class LocationType>
inline static void accumulateSym (
158 Double& npts, AccumType& nvariance, AccumType& sumsq,
159 AccumType& datamin, AccumType& datamax,
LocationType& minpos,
165 Double& npts, AccumType& sumofweights, AccumType& nvariance,
166 AccumType& sumsq, AccumType& datamin, AccumType& datamax,
169 const AccumType& center
180 const AccumType& datum,
typename DataRanges::const_iterator beginRange,
181 typename DataRanges::const_iterator endRange,
Bool isInclude
188 std::vector<AccumType>& myArray,
const std::set<uInt64>& indices
192 std::vector<BinCountArray>& bins,
194 std::vector<Bool>& allSame,
195 const PtrHolder<std::vector<BinCountArray>>& tBins,
210 template <
class DataIterator,
class MaskIterator,
class WeightsIterator>
219 const static AccumType
TWO;
225 #ifndef CASACORE_NO_AUTO_TEMPLATES
226 #include <casacore/scimath/StatsFramework/StatisticsUtilities.tcc>
227 #endif //# CASACORE_NO_AUTO_TEMPLATES
StatisticsUtilities()=delete
static void waccumulateSym(Double &npts, AccumType &sumweights, AccumType &wnvariance, AccumType &wsumsq, const AccumType &datum, const AccumType &weight, const AccumType ¢er)
wsumsq is the weighted sum of squares, sum(w_i*x_i*x_i)
LatticeExprNode median(const LatticeExprNode &expr)
static const AccumType TWO
LatticeExprNode sum(const LatticeExprNode &expr)
static void waccumulate(Double &npts, AccumType &sumweights, AccumType &wsum, AccumType &wmean, const AccumType &datum, const AccumType &weight)
in order to optimize performance, no checking is done for the weight == 0 case callers should ensure ...
PtrHolder(const PtrHolder< T > &other)
static void mergeResults(std::vector< BinCountArray > &bins, std::vector< CountedPtr< AccumType > > &sameVal, std::vector< Bool > &allSame, const PtrHolder< std::vector< BinCountArray >> &tBins, const PtrHolder< std::vector< CountedPtr< AccumType >>> &tSameVal, const PtrHolder< std::vector< Bool >> &tAllSame, uInt nThreadsMax)
#define DataArray
Commonly used types in statistics framework.
Hold and delete pointers not deleted by object destructors.
static Bool doMin(AccumType &datamin, LocationType &minpos, Bool isFirst, const AccumType &datum, const LocationType &location)
static StatsData< AccumType > combine(const std::vector< StatsData< AccumType >> &stats)
use two statistics sets to get the statistics set that would result in combining the two data sets us...
static std::map< uInt64, AccumType > indicesToValues(std::vector< AccumType > &myArray, const std::set< uInt64 > &indices)
The array can be changed by partially sorting it up to the largest index.
static uInt nThreadsMax(const StatsDataProvider< CASA_STATP > *const dataProvider)
static Bool includeDatum(const AccumType &datum, typename DataRanges::const_iterator beginRange, typename DataRanges::const_iterator endRange, Bool isInclude)
std::pair< Int64, Int64 > LocationType
static Bool doMax(AccumType &datamax, LocationType &maxpos, Bool isFirst, const AccumType &datum, const LocationType &location)
return True if the max or min was updated, False otherwise.
bool Bool
Define the standard types used by Casacore.
static void accumulateSym(Double &npts, AccumType &nvariance, AccumType &sumsq, const AccumType &datum, const AccumType ¢er)
These versions are for symmetric accumulation about a specified center point.
Various statistics related methods for the statistics framework.
static void accumulate(Double &npts, AccumType &sum, AccumType &mean, const AccumType &datum)
accumulate values.
#define CASA_STATD
because the template signature has become unwieldy
LatticeExprNode mean(const LatticeExprNode &expr)
static void convertToAbsDevMedArray(DataArray &myArray, AccumType median)
convert in place by taking the absolute value of the difference of the std::vector and the median ...