Go to the documentation of this file.
28 #ifndef CASA_MASKARRMATH_H
29 #define CASA_MASKARRMATH_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/BasicMath/Math.h>
34 #include <casacore/casa/Arrays/Array.h>
35 #include <casacore/casa/Arrays/MaskedArray.h>
36 #include <casacore/casa/Arrays/IPosition.h>
38 #include <casacore/casa/BasicSL/Complex.h>
441 {
return madfm (a, sorted, (a.
nelements() <= 100)); }
527 template <
typename T,
typename FuncType>
530 const FuncType& funcObj);
556 template <
typename T,
typename FuncType>
559 const FuncType& funcObj,
565 #ifndef CASACORE_NO_AUTO_TEMPLATES
566 #include <casacore/casa/Arrays/MaskArrMath.tcc>
567 #endif //# CASACORE_NO_AUTO_TEMPLATES
T operator()(const MaskedArray< T > &arr) const
uInt nelements() const
The number of elements of this masked array.
LatticeExprNode acos(const LatticeExprNode &expr)
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.
LatticeExprNode stddev(const LatticeExprNode &expr)
MaskedArray< T > sin(const MaskedArray< T > &left)
Transcendental function applied to the array on an element-by-element basis.
A Vector of integers, for indexing into Array<T> objects.
LatticeExprNode operator+(const LatticeExprNode &expr)
Global functions operating on a LatticeExprNode.
T max(const MaskedArray< T > &left)
The maximum element of the array.
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > cosh(const MaskedArray< T > &left)
void indgen(MaskedArray< T > &a, T start, T inc)
Fills all elements of "array" where the mask is True with a sequence starting with "start" and increm...
LatticeExprNode variance(const LatticeExprNode &expr)
T madfm(const MaskedArray< T > &a, Bool sorted=False)
The median absolute deviation from the median.
MaskedArray< T > atan(const MaskedArray< T > &left)
LatticeExprNode log(const LatticeExprNode &expr)
MaskedArray< T > asin(const MaskedArray< T > &left)
MaskedArray< T > fabs(const MaskedArray< T > &left)
LatticeExprNode real(const LatticeExprNode &expr)
LatticeExprNode log10(const LatticeExprNode &expr)
T sum(const MaskedArray< T > &a)
const MaskedArray< T > & operator-=(const MaskedArray< T > &left, const Array< T > &other)
LatticeExprNode fmod(const LatticeExprNode &left, const LatticeExprNode &right)
T operator()(const MaskedArray< T > &arr) const
LatticeExprNode abs(const LatticeExprNode &expr)
Numerical 1-argument functions which result in a real number regardless of input expression type.
MaskedArray< T > cos(const MaskedArray< T > &left)
MaskedArray< T > tan(const MaskedArray< T > &left)
MaskedArray< T > log10(const MaskedArray< T > &left)
T rms(const MaskedArray< T > &a)
The root-mean-square of "a" is the sqrt of sum(a*a)/N.
MaskedArray< T > operator+(const MaskedArray< T > &a)
Unary arithmetic operation.
MaskedArray< T > ceil(const MaskedArray< T > &left)
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
const MaskedArray< T > & operator+=(const MaskedArray< T > &left, const Array< T > &other)
Element by element arithmetic modifying left in-place.
LatticeExprNode atan(const LatticeExprNode &expr)
MaskedArray< T > operator/(const MaskedArray< T > &left, const Array< T > &right)
MaskedMadfmFunc(Bool sorted=False, Bool takeEvenMean=True)
LatticeExprNode sqrt(const LatticeExprNode &expr)
LatticeExprNode mean(const LatticeExprNode &expr)
TableExprNode square(const TableExprNode &node)
LatticeExprNode tan(const LatticeExprNode &expr)
T pstddev(const MaskedArray< T > &a, uInt ddof=0)
T operator()(const MaskedArray< T > &arr) const
T avdev(const MaskedArray< T > &a)
The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.
T product(const TableVector< T > &tv)
void minMax(T &minVal, T &maxVal, IPosition &minPos, IPosition &maxPos, const MaskedArray< T > &marray)
Find the minimum and maximum values of a MaskedArray.
LatticeExprNode cos(const LatticeExprNode &expr)
MaskedArray< T > floor(const MaskedArray< T > &left)
MaskedArray< T > sqrt(const MaskedArray< T > &left)
MaskedArray< T > imag(const MaskedArray< std::complex< T >> &carray)
Extracts the imaginary part of a complex array into an array of floats.
MaskedArray< T > operator-(const MaskedArray< T > &a)
MaskedArray< T > acos(const MaskedArray< T > &left)
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > cube(const MaskedArray< T > &val)
Returns a MaskedArray where every element is cubed.
Mathematical operations for MaskedArrays (and with Arrays)
void indgen(TableVector< T > &tv, Int start, Int inc)
LatticeExprNode cosh(const LatticeExprNode &expr)
LatticeExprNode max(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode atan2(const LatticeExprNode &left, const LatticeExprNode &right)
Numerical 2-argument functions.
MaskedArray< T > atan2(const MaskedArray< T > &left, const Array< T > &right)
Transcendental functions requiring two arguments applied on an element-by-element basis.
MaskedArray< T > square(const MaskedArray< T > &val)
Returns a MaskedArray where every element is squared.
LatticeExprNode sin(const LatticeExprNode &expr)
Numerical 1-argument functions.
T operator()(const MaskedArray< T > &arr) const
TableExprNode cube(const TableExprNode &node)
T sumsquares(const MaskedArray< T > &a)
Sum of the squares of every element of the MaskedArray where the Mask is True.
LatticeExprNode operator/(const LatticeExprNode &left, const LatticeExprNode &right)
LatticeExprNode ceil(const LatticeExprNode &expr)
T operator()(const MaskedArray< T > &arr) const
LatticeExprNode min(const LatticeExprNode &left, const LatticeExprNode &right)
T mean(const MaskedArray< T > &a)
The mean of "a" is the sum of all elements of "a" divided by the number of elements of "a".
T operator()(const MaskedArray< T > &arr) const
LatticeExprNode asin(const LatticeExprNode &expr)
this file contains all the compiler specific defines
T variance(const MaskedArray< T > &a)
The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - ddof).
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
LatticeExprNode median(const LatticeExprNode &expr)
LatticeExprNode imag(const LatticeExprNode &expr)
T pvariance(const MaskedArray< T > &a, uInt ddof=0)
MaskedArray< T > pow(const MaskedArray< T > &left, const Array< U > &right)
Class for masking an Array for operations on that Array.
MaskedArray< T > log(const MaskedArray< T > &left)
const MaskedArray< T > & operator/=(const MaskedArray< T > &left, const Array< T > &other)
const MaskedArray< T > & operator*=(const MaskedArray< T > &left, const Array< T > &other)
MaskedArray< T > real(const MaskedArray< std::complex< T >> &carray)
Extracts the real part of a complex array into an array of floats.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
T stddev(const MaskedArray< T > &a)
The standard deviation of "a" is the square root of its variance.
MaskedArray< T > operator*(const MaskedArray< T > &left, const Array< T > &right)
T median(const MaskedArray< T > &a, Bool sorted=False)
The median of "a" is a(n/2).
template <class T, class U> class vector;
LatticeExprNode tanh(const LatticeExprNode &expr)
LatticeExprNode sum(const LatticeExprNode &expr)
MaskedArray< T > tanh(const MaskedArray< T > &left)
void minMax(T &min, T &max, const TableVector< T > &tv)
LatticeExprNode floor(const LatticeExprNode &expr)
bool Bool
Define the standard types used by Casacore.
MaskedArray< T > exp(const MaskedArray< T > &left)
T min(const MaskedArray< T > &left)
The "min" and "max" functions require that the type "T" have comparison operators.
TableExprNode rms(const TableExprNode &array)
MaskedArray< T > fmod(const MaskedArray< T > &left, const Array< T > &right)
LatticeExprNode avdev(const LatticeExprNode &expr)
MVBaseline operator*(const RotMatrix &left, const MVBaseline &right)
Rotate a Baseline vector with rotation matrix and other multiplications.
T operator()(const MaskedArray< T > &arr) const
MaskedArray< T > abs(const MaskedArray< T > &left)
Float operator()(const MaskedArray< Float > &arr) const
LatticeExprNode sinh(const LatticeExprNode &expr)
MaskedArray< T > sinh(const MaskedArray< T > &left)
LatticeExprNode operator-(const LatticeExprNode &expr)
LatticeExprNode exp(const LatticeExprNode &expr)
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...
T product(const MaskedArray< T > &a)
Product of every element of the MaskedArray where the Mask is True.