28 #ifndef CASA_ARRAYPARTMATH_2_H
29 #define CASA_ARRAYPARTMATH_2_H
120 template<
typename T,
typename Alloc>
122 const IPosition& collapseAxes,
size_t ddof=1)
124 return partialVariances (array, collapseAxes,
125 partialMeans (array, collapseAxes), ddof);
139 return sqrt (partialVariances (array, collapseAxes,
140 partialMeans (array, collapseAxes), ddof));
147 return sqrt (partialVariances (array, collapseAxes, means, ddof));
152 return partialAvdevs (array, collapseAxes,
153 partialMeans (array, collapseAxes));
162 bool takeEvenMean=
false,
166 bool takeEvenMean=
false,
179 {
return partialInterFractileRanges (array, collapseAxes, 1./6., inPlace); }
183 {
return partialInterFractileRanges (array, collapseAxes, 0.25, inPlace); }
199 virtual T operator() (
const Array<T, Alloc>& arr)
const final override {
return sumsqr(arr); }
226 virtual T operator() (
const Array<T, Alloc>& arr)
const final override {
return pvariance(arr, itsDdof); }
235 virtual T operator() (
const Array<T, Alloc>& arr)
const final override {
return pstddev(arr, itsDdof); }
251 explicit MedianFunc (
bool sorted=
false,
bool takeEvenMean=
true,
252 bool inPlace =
false)
253 : itsSorted(sorted), itsTakeEvenMean(takeEvenMean), itsInPlace(inPlace) {}
256 {
return median(arr, itsTmp, itsSorted, itsTakeEvenMean, itsInPlace); }
265 explicit MadfmFunc(
bool sorted =
false,
bool takeEvenMean =
true,
266 bool inPlace =
false)
267 : itsSorted(sorted), itsTakeEvenMean(takeEvenMean), itsInPlace(inPlace) {}
270 {
return madfm(arr, itsTmp, itsSorted, itsTakeEvenMean, itsInPlace); }
280 bool sorted =
false,
bool inPlace =
false)
281 : itsFraction(fraction), itsSorted(sorted), itsInPlace(inPlace) {}
284 {
return fractile(arr, itsTmp, itsFraction, itsSorted, itsInPlace); }
294 bool sorted =
false,
bool inPlace =
false)
295 : itsFraction(fraction), itsSorted(sorted), itsInPlace(inPlace) {}
298 {
return interFractileRange(arr, itsTmp, itsFraction,
299 itsSorted, itsInPlace); }
325 template<
typename T,
typename Alloc=std::allocator<T>>
331 partialArrayMath (res, a, collapseAxes, funcObj);
334 template<
typename T,
typename Alloc,
typename RES,
typename RESAlloc>
353 template<
typename T,
typename Alloc>
362 template<
typename T,
typename Alloc,
typename RES,
typename RESAlloc>
392 template<
typename T,
typename Alloc=std::allocator<T>>
402 template<
typename T,
typename Alloc,
typename RES,
typename RESAlloc>
424 #include "ArrayPartMath.tcc"
MadfmFunc(bool sorted=false, bool takeEvenMean=true, bool inPlace=false)
A Vector of integers, for indexing into Array<T> objects.
InterHexileRangeFunc(bool sorted=false, bool inPlace=false)
virtual ~InterFractileRangeFunc()
Define functors to perform a reduction function on an Array object.
TableExprNode means(const TableExprNode &array, const TableExprNodeSet &collapseAxes)
LatticeExprNode median(const LatticeExprNode &expr)
T product(const TableVector< T > &tv)
InterQuartileRangeFunc(bool sorted=false, bool inPlace=false)
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
LatticeExprNode sum(const LatticeExprNode &expr)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
virtual ~InterHexileRangeFunc()
bool fillSlidingShape(const IPosition &shape, const IPosition &halfBoxSize, IPosition &boxEnd, IPosition &resultShape)
Determine the box end and shape of result for a sliding operation.
LatticeExprNode fractile(const LatticeExprNode &expr, const LatticeExprNode &fraction)
Determine the value of the element at the part fraction from the beginning of the given lattice...
Array< T, Alloc > partialInterQuartileRanges(const Array< T, Alloc > &array, const IPosition &collapseAxes, bool inPlace=false)
InterFractileRangeFunc(float fraction, bool sorted=false, bool inPlace=false)
VarianceFunc(size_t ddof)
void fillBoxedShape(const IPosition &shape, const IPosition &boxShape, IPosition &fullBoxShape, IPosition &resultShape)
Helper functions for boxed and sliding functions.
Array< T > slidingArrayMath(const MaskedArray< T > &array, const IPosition &halfBoxSize, const FuncType &funcObj, bool fillEdge=true)
Apply for each element in the array the given ArrayMath reduction function object to the box around t...
Array< T, Alloc > partialStddevs(const Array< T, Alloc > &array, const IPosition &collapseAxes, const Array< T, Alloc > &means, size_t ddof=1)
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode avdev(const LatticeExprNode &expr)
Array< T, Alloc > partialVariances(const Array< T, Alloc > &array, const IPosition &collapseAxes, size_t ddof=1)
virtual T operator()(const Array< T, Alloc > &arr) const finaloverride
Array< T, Alloc > partialArrayMath(const Array< T, Alloc > &a, const IPosition &collapseAxes, const ArrayFunctorBase< T > &funcObj)
Do partial reduction of an Array object.
virtual ~InterQuartileRangeFunc()
LatticeExprNode sqrt(const LatticeExprNode &expr)
Basic class for math on Array objects.
MaskedArray< T > boxedArrayMath(const MaskedArray< T > &array, const IPosition &boxSize, const FuncType &funcObj)
Apply the given ArrayMath reduction function objects to each box in the array.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape...
A templated N-D Array class with zero origin. Array<T, Alloc> is a templated, N-dimensional, Array class. The origin is zero, but by default indices are zero-based. This Array class is the base class for the Vector, Matrix, and Cube subclasses.
Array< T, Alloc > partialAvdevs(const Array< T, Alloc > &array, const IPosition &collapseAxes)
Array< T, Alloc > slidingArrayMath(const Array< T, Alloc > &a, const IPosition &halfBoxSize, const ArrayFunctorBase< T > &funcObj, bool fillEdge=true)
Apply for each element in the array the given ArrayMath reduction function object to the box around t...
Array< T, Alloc > partialStddevs(const Array< T, Alloc > &array, const IPosition &collapseAxes, size_t ddof=1)
Array< T, Alloc > boxedArrayMath(const Array< T, Alloc > &a, const IPosition &boxSize, const ArrayFunctorBase< T > &funcObj)
Apply the given ArrayMath reduction function objects to each box in the array.
LatticeExprNode mean(const LatticeExprNode &expr)
TableExprNode rms(const TableExprNode &array)
Array< T, Alloc > partialInterHexileRanges(const Array< T, Alloc > &array, const IPosition &collapseAxes, bool inPlace=false)
FractileFunc(float fraction, bool sorted=false, bool inPlace=false)
virtual T operator()(const Array< T, Alloc > &arr) const finaloverride