casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
casacore::ArrayMath_global_functions_Array_mathematical_operations Struct Reference

Mathematical operations for Arrays. More...

#include <ArrayMath.h>

Public Member Functions

template<typename _InputIterator1 , typename T , typename _OutputIterator , typename _BinaryOperation >
void myltransform (_InputIterator1 __first1, _InputIterator1 __last1, _OutputIterator __result, T left, _BinaryOperation __binary_op)
 The myxtransform functions are defined to avoid a bug in g++-4.3. More...
 
template<typename _InputIterator1 , typename T , typename _OutputIterator , typename _BinaryOperation >
void myrtransform (_InputIterator1 __first1, _InputIterator1 __last1, _OutputIterator __result, T right, _BinaryOperation __binary_op)
 sequence = sequence OP scalar More...
 
template<typename _InputIterator1 , typename T , typename _BinaryOperation >
void myiptransform (_InputIterator1 __first1, _InputIterator1 __last1, T right, _BinaryOperation __binary_op)
 sequence OP= scalar More...
 
template<typename L , typename AllocL , typename R , typename AllocR , typename RES , typename AllocRES , typename BinaryOperator >
void arrayContTransform (const Array< L, AllocL > &left, const Array< R, AllocR > &right, Array< RES, AllocRES > &result, BinaryOperator op)
 Functions to apply a binary or unary operator to arrays. More...
 
template<typename L , typename AllocL , typename R , typename RES , typename AllocRES , typename BinaryOperator >
void arrayContTransform (const Array< L, AllocL > &left, R right, Array< RES, AllocRES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename L , typename R , typename AllocR , typename RES , typename AllocRES , typename BinaryOperator >
void arrayContTransform (L left, const Array< R, AllocR > &right, Array< RES, AllocRES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename T , typename Alloc , typename RES , typename AllocRES , typename UnaryOperator >
void arrayContTransform (const Array< T, Alloc > &arr, Array< RES, AllocRES > &result, UnaryOperator op)
 Transform array to a result using the unary operator. More...
 
template<typename L , typename R , typename RES , typename BinaryOperator , typename AllocL , typename AllocR , typename AllocRES >
void arrayTransform (const Array< L, AllocL > &left, const Array< R, AllocR > &right, Array< RES, AllocRES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename L , typename R , typename RES , typename BinaryOperator , typename Alloc , typename AllocRES >
void arrayTransform (const Array< L, Alloc > &left, R right, Array< RES, AllocRES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename L , typename R , typename RES , typename BinaryOperator , typename Alloc , typename AllocRES >
void arrayTransform (L left, const Array< R, Alloc > &right, Array< RES, AllocRES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename T , typename RES , typename UnaryOperator , typename Alloc , typename AllocRES >
void arrayTransform (const Array< T, Alloc > &arr, Array< RES, AllocRES > &result, UnaryOperator op)
 Transform array to a result using the unary operator. More...
 
template<typename T , typename BinaryOperator , typename Alloc >
Array< T, Alloc > arrayTransformResult (const Array< T, Alloc > &left, const Array< T, Alloc > &right, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename T , typename BinaryOperator , typename Alloc >
Array< T, Alloc > arrayTransformResult (const Array< T, Alloc > &left, T right, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename T , typename BinaryOperator , typename Alloc >
Array< T, Alloc > arrayTransformResult (T left, const Array< T, Alloc > &right, BinaryOperator op)
 Transform left and right to a result using the binary operator. More...
 
template<typename T , typename UnaryOperator , typename Alloc >
Array< T, Alloc > arrayTransformResult (const Array< T, Alloc > &arr, UnaryOperator op)
 Transform array to a result using the unary operator. More...
 
template<typename L , typename R , typename BinaryOperator , typename AllocL , typename AllocR >
void arrayTransformInPlace (Array< L, AllocL > &left, const Array< R, AllocR > &right, BinaryOperator op)
 Transform left and right in place using the binary operator. More...
 
template<typename L , typename R , typename BinaryOperator , typename Alloc >
void arrayTransformInPlace (Array< L, Alloc > &left, R right, BinaryOperator op)
 Transform left and right in place using the binary operator. More...
 
template<typename T , typename UnaryOperator , typename Alloc >
void arrayTransformInPlace (Array< T, Alloc > &arr, UnaryOperator op)
 Transform the array in place using the unary operator. More...
 
template<typename T , typename Alloc >
void operator+= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 Element by element arithmetic modifying left in-place. More...
 
template<typename T , typename Alloc >
void operator-= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator*= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator/= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator%= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator&= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator|= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator^= (Array< T, Alloc > &left, const Array< T, Alloc > &other)
 
template<typename T , typename Alloc >
void operator+= (Array< T, Alloc > &left, const T &other)
 Element by element arithmetic modifying left in-place. More...
 
template<typename T , typename Alloc >
void operator-= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
void operator*= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
void operator/= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
void operator%= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
void operator&= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
void operator|= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
void operator^= (Array< T, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator+ (const Array< T, Alloc > &a)
 Unary arithmetic operation. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > operator- (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator~ (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator+ (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 Element by element arithmetic on two arrays, returning an array. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > operator- (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator* (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator/ (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator% (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator| (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator& (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator^ (const Array< T, Alloc > &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator+ (const Array< T, Alloc > &left, const T &right)
 Element by element arithmetic between an array and a scalar, returning an array. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > operator- (const Array< T, Alloc > &left, const T &right)
 
template<class T , typename Alloc >
Array< T, Alloc > operator* (const Array< T, Alloc > &left, const T &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator/ (const Array< T, Alloc > &left, const T &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator% (const Array< T, Alloc > &left, const T &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator| (const Array< T, Alloc > &left, const T &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator& (const Array< T, Alloc > &left, const T &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator^ (const Array< T, Alloc > &left, const T &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator+ (const T &left, const Array< T, Alloc > &right)
 Element by element arithmetic between a scalar and an array, returning an array. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > operator- (const T &left, const Array< T, Alloc > &right)
 
template<class T , typename Alloc >
Array< T, Alloc > operator* (const T &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator/ (const T &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator% (const T &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator| (const T &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator& (const T &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > operator^ (const T &left, const Array< T, Alloc > &right)
 
template<typename T , typename Alloc >
Array< T, Alloc > cos (const Array< T, Alloc > &a)
 Transcendental function that can be applied to essentially all numeric types. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > cosh (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > exp (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > log (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > log10 (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > pow (const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > pow (const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > sin (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > sinh (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > sqrt (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > acos (const Array< T, Alloc > &a)
 Transcendental function applied to the array on an element-by-element basis. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > asin (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > atan (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > atan2 (const Array< T, Alloc > &y, const Array< T, Alloc > &x)
 
template<typename T , typename Alloc >
Array< T, Alloc > atan2 (const T &y, const Array< T, Alloc > &x)
 
template<typename T , typename Alloc >
Array< T, Alloc > atan2 (const Array< T, Alloc > &y, const T &x)
 
template<typename T , typename Alloc >
Array< T, Alloc > ceil (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > fabs (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > abs (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > floor (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > round (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > sign (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > fmod (const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > fmod (const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > fmod (const Array< T, Alloc > &a, const T &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > floormod (const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > floormod (const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > floormod (const Array< T, Alloc > &a, const T &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > pow (const Array< T, Alloc > &a, const double &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > tan (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > tanh (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
Array< T, Alloc > fabs (const Array< T, Alloc > &a)
 N.B. More...
 
template<typename ScalarType , typename Alloc >
void minMax (ScalarType &minVal, ScalarType &maxVal, IPosition &minPos, IPosition &maxPos, const Array< ScalarType, Alloc > &array)
 Find the minimum and maximum values of an array, including their locations. More...
 
template<typename ScalarType , typename Alloc >
void minMax (ScalarType &minVal, ScalarType &maxVal, IPosition &minPos, IPosition &maxPos, const Array< ScalarType, Alloc > &array, const Array< bool > &mask, bool valid=true)
 The array is searched at locations where the mask equals valid. More...
 
template<typename ScalarType , typename Alloc >
void minMaxMasked (ScalarType &minVal, ScalarType &maxVal, IPosition &minPos, IPosition &maxPos, const Array< ScalarType, Alloc > &array, const Array< ScalarType, Alloc > &weight)
 The array * weight is searched. More...
 
template<typename T , typename Alloc >
void minMax (T &min, T &max, const Array< T, Alloc > &a)
 The "min" and "max" functions require that the type "T" have comparison operators. More...
 
template<typename T , typename Alloc >
min (const Array< T, Alloc > &a)
 The minimum element of the array. More...
 
template<typename T , typename Alloc >
max (const Array< T, Alloc > &a)
 The maximum element of the array. More...
 
template<typename T , typename Alloc >
void max (Array< T, Alloc > &result, const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 "result" contains the maximum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
void min (Array< T, Alloc > &result, const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 "result" contains the minimum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > max (const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 Return an array that contains the maximum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > max (const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > min (const Array< T, Alloc > &a, const Array< T, Alloc > &b)
 Return an array that contains the minimum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
void max (Array< T, Alloc > &result, const Array< T, Alloc > &a, const T &b)
 "result" contains the maximum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
void max (Array< T, Alloc > &result, const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
void min (Array< T, Alloc > &result, const Array< T, Alloc > &a, const T &b)
 "result" contains the minimum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
void min (Array< T, Alloc > &result, const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > max (const Array< T, Alloc > &a, const T &b)
 Return an array that contains the maximum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > max (const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
Array< T, Alloc > min (const Array< T, Alloc > &a, const T &b)
 Return an array that contains the minimum of "a" and "b" at each position. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > min (const T &a, const Array< T, Alloc > &b)
 
template<typename T , typename Alloc >
void indgen (Array< T, Alloc > &a, T start, T inc)
 Fills all elements of "array" with a sequence starting with "start" and incrementing by "inc" for each element. More...
 
template<typename T , typename Alloc >
void indgen (Array< T, Alloc > &a)
 Fills all elements of "array" with a sequence starting with 0 and ending with nelements() - 1. More...
 
template<typename T , typename Alloc >
void indgen (Array< T, Alloc > &a, T start)
 Fills all elements of "array" with a sequence starting with start incremented by one for each position in the array. More...
 
template<typename T , typename Alloc = std::allocator<T>>
Vector< T, Alloc > indgen (size_t length, T start, T inc)
 Create a Vector of the given length and fill it with the start value incremented with inc for each element. More...
 
template<typename T , typename Alloc >
sum (const Array< T, Alloc > &a)
 Sum of every element of the array. More...
 
template<typename T , typename Alloc >
sumsqr (const Array< T, Alloc > &a)
 Sum the square of every element of the array. More...
 
template<typename T , typename Alloc >
product (const Array< T, Alloc > &a)
 Product of every element of the array. More...
 
template<typename T , typename Alloc >
mean (const Array< T, Alloc > &a)
 The mean of "a" is the sum of all elements of "a" divided by the number of elements of "a". More...
 
template<typename T , typename Alloc >
variance (const Array< T, Alloc > &a)
 The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - ddof). More...
 
template<typename T , typename Alloc >
pvariance (const Array< T, Alloc > &a, size_t ddof=0)
 
template<typename T , typename Alloc >
variance (const Array< T, Alloc > &a, T mean)
 Rather than using a computed mean, use the supplied value. More...
 
template<typename T , typename Alloc >
pvariance (const Array< T, Alloc > &a, T mean, size_t ddof=0)
 
template<typename T , typename Alloc >
stddev (const Array< T, Alloc > &a)
 The standard deviation of "a" is the square root of its variance. More...
 
template<typename T , typename Alloc >
pstddev (const Array< T, Alloc > &a, size_t ddof=0)
 
template<typename T , typename Alloc >
stddev (const Array< T, Alloc > &a, T mean)
 
template<typename T , typename Alloc >
pstddev (const Array< T, Alloc > &a, T mean, size_t ddof=0)
 
template<typename T , typename Alloc >
avdev (const Array< T, Alloc > &a)
 The average deviation of "a" is the sum of abs(a(i) - mean(a))/N. More...
 
template<typename T , typename Alloc >
avdev (const Array< T, Alloc > &a, T mean)
 The average deviation of "a" is the sum of abs(a(i) - mean(a))/N. More...
 
template<typename T , typename Alloc >
rms (const Array< T, Alloc > &a)
 The root-mean-square of "a" is the sqrt of sum(a*a)/N. More...
 
template<typename T , typename Alloc >
median (const Array< T, Alloc > &a, std::vector< T > &scratch, bool sorted, bool takeEvenMean, bool inPlace=false)
 The median of "a" is a(n/2). More...
 
template<typename T , typename Alloc >
median (const Array< T, Alloc > &a, bool sorted, bool takeEvenMean, bool inPlace=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
median (const Array< T, Alloc > &a, bool sorted)
 
template<typename T , typename Alloc >
median (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
medianInPlace (const Array< T, Alloc > &a, bool sorted=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
madfm (const Array< T, Alloc > &a, std::vector< T > &tmp, bool sorted, bool takeEvenMean, bool inPlace=false)
 The median absolute deviation from the median. More...
 
template<typename T , typename Alloc >
madfm (const Array< T, Alloc > &a, bool sorted, bool takeEvenMean, bool inPlace=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
madfm (const Array< T, Alloc > &a, bool sorted)
 
template<typename T , typename Alloc >
madfm (const Array< T, Alloc > &a)
 
template<typename T , typename Alloc >
madfmInPlace (const Array< T, Alloc > &a, bool sorted=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
fractile (const Array< T, Alloc > &a, std::vector< T > &tmp, float fraction, bool sorted=false, bool inPlace=false)
 Return the fractile of an array. More...
 
template<typename T , typename Alloc >
fractile (const Array< T, Alloc > &a, float fraction, bool sorted=false, bool inPlace=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
interFractileRange (const Array< T, Alloc > &a, std::vector< T > &tmp, float fraction, bool sorted=false, bool inPlace=false)
 Return the inter-fractile range of an array. More...
 
template<typename T , typename Alloc >
interFractileRange (const Array< T, Alloc > &a, float fraction, bool sorted=false, bool inPlace=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
interHexileRange (const Array< T, Alloc > &a, std::vector< T > &tmp, bool sorted=false, bool inPlace=false)
 Return the inter-hexile range of an array. More...
 
template<typename T , typename Alloc >
interHexileRange (const Array< T, Alloc > &a, bool sorted=false, bool inPlace=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename Alloc >
interQuartileRange (const Array< T, Alloc > &a, std::vector< T > &tmp, bool sorted=false, bool inPlace=false)
 Return the inter-quartile range of an array. More...
 
template<typename T , typename Alloc >
interQuartileRange (const Array< T, Alloc > &a, bool sorted=false, bool inPlace=false)
 TODO shouldn't take a const Array for in place sorting. More...
 
template<typename T , typename AllocC , typename AllocR >
void operator*= (Array< std::complex< T >, AllocC > &left, const Array< T, AllocR > &other)
 Methods for element-by-element scaling of complex and real. More...
 
template<typename T , typename Alloc >
void operator*= (Array< std::complex< T >, Alloc > &left, const T &other)
 
template<typename T , typename AllocC , typename AllocR >
void operator/= (Array< std::complex< T >, AllocC > &left, const Array< T, AllocR > &other)
 
template<typename T , typename Alloc >
void operator/= (Array< std::complex< T >, Alloc > &left, const T &other)
 
template<typename T , typename AllocC , typename AllocR >
Array< std::complex< T >, AllocC > operator* (const Array< std::complex< T >, AllocC > &left, const Array< T, AllocR > &right)
 
template<typename T , typename Alloc >
Array< std::complex< T > > operator* (const Array< std::complex< T >, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
Array< std::complex< T > > operator* (const std::complex< T > &left, const Array< T, Alloc > &other)
 
template<typename T , typename AllocC , typename AllocR >
Array< std::complex< T >, AllocC > operator/ (const Array< std::complex< T >, AllocC > &left, const Array< T, AllocR > &right)
 
template<typename T , typename Alloc >
Array< std::complex< T >, Alloc > operator/ (const Array< std::complex< T >, Alloc > &left, const T &other)
 
template<typename T , typename Alloc >
Array< std::complex< T > > operator/ (const std::complex< T > &left, const Array< T, Alloc > &other)
 
Array< std::complex< float > > conj (const Array< std::complex< float >> &carray)
 Returns the complex conjugate of a complex array. More...
 
Array< std::complex< double > > conj (const Array< std::complex< double >> &carray)
 
void conj (Array< std::complex< float >> &rarray, const Array< std::complex< float >> &carray)
 Modifies rarray in place. More...
 
void conj (Array< std::complex< double >> &rarray, const Array< std::complex< double >> &carray)
 
Matrix< std::complex< float > > conj (const Matrix< std::complex< float >> &carray)
 
Matrix< std::complex< double > > conj (const Matrix< std::complex< double >> &carray)
 
template<typename T , typename Alloc >
Array< std::complex< T > > makeComplex (const Array< T, Alloc > &real, const Array< T, Alloc > &imag)
 Form an array of complex numbers from the given real arrays. More...
 
template<typename T , typename Alloc >
Array< std::complex< T > > makeComplex (const T &real, const Array< T, Alloc > &imag)
 
template<typename T , typename Alloc >
Array< std::complex< T > > makeComplex (const Array< T, Alloc > &real, const T &imag)
 
template<typename C , typename R , typename AllocC , typename AllocR >
void setReal (Array< C, AllocC > &carray, const Array< R, AllocR > &rarray)
 Set the real part of the left complex array to the right real array. More...
 
template<typename C , typename R , typename AllocC , typename AllocR >
void setImag (Array< C, AllocC > &carray, const Array< R, AllocR > &rarray)
 Set the imaginary part of the left complex array to right real array. More...
 
Array< float > real (const Array< std::complex< float >> &carray)
 Extracts the real part of a complex array into an array of floats. More...
 
Array< double > real (const Array< std::complex< double >> &carray)
 
void real (Array< float > &rarray, const Array< std::complex< float >> &carray)
 Modifies rarray in place. More...
 
void real (Array< double > &rarray, const Array< std::complex< double >> &carray)
 
Array< float > imag (const Array< std::complex< float >> &carray)
 Extracts the imaginary part of a complex array into an array of floats. More...
 
Array< double > imag (const Array< std::complex< double >> &carray)
 
void imag (Array< float > &rarray, const Array< std::complex< float >> &carray)
 Modifies rarray in place. More...
 
void imag (Array< double > &rarray, const Array< std::complex< double >> &carray)
 
Array< float > amplitude (const Array< std::complex< float >> &carray)
 Extracts the amplitude (i.e. More...
 
Array< double > amplitude (const Array< std::complex< double >> &carray)
 
void amplitude (Array< float > &rarray, const Array< std::complex< float >> &carray)
 Modifies rarray in place. More...
 
void amplitude (Array< double > &rarray, const Array< std::complex< double >> &carray)
 
Array< float > phase (const Array< std::complex< float >> &carray)
 Extracts the phase (i.e. More...
 
Array< double > phase (const Array< std::complex< double >> &carray)
 
void phase (Array< float > &rarray, const Array< std::complex< float >> &carray)
 Modifies rarray in place. More...
 
void phase (Array< double > &rarray, const Array< std::complex< double >> &carray)
 
Array< float > ComplexToReal (const Array< std::complex< float >> &carray)
 Copy an array of complex into an array of real,imaginary pairs. More...
 
Array< double > ComplexToReal (const Array< std::complex< double >> &carray)
 
void ComplexToReal (Array< float > &rarray, const Array< std::complex< float >> &carray)
 Modify the array "rarray" in place. More...
 
void ComplexToReal (Array< double > &rarray, const Array< std::complex< double >> &carray)
 
Array< std::complex< float > > RealToComplex (const Array< float > &rarray)
 Copy an array of real,imaginary pairs into a complex array. More...
 
Array< std::complex< double > > RealToComplex (const Array< double > &rarray)
 
void RealToComplex (Array< std::complex< float >> &carray, const Array< float > &rarray)
 Modify the array "carray" in place. More...
 
void RealToComplex (Array< std::complex< double >> &carray, const Array< double > &rarray)
 
template<typename T , typename U , typename AllocT , typename AllocU >
void convertArray (Array< T, AllocT > &to, const Array< U, AllocU > &from)
 Make a copy of an array of a different type; for example make an array of doubles from an array of floats. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > square (const Array< T, Alloc > &val)
 Returns an array where every element is squared. More...
 
template<typename T , typename Alloc >
Array< T, Alloc > cube (const Array< T, Alloc > &val)
 Returns an array where every element is cubed. More...
 
template<typename T >
T * expandRecursive (int axis, const IPosition &shp, const IPosition &mult, const IPosition &inSteps, const T *in, T *out, const IPosition &alternate)
 Helper function for expandArray using recursion for each axis. More...
 
template<typename T , typename Alloc >
void expandArray (Array< T, Alloc > &out, const Array< T, Alloc > &in, const IPosition &alternate=IPosition())
 Expand the values of an array. More...
 
IPosition checkExpandArray (IPosition &mult, IPosition &newInShape, const IPosition &inShape, const IPosition &outShape, const IPosition &alternate)
 Check array shapes for expandArray. More...
 

Detailed Description

Mathematical operations for Arrays.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tArray

Prerequisite

Etymology

This file contains global functions which perform element by element mathematical operations on arrays.

Synopsis

These functions perform element by element mathematical operations on arrays. The two arrays must conform.

Furthermore it defines functions a la std::transform to transform one or two arrays by means of a unary or binary operator. All math and logical operations on arrays can be expressed by means of these transform functions.
It also defines an in-place transform function because for non-trivial iterators it works faster than a transform where the result is an iterator on the same data object as the left operand.
The transform functions distinguish between contiguous and non-contiguous arrays because iterating through a contiguous array can be done in a faster way.
Similar to the standard transform function these functions do not check if the shapes match. The user is responsible for that.

Example

Vector<int> a(10);
Vector<int> b(10);
Vector<int> c(10);
...
c = a + b;

This example sets the elements of c to (a+b). It checks if a and b have the same shape. The result of this operation is an Array.

Example

c = arrayTransformResult (a, b, std::plus<double>());

This example does the same as the previous example, but expressed using the transform function (which, in fact, is used by the + operator above). However, it is not checked if the shapes match.

Example

arrayContTransform (a, b, c, std::plus<double>());

This example does the same as the previous example, but is faster because the result array already exists and does not need to be allocated. Note that the caller must be sure that c is contiguous.

Example

Vector<double> a(10);
Vector<double> b(10);
Vector<double> c(10);
...
c = atan2 (a, b);

This example sets the elements of c to atan2 (a,b). The result of this operation is an Array.

Example

Vector<int> a(10);
int result;
...
result = sum (a);

This example sums a.

Motivation

One wants to be able to perform mathematical operations on arrays.

Definition at line 134 of file ArrayMath.h.

Member Function Documentation

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::abs ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::acos ( const Array< T, Alloc > &  a)

Transcendental function applied to the array on an element-by-element basis.

Although a template function, this does not make sense for all numeric types.

Array<float> casacore::ArrayMath_global_functions_Array_mathematical_operations::amplitude ( const Array< std::complex< float >> &  carray)

Extracts the amplitude (i.e.

sqrt(re*re + im*im)) from an array of complex numbers. N.B. this is presently called "fabs" for a single complex number.

Array<double> casacore::ArrayMath_global_functions_Array_mathematical_operations::amplitude ( const Array< std::complex< double >> &  carray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::amplitude ( Array< float > &  rarray,
const Array< std::complex< float >> &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::amplitude ( Array< double > &  rarray,
const Array< std::complex< double >> &  carray 
)
template<typename L , typename AllocL , typename R , typename AllocR , typename RES , typename AllocRES , typename BinaryOperator >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( const Array< L, AllocL > &  left,
const Array< R, AllocR > &  right,
Array< RES, AllocRES > &  result,
BinaryOperator  op 
)
inline

Functions to apply a binary or unary operator to arrays.

They are modeled after std::transform. They do not check if the shapes conform; as in std::transform the user must take care that the operands conform.

Transform left and right to a result using the binary operator. Result MUST be a contiguous array.

Definition at line 186 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename L , typename AllocL , typename R , typename RES , typename AllocRES , typename BinaryOperator >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( const Array< L, AllocL > &  left,
right,
Array< RES, AllocRES > &  result,
BinaryOperator  op 
)
inline

Transform left and right to a result using the binary operator.

Result MUST be a contiguous array.

Definition at line 202 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename L , typename R , typename AllocR , typename RES , typename AllocRES , typename BinaryOperator >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( left,
const Array< R, AllocR > &  right,
Array< RES, AllocRES > &  result,
BinaryOperator  op 
)
inline

Transform left and right to a result using the binary operator.

Result MUST be a contiguous array.

Definition at line 222 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename T , typename Alloc , typename RES , typename AllocRES , typename UnaryOperator >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( const Array< T, Alloc > &  arr,
Array< RES, AllocRES > &  result,
UnaryOperator  op 
)
inline

Transform array to a result using the unary operator.

Result MUST be a contiguous array.

Definition at line 242 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename L , typename R , typename RES , typename BinaryOperator , typename AllocL , typename AllocR , typename AllocRES >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( const Array< L, AllocL > &  left,
const Array< R, AllocR > &  right,
Array< RES, AllocRES > &  result,
BinaryOperator  op 
)

Transform left and right to a result using the binary operator.

Result need not be a contiguous array.

template<typename L , typename R , typename RES , typename BinaryOperator , typename Alloc , typename AllocRES >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( const Array< L, Alloc > &  left,
right,
Array< RES, AllocRES > &  result,
BinaryOperator  op 
)

Transform left and right to a result using the binary operator.

Result need not be a contiguous array.

template<typename L , typename R , typename RES , typename BinaryOperator , typename Alloc , typename AllocRES >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( left,
const Array< R, Alloc > &  right,
Array< RES, AllocRES > &  result,
BinaryOperator  op 
)

Transform left and right to a result using the binary operator.

Result need not be a contiguous array.

template<typename T , typename RES , typename UnaryOperator , typename Alloc , typename AllocRES >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( const Array< T, Alloc > &  arr,
Array< RES, AllocRES > &  result,
UnaryOperator  op 
)

Transform array to a result using the unary operator.

Result need not be a contiguous array.

template<typename L , typename R , typename BinaryOperator , typename AllocL , typename AllocR >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace ( Array< L, AllocL > &  left,
const Array< R, AllocR > &  right,
BinaryOperator  op 
)
inline

Transform left and right in place using the binary operator.

The result is stored in the left array (useful for e.g. the += operation).

Definition at line 301 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename L , typename R , typename BinaryOperator , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace ( Array< L, Alloc > &  left,
right,
BinaryOperator  op 
)
inline

Transform left and right in place using the binary operator.

The result is stored in the left array (useful for e.g. the += operation).

Definition at line 314 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename T , typename UnaryOperator , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace ( Array< T, Alloc > &  arr,
UnaryOperator  op 
)
inline

Transform the array in place using the unary operator.

E.g. doing arrayTransformInPlace(array, Sin<T>()) is faster than array=sin(array) as it does not need to create a temporary array.

Definition at line 329 of file ArrayMath.h.

References casacore::Array< T, Alloc >::begin(), casacore::Array< T, Alloc >::cbegin(), casacore::Array< T, Alloc >::cend(), casacore::ArrayBase::contiguousStorage(), and casacore::Array< T, Alloc >::end().

template<typename T , typename BinaryOperator , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right,
BinaryOperator  op 
)

Transform left and right to a result using the binary operator.

The created and returned result array is contiguous.

template<typename T , typename BinaryOperator , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( const Array< T, Alloc > &  left,
right,
BinaryOperator  op 
)

Transform left and right to a result using the binary operator.

The created and returned result array is contiguous.

template<typename T , typename BinaryOperator , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( left,
const Array< T, Alloc > &  right,
BinaryOperator  op 
)

Transform left and right to a result using the binary operator.

The created and returned result array is contiguous.

template<typename T , typename UnaryOperator , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( const Array< T, Alloc > &  arr,
UnaryOperator  op 
)

Transform array to a result using the unary operator.

The created and returned result array is contiguous.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::asin ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::atan ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::atan2 ( const Array< T, Alloc > &  y,
const Array< T, Alloc > &  x 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::atan2 ( const T &  y,
const Array< T, Alloc > &  x 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::atan2 ( const Array< T, Alloc > &  y,
const T &  x 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::avdev ( const Array< T, Alloc > &  a)

The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.

(N.B. N, not N-1 in the denominator).

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::avdev ( const Array< T, Alloc > &  a,
mean 
)

The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.

(N.B. N, not N-1 in the denominator). Rather than using a computed mean, use the supplied value.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::ceil ( const Array< T, Alloc > &  a)
IPosition casacore::ArrayMath_global_functions_Array_mathematical_operations::checkExpandArray ( IPosition mult,
IPosition newInShape,
const IPosition inShape,
const IPosition outShape,
const IPosition alternate 
)

Check array shapes for expandArray.

It returns the alternate argument, where possibly missing values are appended (as 0). It fills in mult and inshp (with possibly missing axes of length 1).
inShape defines the shape of the input array.
outShape defines the shape of the output array.
alternate tells per axis if value expansion uses alternation.
newInShape is the input shape with new axes (of length 1) added as needed
mult is the multiplication (expansion) factor per output axis Returned is the alternation per output axis; new axes have value 0 (linear expansion)

Array<float> casacore::ArrayMath_global_functions_Array_mathematical_operations::ComplexToReal ( const Array< std::complex< float >> &  carray)

Copy an array of complex into an array of real,imaginary pairs.

The first axis of the real array becomes twice as long as the complex array. In the future versions which work by reference will be available; presently a copy is made.

Array<double> casacore::ArrayMath_global_functions_Array_mathematical_operations::ComplexToReal ( const Array< std::complex< double >> &  carray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::ComplexToReal ( Array< float > &  rarray,
const Array< std::complex< float >> &  carray 
)

Modify the array "rarray" in place.

"rarray" must be the correct shape.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::ComplexToReal ( Array< double > &  rarray,
const Array< std::complex< double >> &  carray 
)
Array<std::complex<float> > casacore::ArrayMath_global_functions_Array_mathematical_operations::conj ( const Array< std::complex< float >> &  carray)

Returns the complex conjugate of a complex array.

Array<std::complex<double> > casacore::ArrayMath_global_functions_Array_mathematical_operations::conj ( const Array< std::complex< double >> &  carray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::conj ( Array< std::complex< float >> &  rarray,
const Array< std::complex< float >> &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::conj ( Array< std::complex< double >> &  rarray,
const Array< std::complex< double >> &  carray 
)
Matrix<std::complex<float> > casacore::ArrayMath_global_functions_Array_mathematical_operations::conj ( const Matrix< std::complex< float >> &  carray)
Matrix<std::complex<double> > casacore::ArrayMath_global_functions_Array_mathematical_operations::conj ( const Matrix< std::complex< double >> &  carray)
template<typename T , typename U , typename AllocT , typename AllocU >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::convertArray ( Array< T, AllocT > &  to,
const Array< U, AllocU > &  from 
)

Make a copy of an array of a different type; for example make an array of doubles from an array of floats.

Arrays to and from must be conformant (same shape). Also, it must be possible to convert a scalar of type U to type T.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::cos ( const Array< T, Alloc > &  a)

Transcendental function that can be applied to essentially all numeric types.

Works on an element-by-element basis.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::cosh ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::cube ( const Array< T, Alloc > &  val)

Returns an array where every element is cubed.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::exp ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::expandArray ( Array< T, Alloc > &  out,
const Array< T, Alloc > &  in,
const IPosition alternate = IPosition() 
)
inline

Expand the values of an array.

The arrays can have different dimensionalities. Missing input axes have length 1; missing output axes are discarded. The length of each axis in the input array must be <= the length of the corresponding axis in the output array and divide evenly. For each axis mult is set to output/input.
The alternate argument determines how the values are expanded. If a row contains values '1 2 3', they can be expanded "linearly" as '1 1 2 2 3 3' or alternately as '1 2 3 1 2 3' This choice can be made for each axis; a value 0 means linearly, another value means alternately. If the length of alternate is less than the dimensionality of the output array, the missing ones default to 0.

Make sure output is contiguous.

Definition at line 1043 of file ArrayMath.h.

References casacore::Array< T, Alloc >::getStorage(), casacore::ArrayBase::ndim(), casacore::Array< T, Alloc >::putStorage(), casacore::Array< T, Alloc >::reform(), casacore::ArrayBase::shape(), and casacore::IPosition::size().

template<typename T >
T* casacore::ArrayMath_global_functions_Array_mathematical_operations::expandRecursive ( int  axis,
const IPosition shp,
const IPosition mult,
const IPosition inSteps,
const T *  in,
T *  out,
const IPosition alternate 
)
inline

Helper function for expandArray using recursion for each axis.

Copy as 1,2,3 1,2,3, etc.

Copy as 1,1,1 2,2,2 etc.

Definition at line 985 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::fabs ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::fabs ( const Array< T, Alloc > &  a)

N.B.

fabs is deprecated. Use abs.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::floor ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::floormod ( const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::floormod ( const T &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::floormod ( const Array< T, Alloc > &  a,
const T &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::fmod ( const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::fmod ( const T &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::fmod ( const Array< T, Alloc > &  a,
const T &  b 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::fractile ( const Array< T, Alloc > &  a,
std::vector< T > &  tmp,
float  fraction,
bool  sorted = false,
bool  inPlace = false 
)

Return the fractile of an array.

It returns the value at the given fraction of the array. A fraction of 0.5 is the same as the median, be it that no mean of the two middle elements is taken if the array has an even nr of elements. It uses kthLargest if the array is not sorted yet.
Note: The function kthLargest in class GenSortIndirect can be used to obtain the index of the fractile in an array;
TODO shouldn't take a const Array for in place sorting

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::fractile ( const Array< T, Alloc > &  a,
float  fraction,
bool  sorted = false,
bool  inPlace = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 729 of file ArrayMath.h.

References casacore::fractile().

Array<float> casacore::ArrayMath_global_functions_Array_mathematical_operations::imag ( const Array< std::complex< float >> &  carray)

Extracts the imaginary part of a complex array into an array of floats.

Array<double> casacore::ArrayMath_global_functions_Array_mathematical_operations::imag ( const Array< std::complex< double >> &  carray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::imag ( Array< float > &  rarray,
const Array< std::complex< float >> &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::imag ( Array< double > &  rarray,
const Array< std::complex< double >> &  carray 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::indgen ( Array< T, Alloc > &  a,
start,
inc 
)

Fills all elements of "array" with a sequence starting with "start" and incrementing by "inc" for each element.

The first axis varies most rapidly.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::indgen ( Array< T, Alloc > &  a)
inline

Fills all elements of "array" with a sequence starting with 0 and ending with nelements() - 1.

The first axis varies most rapidly.

Definition at line 597 of file ArrayMath.h.

References casacore::indgen().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::indgen ( Array< T, Alloc > &  a,
start 
)
inline

Fills all elements of "array" with a sequence starting with start incremented by one for each position in the array.

The first axis varies most rapidly.

Definition at line 603 of file ArrayMath.h.

References casacore::indgen().

template<typename T , typename Alloc = std::allocator<T>>
Vector<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::indgen ( size_t  length,
start,
inc 
)
inline

Create a Vector of the given length and fill it with the start value incremented with inc for each element.

Definition at line 608 of file ArrayMath.h.

References casacore::indgen().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::interFractileRange ( const Array< T, Alloc > &  a,
std::vector< T > &  tmp,
float  fraction,
bool  sorted = false,
bool  inPlace = false 
)

Return the inter-fractile range of an array.

This is the full range between the bottom and the top fraction.

TODO shouldn't take a const Array for in place sorting

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::interFractileRange ( const Array< T, Alloc > &  a,
float  fraction,
bool  sorted = false,
bool  inPlace = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 741 of file ArrayMath.h.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::interHexileRange ( const Array< T, Alloc > &  a,
std::vector< T > &  tmp,
bool  sorted = false,
bool  inPlace = false 
)
inline

Return the inter-hexile range of an array.

This is the full range between the bottom sixth and the top sixth of ordered array values. "The semi-interhexile range is very nearly equal to the rms for a Gaussian distribution, but it is much less sensitive to the tails of extended distributions." (Condon et al 1998)

TODO shouldn't take a const Array for in place sorting

Definition at line 754 of file ArrayMath.h.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::interHexileRange ( const Array< T, Alloc > &  a,
bool  sorted = false,
bool  inPlace = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 758 of file ArrayMath.h.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::interQuartileRange ( const Array< T, Alloc > &  a,
std::vector< T > &  tmp,
bool  sorted = false,
bool  inPlace = false 
)
inline

Return the inter-quartile range of an array.

This is the full range between the bottom quarter and the top quarter of ordered array values.

TODO shouldn't take a const Array for in place sorting

Definition at line 768 of file ArrayMath.h.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::interQuartileRange ( const Array< T, Alloc > &  a,
bool  sorted = false,
bool  inPlace = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 772 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::log ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::log10 ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::madfm ( const Array< T, Alloc > &  a,
std::vector< T > &  tmp,
bool  sorted,
bool  takeEvenMean,
bool  inPlace = false 
)

The median absolute deviation from the median.

Interface is as for the median functions

TODO shouldn't take a const Array for in place sorting

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::madfm ( const Array< T, Alloc > &  a,
bool  sorted,
bool  takeEvenMean,
bool  inPlace = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 706 of file ArrayMath.h.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::madfm ( const Array< T, Alloc > &  a,
bool  sorted 
)
inline

Definition at line 709 of file ArrayMath.h.

References casacore::ArrayBase::nelements().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::madfm ( const Array< T, Alloc > &  a)
inline

Definition at line 711 of file ArrayMath.h.

References casacore::ArrayBase::nelements().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::madfmInPlace ( const Array< T, Alloc > &  a,
bool  sorted = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 714 of file ArrayMath.h.

References casacore::ArrayBase::nelements().

template<typename T , typename Alloc >
Array<std::complex<T> > casacore::ArrayMath_global_functions_Array_mathematical_operations::makeComplex ( const Array< T, Alloc > &  real,
const Array< T, Alloc > &  imag 
)

Form an array of complex numbers from the given real arrays.

Note that std::complex<float> and std::complex<double> are simply typedefs for std::complex<float> and std::complex<double>, so the result is in fact one of these types.

template<typename T , typename Alloc >
Array<std::complex<T> > casacore::ArrayMath_global_functions_Array_mathematical_operations::makeComplex ( const T &  real,
const Array< T, Alloc > &  imag 
)
template<typename T , typename Alloc >
Array<std::complex<T> > casacore::ArrayMath_global_functions_Array_mathematical_operations::makeComplex ( const Array< T, Alloc > &  real,
const T &  imag 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( const Array< T, Alloc > &  a)

The maximum element of the array.

Requires that the type "T" has comparison operators.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( Array< T, Alloc > &  result,
const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)

"result" contains the maximum of "a" and "b" at each position.

"result", "a", and "b" must be conformant.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)

Return an array that contains the maximum of "a" and "b" at each position.

"a" and "b" must be conformant.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( const T &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( Array< T, Alloc > &  result,
const Array< T, Alloc > &  a,
const T &  b 
)

"result" contains the maximum of "a" and "b" at each position.

"result", and "a" must be conformant.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( Array< T, Alloc > &  result,
const T &  a,
const Array< T, Alloc > &  b 
)
inline

Definition at line 568 of file ArrayMath.h.

References casacore::max().

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( const Array< T, Alloc > &  a,
const T &  b 
)

Return an array that contains the maximum of "a" and "b" at each position.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::max ( const T &  a,
const Array< T, Alloc > &  b 
)
inline

Definition at line 580 of file ArrayMath.h.

References casacore::max().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::mean ( const Array< T, Alloc > &  a)

The mean of "a" is the sum of all elements of "a" divided by the number of elements of "a".

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T, Alloc > &  a,
std::vector< T > &  scratch,
bool  sorted,
bool  takeEvenMean,
bool  inPlace = false 
)

The median of "a" is a(n/2).

If a has an even number of elements and the switch takeEvenMean is set, the median is 0.5*(a(n/2) + a((n+1)/2)). According to Numerical Recipes (2nd edition) it makes little sense to take the mean if the array is large enough (> 100 elements). Therefore the default for takeEvenMean is false if the array has > 100 elements, otherwise it is true.
If "sorted"==true we assume the data is already sorted and we compute the median directly. Otherwise the function GenSort::kthLargest is used to find the median (kthLargest is about 6 times faster than a full quicksort).
Finding the median means that the array has to be (partially) sorted. By default a copy will be made, but if "inPlace" is in effect, the data themselves will be sorted. That should only be used if the data are used not thereafter.
Note: The function kthLargest in class GenSortIndirect can be used to obtain the index of the median in an array;

TODO shouldn't take a const Array for in place sorting

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T, Alloc > &  a,
bool  sorted,
bool  takeEvenMean,
bool  inPlace = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 687 of file ArrayMath.h.

References casacore::median().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T, Alloc > &  a,
bool  sorted 
)
inline

Definition at line 690 of file ArrayMath.h.

References casacore::median(), and casacore::ArrayBase::nelements().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T, Alloc > &  a)
inline

Definition at line 692 of file ArrayMath.h.

References casacore::median(), and casacore::ArrayBase::nelements().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::medianInPlace ( const Array< T, Alloc > &  a,
bool  sorted = false 
)
inline

TODO shouldn't take a const Array for in place sorting.

Definition at line 695 of file ArrayMath.h.

References casacore::median(), and casacore::ArrayBase::nelements().

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( const Array< T, Alloc > &  a)

The minimum element of the array.

Requires that the type "T" has comparison operators.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( Array< T, Alloc > &  result,
const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)

"result" contains the minimum of "a" and "b" at each position.

"result", "a", and "b" must be conformant.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)

Return an array that contains the minimum of "a" and "b" at each position.

"a" and "b" must be conformant.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( Array< T, Alloc > &  result,
const Array< T, Alloc > &  a,
const T &  b 
)

"result" contains the minimum of "a" and "b" at each position.

"result", and "a" must be conformant.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( Array< T, Alloc > &  result,
const T &  a,
const Array< T, Alloc > &  b 
)
inline

Definition at line 575 of file ArrayMath.h.

References casacore::min().

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( const Array< T, Alloc > &  a,
const T &  b 
)

Return an array that contains the minimum of "a" and "b" at each position.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::min ( const T &  a,
const Array< T, Alloc > &  b 
)
inline

Definition at line 584 of file ArrayMath.h.

References casacore::min().

template<typename ScalarType , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::minMax ( ScalarType &  minVal,
ScalarType &  maxVal,
IPosition minPos,
IPosition maxPos,
const Array< ScalarType, Alloc > &  array 
)

Find the minimum and maximum values of an array, including their locations.

template<typename ScalarType , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::minMax ( ScalarType &  minVal,
ScalarType &  maxVal,
IPosition minPos,
IPosition maxPos,
const Array< ScalarType, Alloc > &  array,
const Array< bool > &  mask,
bool  valid = true 
)

The array is searched at locations where the mask equals valid.

(at least one such position must exist or an exception will be thrown). MaskType should be an Array of bool.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::minMax ( T &  min,
T &  max,
const Array< T, Alloc > &  a 
)

The "min" and "max" functions require that the type "T" have comparison operators.

This sets min and max to the minimum and maximum of the array to avoid having to do two passes with max() and min() separately.

template<typename ScalarType , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::minMaxMasked ( ScalarType &  minVal,
ScalarType &  maxVal,
IPosition minPos,
IPosition maxPos,
const Array< ScalarType, Alloc > &  array,
const Array< ScalarType, Alloc > &  weight 
)

The array * weight is searched.

template<typename _InputIterator1 , typename T , typename _BinaryOperation >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::myiptransform ( _InputIterator1  __first1,
_InputIterator1  __last1,
right,
_BinaryOperation  __binary_op 
)
inline

sequence OP= scalar

Definition at line 168 of file ArrayMath.h.

template<typename _InputIterator1 , typename T , typename _OutputIterator , typename _BinaryOperation >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::myltransform ( _InputIterator1  __first1,
_InputIterator1  __last1,
_OutputIterator  __result,
left,
_BinaryOperation  __binary_op 
)
inline

The myxtransform functions are defined to avoid a bug in g++-4.3.

That compiler generates incorrect code when only -g is used for a std::transform with a bind1st or bind2nd for a complex<float>. So, for example, the multiplication of a std::complex<float> array and std::complex<float> scalar would fail (see g++ bug 39678).

sequence = scalar OP sequence

Definition at line 146 of file ArrayMath.h.

template<typename _InputIterator1 , typename T , typename _OutputIterator , typename _BinaryOperation >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::myrtransform ( _InputIterator1  __first1,
_InputIterator1  __last1,
_OutputIterator  __result,
right,
_BinaryOperation  __binary_op 
)
inline

sequence = sequence OP scalar

Definition at line 157 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator% ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator% ( const Array< T, Alloc > &  left,
const T &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator% ( const T &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator%= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator%= ( Array< T, Alloc > &  left,
const T &  other 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator& ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator& ( const Array< T, Alloc > &  left,
const T &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator& ( const T &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator&= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator&= ( Array< T, Alloc > &  left,
const T &  other 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
inline

Definition at line 398 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<class T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< T, Alloc > &  left,
const T &  right 
)
inline

Definition at line 424 of file ArrayMath.h.

template<class T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const T &  left,
const Array< T, Alloc > &  right 
)
inline

Definition at line 449 of file ArrayMath.h.

template<typename T , typename AllocC , typename AllocR >
Array<std::complex<T>, AllocC> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< std::complex< T >, AllocC > &  left,
const Array< T, AllocR > &  right 
)
inline

Definition at line 812 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<typename T , typename Alloc >
Array<std::complex<T> > casacore::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< std::complex< T >, Alloc > &  left,
const T &  other 
)
inline

Definition at line 822 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<std::complex<T> > casacore::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const std::complex< T > &  left,
const Array< T, Alloc > &  other 
)
inline

Definition at line 831 of file ArrayMath.h.

References casacore::ArrayBase::shape().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
inline

Definition at line 345 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< T, Alloc > &  left,
const T &  other 
)
inline

Definition at line 368 of file ArrayMath.h.

template<typename T , typename AllocC , typename AllocR >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< std::complex< T >, AllocC > &  left,
const Array< T, AllocR > &  other 
)
inline

Methods for element-by-element scaling of complex and real.

Note that std::complex<float> and std::complex<double> are typedefs for std::complex.

Definition at line 782 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< std::complex< T >, Alloc > &  left,
const T &  other 
)
inline

Definition at line 790 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const Array< T, Alloc > &  a)

Unary arithmetic operation.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)

Element by element arithmetic on two arrays, returning an array.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const Array< T, Alloc > &  left,
const T &  right 
)

Element by element arithmetic between an array and a scalar, returning an array.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const T &  left,
const Array< T, Alloc > &  right 
)

Element by element arithmetic between a scalar and an array, returning an array.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator+= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)

Element by element arithmetic modifying left in-place.

left and other must be conformant.

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator+= ( Array< T, Alloc > &  left,
const T &  other 
)

Element by element arithmetic modifying left in-place.

The scalar "other" behaves as if it were a conformant Array to left filled with constant values.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const Array< T, Alloc > &  left,
const T &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const T &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator-= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator-= ( Array< T, Alloc > &  left,
const T &  other 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< T, Alloc > &  left,
const T &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const T &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename AllocC , typename AllocR >
Array<std::complex<T>, AllocC> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< std::complex< T >, AllocC > &  left,
const Array< T, AllocR > &  right 
)
inline

Definition at line 841 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<typename T , typename Alloc >
Array<std::complex<T>, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< std::complex< T >, Alloc > &  left,
const T &  other 
)
inline

Definition at line 851 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<std::complex<T> > casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const std::complex< T > &  left,
const Array< T, Alloc > &  other 
)
inline

Definition at line 860 of file ArrayMath.h.

References casacore::ArrayBase::shape().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
inline

Definition at line 351 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< T, Alloc > &  left,
const T &  other 
)
inline

Definition at line 372 of file ArrayMath.h.

template<typename T , typename AllocC , typename AllocR >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< std::complex< T >, AllocC > &  left,
const Array< T, AllocR > &  other 
)
inline

Definition at line 797 of file ArrayMath.h.

References casacore::checkArrayShapes().

template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< std::complex< T >, Alloc > &  left,
const T &  other 
)
inline

Definition at line 805 of file ArrayMath.h.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator^ ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator^ ( const Array< T, Alloc > &  left,
const T &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator^ ( const T &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator^= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator^= ( Array< T, Alloc > &  left,
const T &  other 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator| ( const Array< T, Alloc > &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator| ( const Array< T, Alloc > &  left,
const T &  right 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator| ( const T &  left,
const Array< T, Alloc > &  right 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator|= ( Array< T, Alloc > &  left,
const Array< T, Alloc > &  other 
)
template<typename T , typename Alloc >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::operator|= ( Array< T, Alloc > &  left,
const T &  other 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::operator~ ( const Array< T, Alloc > &  a)
Array<float> casacore::ArrayMath_global_functions_Array_mathematical_operations::phase ( const Array< std::complex< float >> &  carray)

Extracts the phase (i.e.

atan2(im, re)) from an array of complex numbers. N.B. this is presently called "arg" for a single complex number.

Array<double> casacore::ArrayMath_global_functions_Array_mathematical_operations::phase ( const Array< std::complex< double >> &  carray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::phase ( Array< float > &  rarray,
const Array< std::complex< float >> &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::phase ( Array< double > &  rarray,
const Array< std::complex< double >> &  carray 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::pow ( const Array< T, Alloc > &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::pow ( const T &  a,
const Array< T, Alloc > &  b 
)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::pow ( const Array< T, Alloc > &  a,
const double &  b 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::product ( const Array< T, Alloc > &  a)

Product of every element of the array.

This could of course easily overflow.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::pstddev ( const Array< T, Alloc > &  a,
size_t  ddof = 0 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::pstddev ( const Array< T, Alloc > &  a,
mean,
size_t  ddof = 0 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::pvariance ( const Array< T, Alloc > &  a,
size_t  ddof = 0 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::pvariance ( const Array< T, Alloc > &  a,
mean,
size_t  ddof = 0 
)
Array<float> casacore::ArrayMath_global_functions_Array_mathematical_operations::real ( const Array< std::complex< float >> &  carray)

Extracts the real part of a complex array into an array of floats.

Array<double> casacore::ArrayMath_global_functions_Array_mathematical_operations::real ( const Array< std::complex< double >> &  carray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::real ( Array< float > &  rarray,
const Array< std::complex< float >> &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::real ( Array< double > &  rarray,
const Array< std::complex< double >> &  carray 
)
Array<std::complex<float> > casacore::ArrayMath_global_functions_Array_mathematical_operations::RealToComplex ( const Array< float > &  rarray)

Copy an array of real,imaginary pairs into a complex array.

The first axis must have an even length. In the future versions which work by reference will be available; presently a copy is made.

Array<std::complex<double> > casacore::ArrayMath_global_functions_Array_mathematical_operations::RealToComplex ( const Array< double > &  rarray)
void casacore::ArrayMath_global_functions_Array_mathematical_operations::RealToComplex ( Array< std::complex< float >> &  carray,
const Array< float > &  rarray 
)

Modify the array "carray" in place.

"carray" must be the correct shape.

void casacore::ArrayMath_global_functions_Array_mathematical_operations::RealToComplex ( Array< std::complex< double >> &  carray,
const Array< double > &  rarray 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::rms ( const Array< T, Alloc > &  a)

The root-mean-square of "a" is the sqrt of sum(a*a)/N.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::round ( const Array< T, Alloc > &  a)
template<typename C , typename R , typename AllocC , typename AllocR >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::setImag ( Array< C, AllocC > &  carray,
const Array< R, AllocR > &  rarray 
)

Set the imaginary part of the left complex array to right real array.

template<typename C , typename R , typename AllocC , typename AllocR >
void casacore::ArrayMath_global_functions_Array_mathematical_operations::setReal ( Array< C, AllocC > &  carray,
const Array< R, AllocR > &  rarray 
)

Set the real part of the left complex array to the right real array.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::sign ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::sin ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::sinh ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::sqrt ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::square ( const Array< T, Alloc > &  val)

Returns an array where every element is squared.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::stddev ( const Array< T, Alloc > &  a)

The standard deviation of "a" is the square root of its variance.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::stddev ( const Array< T, Alloc > &  a,
mean 
)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::sum ( const Array< T, Alloc > &  a)

Sum of every element of the array.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::sumsqr ( const Array< T, Alloc > &  a)

Sum the square of every element of the array.

template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::tan ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
Array<T, Alloc> casacore::ArrayMath_global_functions_Array_mathematical_operations::tanh ( const Array< T, Alloc > &  a)
template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::variance ( const Array< T, Alloc > &  a)

The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - ddof).

Similar to numpy the argument ddof (delta degrees of freedom) tells if the population variance (ddof=0) or the sample variance (ddof=1) is taken. The variance functions proper use ddof=1.
Note that for a complex valued T the absolute values are used; in that way the variance is equal to the sum of the variances of the real and imaginary parts. Hence the imaginary part in the return value is 0.

template<typename T , typename Alloc >
T casacore::ArrayMath_global_functions_Array_mathematical_operations::variance ( const Array< T, Alloc > &  a,
mean 
)

Rather than using a computed mean, use the supplied value.


The documentation for this struct was generated from the following file: