casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
casa::ArrayMath_global_functions_Array_mathematical_operations Struct Reference

Mathematical operations for Arrays. More...

#include <ArrayMath.h>

List of all members.

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.
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
template<typename _InputIterator1 , typename T , typename _BinaryOperation >
void myiptransform (_InputIterator1 __first1, _InputIterator1 __last1, T right, _BinaryOperation __binary_op)
 sequence OP= scalar
void throwArrayShapes (const char *name)
 Function to check the shapes.
void checkArrayShapes (const ArrayBase &left, const ArrayBase &right, const char *name)
template<typename L , typename R , typename RES , typename BinaryOperator >
void arrayContTransform (const Array< L > &left, const Array< R > &right, Array< RES > &result, BinaryOperator op)
 Functions to apply a binary or unary operator to arrays.
template<typename L , typename R , typename RES , typename BinaryOperator >
void arrayContTransform (const Array< L > &left, R right, Array< RES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename L , typename R , typename RES , typename BinaryOperator >
void arrayContTransform (L left, const Array< R > &right, Array< RES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename T , typename RES , typename UnaryOperator >
void arrayContTransform (const Array< T > &arr, Array< RES > &result, UnaryOperator op)
 Transform array to a result using the unary operator.
template<typename L , typename R , typename RES , typename BinaryOperator >
void arrayTransform (const Array< L > &left, const Array< R > &right, Array< RES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename L , typename R , typename RES , typename BinaryOperator >
void arrayTransform (const Array< L > &left, R right, Array< RES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename L , typename R , typename RES , typename BinaryOperator >
void arrayTransform (L left, const Array< R > &right, Array< RES > &result, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename T , typename RES , typename UnaryOperator >
void arrayTransform (const Array< T > &arr, Array< RES > &result, UnaryOperator op)
 Transform array to a result using the unary operator.
template<typename T , typename BinaryOperator >
Array< T > arrayTransformResult (const Array< T > &left, const Array< T > &right, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename T , typename BinaryOperator >
Array< T > arrayTransformResult (const Array< T > &left, T right, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename T , typename BinaryOperator >
Array< T > arrayTransformResult (T left, const Array< T > &right, BinaryOperator op)
 Transform left and right to a result using the binary operator.
template<typename T , typename UnaryOperator >
Array< T > arrayTransformResult (const Array< T > &arr, UnaryOperator op)
 Transform array to a result using the unary operator.
template<typename L , typename R , typename BinaryOperator >
void arrayTransformInPlace (Array< L > &left, const Array< R > &right, BinaryOperator op)
 Transform left and right in place using the binary operator.
template<typename L , typename R , typename BinaryOperator >
void arrayTransformInPlace (Array< L > &left, R right, BinaryOperator op)
 Transform left and right in place using the binary operator.
template<typename T , typename UnaryOperator >
void arrayTransformInPlace (Array< T > &arr, UnaryOperator op)
 Transform the array in place using the unary operator.
template<class T >
void operator+= (Array< T > &left, const Array< T > &other)
 Element by element arithmetic modifying left in-place.
template<class T >
void operator-= (Array< T > &left, const Array< T > &other)
template<class T >
void operator*= (Array< T > &left, const Array< T > &other)
template<class T >
void operator/= (Array< T > &left, const Array< T > &other)
template<class T >
void operator%= (Array< T > &left, const Array< T > &other)
template<class T >
void operator&= (Array< T > &left, const Array< T > &other)
template<class T >
void operator|= (Array< T > &left, const Array< T > &other)
template<class T >
void operator^= (Array< T > &left, const Array< T > &other)
template<class T >
void operator+= (Array< T > &left, const T &other)
 Element by element arithmetic modifying left in-place.
template<class T >
void operator-= (Array< T > &left, const T &other)
template<class T >
void operator*= (Array< T > &left, const T &other)
template<class T >
void operator/= (Array< T > &left, const T &other)
template<class T >
void operator%= (Array< T > &left, const T &other)
template<class T >
void operator&= (Array< T > &left, const T &other)
template<class T >
void operator|= (Array< T > &left, const T &other)
template<class T >
void operator^= (Array< T > &left, const T &other)
template<class T >
Array< T > operator+ (const Array< T > &a)
 Unary arithmetic operation.
template<class T >
Array< T > operator- (const Array< T > &a)
template<class T >
Array< T > operator~ (const Array< T > &a)
template<class T >
Array< T > operator+ (const Array< T > &left, const Array< T > &right)
 Element by element arithmetic on two arrays, returning an array.
template<class T >
Array< T > operator- (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator* (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator/ (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator% (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator| (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator& (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator^ (const Array< T > &left, const Array< T > &right)
template<class T >
Array< T > operator+ (const Array< T > &left, const T &right)
 Element by element arithmetic between an array and a scalar, returning an array.
template<class T >
Array< T > operator- (const Array< T > &left, const T &right)
template<class T >
Array< T > operator* (const Array< T > &left, const T &right)
template<class T >
Array< T > operator/ (const Array< T > &left, const T &right)
template<class T >
Array< T > operator% (const Array< T > &left, const T &right)
template<class T >
Array< T > operator| (const Array< T > &left, const T &right)
template<class T >
Array< T > operator& (const Array< T > &left, const T &right)
template<class T >
Array< T > operator^ (const Array< T > &left, const T &right)
template<class T >
Array< T > operator+ (const T &left, const Array< T > &right)
 Element by element arithmetic between a scalar and an array, returning an array.
template<class T >
Array< T > operator- (const T &left, const Array< T > &right)
template<class T >
Array< T > operator* (const T &left, const Array< T > &right)
template<class T >
Array< T > operator/ (const T &left, const Array< T > &right)
template<class T >
Array< T > operator% (const T &left, const Array< T > &right)
template<class T >
Array< T > operator| (const T &left, const Array< T > &right)
template<class T >
Array< T > operator& (const T &left, const Array< T > &right)
template<class T >
Array< T > operator^ (const T &left, const Array< T > &right)
template<class T >
Array< T > cos (const Array< T > &a)
 Transcendental function that can be applied to essentially all numeric types.
template<class T >
Array< T > cosh (const Array< T > &a)
template<class T >
Array< T > exp (const Array< T > &a)
template<class T >
Array< T > log (const Array< T > &a)
template<class T >
Array< T > log10 (const Array< T > &a)
template<class T >
Array< T > pow (const Array< T > &a, const Array< T > &b)
template<class T >
Array< T > pow (const T &a, const Array< T > &b)
template<class T >
Array< T > sin (const Array< T > &a)
template<class T >
Array< T > sinh (const Array< T > &a)
template<class T >
Array< T > sqrt (const Array< T > &a)
template<class T >
Array< T > acos (const Array< T > &a)
 Transcendental function applied to the array on an element-by-element basis.
template<class T >
Array< T > asin (const Array< T > &a)
template<class T >
Array< T > atan (const Array< T > &a)
template<class T >
Array< T > atan2 (const Array< T > &y, const Array< T > &x)
template<class T >
Array< T > atan2 (const T &y, const Array< T > &x)
template<class T >
Array< T > atan2 (const Array< T > &y, const T &x)
template<class T >
Array< T > ceil (const Array< T > &a)
template<class T >
Array< T > fabs (const Array< T > &a)
template<class T >
Array< T > abs (const Array< T > &a)
template<class T >
Array< T > floor (const Array< T > &a)
template<class T >
Array< T > round (const Array< T > &a)
template<class T >
Array< T > sign (const Array< T > &a)
template<class T >
Array< T > fmod (const Array< T > &a, const Array< T > &b)
template<class T >
Array< T > fmod (const T &a, const Array< T > &b)
template<class T >
Array< T > fmod (const Array< T > &a, const T &b)
template<class T >
Array< T > pow (const Array< T > &a, const Double &b)
template<class T >
Array< T > tan (const Array< T > &a)
template<class T >
Array< T > tanh (const Array< T > &a)
template<class T >
Array< T > fabs (const Array< T > &a)
 N.B.
template<class ScalarType >
void minMax (ScalarType &minVal, ScalarType &maxVal, IPosition &minPos, IPosition &maxPos, const Array< ScalarType > &array)
 Find the minimum and maximum values of an array, including their locations.
template<class ScalarType >
void minMax (ScalarType &minVal, ScalarType &maxVal, IPosition &minPos, IPosition &maxPos, const Array< ScalarType > &array, const Array< Bool > &mask, Bool valid=True)
 The array is searched at locations where the mask equals valid.
template<class ScalarType >
void minMaxMasked (ScalarType &minVal, ScalarType &maxVal, IPosition &minPos, IPosition &maxPos, const Array< ScalarType > &array, const Array< ScalarType > &weight)
 The array * weight is searched.
template<class T >
void minMax (T &min, T &max, const Array< T > &a)
 The "min" and "max" functions require that the type "T" have comparison operators.
template<class T >
min (const Array< T > &a)
 The minimum element of the array.
template<class T >
max (const Array< T > &a)
 The maximum element of the array.
template<class T >
void max (Array< T > &result, const Array< T > &a, const Array< T > &b)
 "result" contains the maximum of "a" and "b" at each position.
template<class T >
void min (Array< T > &result, const Array< T > &a, const Array< T > &b)
 "result" contains the minimum of "a" and "b" at each position.
template<class T >
Array< T > max (const Array< T > &a, const Array< T > &b)
 Return an array that contains the maximum of "a" and "b" at each position.
template<class T >
Array< T > max (const T &a, const Array< T > &b)
template<class T >
Array< T > min (const Array< T > &a, const Array< T > &b)
 Return an array that contains the minimum of "a" and "b" at each position.
template<class T >
void max (Array< T > &result, const Array< T > &a, const T &b)
 "result" contains the maximum of "a" and "b" at each position.
template<class T >
void max (Array< T > &result, const T &a, const Array< T > &b)
template<class T >
void min (Array< T > &result, const Array< T > &a, const T &b)
 "result" contains the minimum of "a" and "b" at each position.
template<class T >
void min (Array< T > &result, const T &a, const Array< T > &b)
template<class T >
Array< T > max (const Array< T > &a, const T &b)
 Return an array that contains the maximum of "a" and "b" at each position.
template<class T >
Array< T > max (const T &a, const Array< T > &b)
template<class T >
Array< T > min (const Array< T > &a, const T &b)
 Return an array that contains the minimum of "a" and "b" at each position.
template<class T >
Array< T > min (const T &a, const Array< T > &b)
template<class T >
void indgen (Array< T > &a, T start, T inc)
 Fills all elements of "array" with a sequence starting with "start" and incrementing by "inc" for each element.
template<class T >
void indgen (Array< T > &a)
 Fills all elements of "array" with a sequence starting with 0 and ending with nelements() - 1.
template<class T >
void indgen (Array< T > &a, T start)
 Fills all elements of "array" with a sequence starting with start incremented by one for each position in the array.
template<class T >
sum (const Array< T > &a)
 Sum of every element of the array.
template<class T >
product (const Array< T > &a)
 Product of every element of the array.
template<class T >
mean (const Array< T > &a)
 The mean of "a" is the sum of all elements of "a" divided by the number of elements of "a".
template<class T >
variance (const Array< T > &a)
 The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - 1).
template<class T >
variance (const Array< T > &a, T mean)
 The variance of "a" is the sum of (a(i) - mean(a))**2/(a.nelements() - 1).
template<class T >
stddev (const Array< T > &a)
 The standard deviation of "a" is the square root of its variance.
template<class T >
stddev (const Array< T > &a, T mean)
 The standard deviation of "a" is the square root of its variance.
template<class T >
avdev (const Array< T > &a)
 The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.
template<class T >
avdev (const Array< T > &a, T mean)
 The average deviation of "a" is the sum of abs(a(i) - mean(a))/N.
template<class T >
rms (const Array< T > &a)
 The root-mean-square of "a" is the sqrt of sum(a*a)/N.
template<class T >
median (const Array< T > &a)
 The median of "a" is a(n/2).
template<class T >
median (const Array< T > &a, Bool sorted)
template<class T >
medianInPlace (const Array< T > &a, Bool sorted=False)
template<class T >
median (const Array< T > &a, Bool sorted, Bool takeEvenMean, Bool inPlace=False)
template<class T >
median (const Array< T > &a, Block< T > &tmp, Bool sorted, Bool takeEvenMean, Bool inPlace=False)
template<class T >
fractile (const Array< T > &a, Float fraction, Bool sorted=False, Bool inPlace=False)
 Return the fractile of an array.
template<class T >
fractile (const Array< T > &a, Block< T > &tmp, Float fraction, Bool sorted=False, Bool inPlace=False)
template<typename T >
void operator*= (Array< std::complex< T > > &left, const Array< T > &other)
 Methods for element-by-element scaling of complex and real.
template<typename T >
void operator*= (Array< std::complex< T > > &left, const T &other)
template<typename T >
void operator/= (Array< std::complex< T > > &left, const Array< T > &other)
template<typename T >
void operator/= (Array< std::complex< T > > &left, const T &other)
template<typename T >
Array< std::complex< T > > operator* (const Array< std::complex< T > > &left, const Array< T > &right)
template<typename T >
Array< std::complex< T > > operator* (const Array< std::complex< T > > &left, const T &right)
template<typename T >
Array< std::complex< T > > operator* (const std::complex< T > &left, const Array< T > &right)
template<typename T >
Array< std::complex< T > > operator/ (const Array< std::complex< T > > &left, const Array< T > &right)
template<typename T >
Array< std::complex< T > > operator/ (const Array< std::complex< T > > &left, const T &right)
template<typename T >
Array< std::complex< T > > operator/ (const std::complex< T > &left, const Array< T > &right)
Array< Complex > conj (const Array< Complex > &carray)
 Returns the complex conjugate of a complex array.
Array< DComplex > conj (const Array< DComplex > &carray)
void conj (Array< Complex > &rarray, const Array< Complex > &carray)
 Modifies rarray in place.
void conj (Array< DComplex > &rarray, const Array< DComplex > &carray)
Matrix< Complex > conj (const Matrix< Complex > &carray)
Matrix< DComplex > conj (const Matrix< DComplex > &carray)
template<typename T >
Array< std::complex< T > > makeComplex (const Array< T > &real, const Array< T > &imag)
 Form an array of complex numbers from the given real arrays.
template<typename L , typename R >
void setReal (Array< L > &carray, const Array< R > &rarray)
 Set the real part of the left complex array to the right real array.
template<typename R , typename L >
void setImag (Array< R > &carray, const Array< L > &rarray)
 Set the imaginary part of the left complex array to right real array.
Array< Floatreal (const Array< Complex > &carray)
 Extracts the real part of a complex array into an array of floats.
Array< Doublereal (const Array< DComplex > &carray)
void real (Array< Float > &rarray, const Array< Complex > &carray)
 Modifies rarray in place.
void real (Array< Double > &rarray, const Array< DComplex > &carray)
Array< Floatimag (const Array< Complex > &carray)
 Extracts the imaginary part of a complex array into an array of floats.
Array< Doubleimag (const Array< DComplex > &carray)
void imag (Array< Float > &rarray, const Array< Complex > &carray)
 Modifies rarray in place.
void imag (Array< Double > &rarray, const Array< DComplex > &carray)
Array< Floatamplitude (const Array< Complex > &carray)
 Extracts the amplitude (i.e.
Array< Doubleamplitude (const Array< DComplex > &carray)
void amplitude (Array< Float > &rarray, const Array< Complex > &carray)
 Modifies rarray in place.
void amplitude (Array< Double > &rarray, const Array< DComplex > &carray)
Array< Floatphase (const Array< Complex > &carray)
 Extracts the phase (i.e.
Array< Doublephase (const Array< DComplex > &carray)
void phase (Array< Float > &rarray, const Array< Complex > &carray)
 Modifies rarray in place.
void phase (Array< Double > &rarray, const Array< DComplex > &carray)
Array< FloatComplexToReal (const Array< Complex > &carray)
 Copy an array of complex into an array of real,imaginary pairs.
Array< DoubleComplexToReal (const Array< DComplex > &carray)
void ComplexToReal (Array< Float > &rarray, const Array< Complex > &carray)
 Modify the array "rarray" in place.
void ComplexToReal (Array< Double > &rarray, const Array< DComplex > &carray)
Array< Complex > RealToComplex (const Array< Float > &rarray)
 Copy an array of real,imaginary pairs into a complex array.
Array< DComplex > RealToComplex (const Array< Double > &rarray)
void RealToComplex (Array< Complex > &carray, const Array< Float > &rarray)
 Modify the array "carray" in place.
void RealToComplex (Array< DComplex > &carray, const Array< Double > &rarray)
template<class T , class U >
void convertArray (Array< T > &to, const Array< U > &from)
 Make a copy of an array of a different type; for example make an array of doubles from an array of floats.
template<class T >
Array< T > square (const Array< T > &val)
 Returns an array where every element is squared.
template<class T >
Array< T > cube (const Array< T > &val)
 Returns an array where every element is cubed.

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 140 of file ArrayMath.h.


Member Function Documentation

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.

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.

void casa::ArrayMath_global_functions_Array_mathematical_operations::amplitude ( Array< Float > &  rarray,
const Array< Complex > &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casa::ArrayMath_global_functions_Array_mathematical_operations::amplitude ( Array< Double > &  rarray,
const Array< DComplex > &  carray 
)
template<typename L , typename R , typename RES , typename BinaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( const Array< L > &  left,
const Array< R > &  right,
Array< RES > &  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 205 of file ArrayMath.h.

References casa::Array< T >::begin(), casa::Array< T >::cbegin(), casa::Array< T >::cend(), casa::ArrayBase::contiguousStorage(), DebugAssert, casa::Array< T >::end(), and casa::utilj::transform().

template<typename L , typename R , typename RES , typename BinaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( const Array< L > &  left,
right,
Array< RES > &  result,
BinaryOperator  op 
) [inline]

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

Result MUST be a contiguous array.

std::transform (left.cbegin(), left.cend(), result.cbegin(), bind2nd(op, right));

std::transform (left.begin(), left.end(), result.cbegin(), bind2nd(op, right));

Definition at line 221 of file ArrayMath.h.

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

template<typename L , typename R , typename RES , typename BinaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( left,
const Array< R > &  right,
Array< RES > &  result,
BinaryOperator  op 
) [inline]

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

Result MUST be a contiguous array.

std::transform (right.cbegin(), right.cend(), result.cbegin(), bind1st(op, left));

std::transform (right.begin(), right.end(), result.cbegin(), bind1st(op, left));

Definition at line 241 of file ArrayMath.h.

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

template<typename T , typename RES , typename UnaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform ( const Array< T > &  arr,
Array< RES > &  result,
UnaryOperator  op 
) [inline]

Transform array to a result using the unary operator.

Result MUST be a contiguous array.

Definition at line 261 of file ArrayMath.h.

References casa::Array< T >::begin(), casa::Array< T >::cbegin(), casa::Array< T >::cend(), casa::ArrayBase::contiguousStorage(), DebugAssert, casa::Array< T >::end(), and casa::utilj::transform().

template<typename L , typename R , typename RES , typename BinaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( const Array< L > &  left,
const Array< R > &  right,
Array< RES > &  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 >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( const Array< L > &  left,
right,
Array< RES > &  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 >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( left,
const Array< R > &  right,
Array< RES > &  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 >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransform ( const Array< T > &  arr,
Array< RES > &  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 >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace ( Array< L > &  left,
const Array< R > &  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 320 of file ArrayMath.h.

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

template<typename L , typename R , typename BinaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace ( Array< L > &  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).

transformInPlace (left.cbegin(), left.cend(), bind2nd(op, right));

transformInPlace (left.begin(), left.end(), bind2nd(op, right));

Definition at line 333 of file ArrayMath.h.

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

template<typename T , typename UnaryOperator >
void casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformInPlace ( Array< T > &  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 348 of file ArrayMath.h.

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

template<typename T , typename BinaryOperator >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( const Array< T > &  left,
const Array< T > &  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 >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( const Array< T > &  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 >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( left,
const Array< T > &  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 >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::arrayTransformResult ( const Array< T > &  arr,
UnaryOperator  op 
)

Transform array to a result using the unary operator.

The created and returned result array is contiguous.

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::atan2 ( const Array< T > &  y,
const Array< T > &  x 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::atan2 ( const T &  y,
const Array< T > &  x 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::atan2 ( const Array< T > &  y,
const T &  x 
)

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<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::avdev ( const Array< T > &  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.

void casa::ArrayMath_global_functions_Array_mathematical_operations::checkArrayShapes ( const ArrayBase left,
const ArrayBase right,
const char *  name 
) [inline]

Definition at line 187 of file ArrayMath.h.

References casa::IPosition::isEqual(), and casa::ArrayBase::shape().

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.

Modify the array "rarray" in place.

"rarray" must be the correct shape.

Returns the complex conjugate of a complex array.

void casa::ArrayMath_global_functions_Array_mathematical_operations::conj ( Array< Complex > &  rarray,
const Array< Complex > &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casa::ArrayMath_global_functions_Array_mathematical_operations::conj ( Array< DComplex > &  rarray,
const Array< DComplex > &  carray 
)
template<class T , class U >
void casa::ArrayMath_global_functions_Array_mathematical_operations::convertArray ( Array< T > &  to,
const Array< U > &  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.

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

Works on an element-by-element basis.

Returns an array where every element is cubed.

N.B.

fabs is deprecated. Use abs.

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::fmod ( const Array< T > &  a,
const Array< T > &  b 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::fmod ( const T &  a,
const Array< T > &  b 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::fmod ( const Array< T > &  a,
const T &  b 
)
template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::fractile ( const Array< T > &  a,
Float  fraction,
Bool  sorted = False,
Bool  inPlace = False 
) [inline]

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;

Definition at line 679 of file ArrayMath.h.

References fractile().

Referenced by fractile().

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::fractile ( const Array< T > &  a,
Block< T > &  tmp,
Float  fraction,
Bool  sorted = False,
Bool  inPlace = False 
)

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

void casa::ArrayMath_global_functions_Array_mathematical_operations::imag ( Array< Float > &  rarray,
const Array< Complex > &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casa::ArrayMath_global_functions_Array_mathematical_operations::imag ( Array< Double > &  rarray,
const Array< DComplex > &  carray 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::indgen ( Array< T > &  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.

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

The first axis varies most rapidly.

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::indgen ( Array< T > &  a,
start 
)

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.

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

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

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

The maximum element of the array.

Requires that the type "T" has comparison operators.

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::max ( Array< T > &  result,
const Array< T > &  a,
const Array< T > &  b 
)

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

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

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::max ( const Array< T > &  a,
const Array< T > &  b 
)

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

"a" and "b" must be conformant.

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::max ( const T &  a,
const Array< T > &  b 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::max ( Array< T > &  result,
const Array< T > &  a,
const T &  b 
)

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

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

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::max ( Array< T > &  result,
const T &  a,
const Array< T > &  b 
) [inline]

Definition at line 558 of file ArrayMath.h.

References max().

Referenced by max().

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::max ( const Array< T > &  a,
const T &  b 
)

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

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::max ( const T &  a,
const Array< T > &  b 
) [inline]

Definition at line 570 of file ArrayMath.h.

References max().

Referenced by max().

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

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T > &  a) [inline]

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;

Definition at line 658 of file ArrayMath.h.

References casa::False, median(), and casa::ArrayBase::nelements().

Referenced by median().

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T > &  a,
Bool  sorted 
) [inline]

Definition at line 660 of file ArrayMath.h.

References casa::False, median(), and casa::ArrayBase::nelements().

Referenced by median().

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T > &  a,
Bool  sorted,
Bool  takeEvenMean,
Bool  inPlace = False 
) [inline]

Definition at line 665 of file ArrayMath.h.

References median().

Referenced by median().

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::median ( const Array< T > &  a,
Block< T > &  tmp,
Bool  sorted,
Bool  takeEvenMean,
Bool  inPlace = False 
)
template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::medianInPlace ( const Array< T > &  a,
Bool  sorted = False 
) [inline]

Definition at line 662 of file ArrayMath.h.

References casa::median(), casa::ArrayBase::nelements(), and casa::True.

The minimum element of the array.

Requires that the type "T" has comparison operators.

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::min ( Array< T > &  result,
const Array< T > &  a,
const Array< T > &  b 
)

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

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

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::min ( const Array< T > &  a,
const Array< T > &  b 
)

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

"a" and "b" must be conformant.

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::min ( Array< T > &  result,
const Array< T > &  a,
const T &  b 
)

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

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

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::min ( Array< T > &  result,
const T &  a,
const Array< T > &  b 
) [inline]

Definition at line 565 of file ArrayMath.h.

References min().

Referenced by min().

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::min ( const Array< T > &  a,
const T &  b 
)

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

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::min ( const T &  a,
const Array< T > &  b 
) [inline]

Definition at line 574 of file ArrayMath.h.

References min().

Referenced by min().

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

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

template<class ScalarType >
void casa::ArrayMath_global_functions_Array_mathematical_operations::minMax ( ScalarType &  minVal,
ScalarType &  maxVal,
IPosition minPos,
IPosition maxPos,
const Array< ScalarType > &  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<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::minMax ( T &  min,
T &  max,
const Array< T > &  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<class ScalarType >
void casa::ArrayMath_global_functions_Array_mathematical_operations::minMaxMasked ( ScalarType &  minVal,
ScalarType &  maxVal,
IPosition minPos,
IPosition maxPos,
const Array< ScalarType > &  array,
const Array< ScalarType > &  weight 
)

The array * weight is searched.

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

sequence OP= scalar

Definition at line 174 of file ArrayMath.h.

template<typename _InputIterator1 , typename T , typename _OutputIterator , typename _BinaryOperation >
void casa::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 Complex array and Complex scalar would fail (see g++ bug 39678).

sequence = scalar OP sequence

Definition at line 152 of file ArrayMath.h.

template<typename _InputIterator1 , typename T , typename _OutputIterator , typename _BinaryOperation >
void casa::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 163 of file ArrayMath.h.

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator% ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator% ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator% ( const T &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator%= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator%= ( Array< T > &  left,
const T &  other 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator& ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator& ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator& ( const T &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator&= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator&= ( Array< T > &  left,
const T &  other 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const T &  left,
const Array< T > &  right 
)
template<typename T >
Array<std::complex<T> > casa::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< std::complex< T > > &  left,
const Array< T > &  right 
)
template<typename T >
Array<std::complex<T> > casa::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const Array< std::complex< T > > &  left,
const T &  right 
)
template<typename T >
Array<std::complex<T> > casa::ArrayMath_global_functions_Array_mathematical_operations::operator* ( const std::complex< T > &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< T > &  left,
const T &  other 
)
template<typename T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< std::complex< T > > &  left,
const Array< T > &  other 
)

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

Note that Complex and DComplex are typedefs for std::complex.

template<typename T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator*= ( Array< std::complex< T > > &  left,
const T &  other 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const Array< T > &  a)

Unary arithmetic operation.

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const Array< T > &  left,
const Array< T > &  right 
)

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

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const Array< T > &  left,
const T &  right 
)

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

template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator+ ( const T &  left,
const Array< T > &  right 
)

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

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator+= ( Array< T > &  left,
const Array< T > &  other 
)

Element by element arithmetic modifying left in-place.

left and other must be conformant.

template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator+= ( Array< T > &  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<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const Array< T > &  a)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator- ( const T &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator-= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator-= ( Array< T > &  left,
const T &  other 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const T &  left,
const Array< T > &  right 
)
template<typename T >
Array<std::complex<T> > casa::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< std::complex< T > > &  left,
const Array< T > &  right 
)
template<typename T >
Array<std::complex<T> > casa::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const Array< std::complex< T > > &  left,
const T &  right 
)
template<typename T >
Array<std::complex<T> > casa::ArrayMath_global_functions_Array_mathematical_operations::operator/ ( const std::complex< T > &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< T > &  left,
const T &  other 
)
template<typename T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< std::complex< T > > &  left,
const Array< T > &  other 
)
template<typename T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator/= ( Array< std::complex< T > > &  left,
const T &  other 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator^ ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator^ ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator^ ( const T &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator^= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator^= ( Array< T > &  left,
const T &  other 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator| ( const Array< T > &  left,
const Array< T > &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator| ( const Array< T > &  left,
const T &  right 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::operator| ( const T &  left,
const Array< T > &  right 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator|= ( Array< T > &  left,
const Array< T > &  other 
)
template<class T >
void casa::ArrayMath_global_functions_Array_mathematical_operations::operator|= ( Array< T > &  left,
const T &  other 
)

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.

void casa::ArrayMath_global_functions_Array_mathematical_operations::phase ( Array< Float > &  rarray,
const Array< Complex > &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casa::ArrayMath_global_functions_Array_mathematical_operations::phase ( Array< Double > &  rarray,
const Array< DComplex > &  carray 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::pow ( const Array< T > &  a,
const Array< T > &  b 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::pow ( const T &  a,
const Array< T > &  b 
)
template<class T >
Array<T> casa::ArrayMath_global_functions_Array_mathematical_operations::pow ( const Array< T > &  a,
const Double b 
)

Product of every element of the array.

This could of course easily overflow.

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

void casa::ArrayMath_global_functions_Array_mathematical_operations::real ( Array< Float > &  rarray,
const Array< Complex > &  carray 
)

Modifies rarray in place.

rarray must be conformant.

void casa::ArrayMath_global_functions_Array_mathematical_operations::real ( Array< Double > &  rarray,
const Array< DComplex > &  carray 
)

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.

Modify the array "carray" in place.

"carray" must be the correct shape.

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

template<typename R , typename L >
void casa::ArrayMath_global_functions_Array_mathematical_operations::setImag ( Array< R > &  carray,
const Array< L > &  rarray 
)

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

template<typename L , typename R >
void casa::ArrayMath_global_functions_Array_mathematical_operations::setReal ( Array< L > &  carray,
const Array< R > &  rarray 
)

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

Returns an array where every element is squared.

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

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::stddev ( const Array< T > &  a,
mean 
)

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

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

Sum of every element of the array.

Function to check the shapes.

It throws an exception if not equal.

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

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

template<class T >
T casa::ArrayMath_global_functions_Array_mathematical_operations::variance ( const Array< T > &  a,
mean 
)

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

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


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