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

Basic functions and classes for math on MArray objects. More...

#include <MArrayMathBase.h>

Classes

class  MArrayFunctorBase
 Define the base class for functors to perform a reduction function on an MArray object. More...
 

Public Member Functions

template<typename T , typename ARRAYITER , typename MASKITER , typename OPER >
accumulateMasked (ARRAYITER abegin, ARRAYITER aend, MASKITER mbegin, OPER oper)
 Define STL-like accumulate function operating on arrays with masks. More...
 
template<typename T , typename ARRAYITER , typename MASKITER , typename OPER >
accumulateMasked (ARRAYITER abegin, ARRAYITER aend, MASKITER mbegin, T accum, OPER oper)
 The second function uses an externally initialized accumulator (e.g. More...
 
template<typename T , typename ARRAYITER , typename MASKITER >
size_t countMasked (ARRAYITER abegin, ARRAYITER aend, MASKITER mbegin, const T &value)
 Count the number of unmasked values matching the given value. More...
 
template<typename T , typename ARRAYITER , typename MASKITER >
size_t countNEMasked (ARRAYITER abegin, ARRAYITER aend, MASKITER mbegin, const T &value)
 Count the number of unmasked values not matching the given value. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool compareAllMasked (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, MaskIterator mask1, MaskIterator mask2, CompareOperator op)
 Define a function to compare the unmasked elements of two sequences. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool compareAllMasked (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, MaskIterator mask1, CompareOperator op)
 
template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool compareAllLeftMasked (InputIterator1 first1, InputIterator1 last1, T left, MaskIterator mask1, CompareOperator op)
 For use with a constant left value. More...
 
template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool compareAllRightMasked (InputIterator1 first1, InputIterator1 last1, T right, MaskIterator mask1, CompareOperator op)
 For use with a constant right value. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool compareAnyMasked (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, MaskIterator mask1, MaskIterator mask2, CompareOperator op)
 Define a function to compare the unmasked elements of two sequences. More...
 
template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool compareAnyMasked (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, MaskIterator mask1, CompareOperator op)
 
template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool compareAnyLeftMasked (InputIterator1 first1, InputIterator1 last1, T left, MaskIterator mask1, CompareOperator op)
 For use with a constant left value. More...
 
template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool compareAnyRightMasked (InputIterator1 first1, InputIterator1 last1, T right, MaskIterator mask1, CompareOperator op)
 For use with a constant right value. More...
 

Detailed Description

Basic functions and classes for math on MArray objects.

Review Status

Reviewed By:
UNKNOWN
Test programs:
tMArrayMath

Prerequisite

Synopsis

This header file defines several STL-like functions to work on iterators with a mask.

Furthermore, abstract base classes are defined for functors to be used in functions like slidingXXX. Virtual functions instead of templated functions are used to avoid code bloat when used in functions like partialArrayMath. Because a reduction operation usually takes much more time than the call, using virtual functions hardly imposes a performance penalty.

Definition at line 65 of file MArrayMathBase.h.

Member Function Documentation

template<typename T , typename ARRAYITER , typename MASKITER , typename OPER >
T casacore::MArrayMathBase_global_functions_Array_basic_functions::accumulateMasked ( ARRAYITER  abegin,
ARRAYITER  aend,
MASKITER  mbegin,
OPER  oper 
)
inline

Define STL-like accumulate function operating on arrays with masks.

A mask value True means masked-off, thus is not taken into account.


The first function initializes the accumulator to the first unmasked value. This is useful if it is not possible to initialize it externally (e.g. for a function like min).

Definition at line 73 of file MArrayMathBase.h.

template<typename T , typename ARRAYITER , typename MASKITER , typename OPER >
T casacore::MArrayMathBase_global_functions_Array_basic_functions::accumulateMasked ( ARRAYITER  abegin,
ARRAYITER  aend,
MASKITER  mbegin,
accum,
OPER  oper 
)
inline

The second function uses an externally initialized accumulator (e.g.

needed for sum).

Definition at line 89 of file MArrayMathBase.h.

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAllLeftMasked ( InputIterator1  first1,
InputIterator1  last1,
left,
MaskIterator  mask1,
CompareOperator  op 
)
inline

For use with a constant left value.

This avoids use of bind1st or bind2nd which can fail for gcc-4.3. (see ArrayMath.h).

Definition at line 163 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAllMasked ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
MaskIterator  mask1,
MaskIterator  mask2,
CompareOperator  op 
)
inline

Define a function to compare the unmasked elements of two sequences.

It returns true if all unmasked elements compare true or if there are no unmasked elements. An example compare operator is std::equal_to.

Definition at line 132 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAllMasked ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
MaskIterator  mask1,
CompareOperator  op 
)
inline

Definition at line 146 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAllRightMasked ( InputIterator1  first1,
InputIterator1  last1,
right,
MaskIterator  mask1,
CompareOperator  op 
)
inline

For use with a constant right value.

This avoids use of bind1st or bind2nd which can fail for gcc-4.3. (see ArrayMath.h).

Definition at line 179 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAnyLeftMasked ( InputIterator1  first1,
InputIterator1  last1,
left,
MaskIterator  mask1,
CompareOperator  op 
)
inline

For use with a constant left value.

This avoids use of bind1st or bind2nd which can fail for gcc-4.3. (see ArrayMath.h).

Definition at line 230 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAnyMasked ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
MaskIterator  mask1,
MaskIterator  mask2,
CompareOperator  op 
)
inline

Define a function to compare the unmasked elements of two sequences.

It returns true if any element compares true. If there are no unmasked elements, it returns False. An example compare operator is std::equal_to.

Definition at line 199 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename InputIterator2 , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAnyMasked ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2,
MaskIterator  mask1,
CompareOperator  op 
)
inline

Definition at line 213 of file MArrayMathBase.h.

References casacore::False.

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAnyRightMasked ( InputIterator1  first1,
InputIterator1  last1,
right,
MaskIterator  mask1,
CompareOperator  op 
)
inline

For use with a constant right value.

This avoids use of bind1st or bind2nd which can fail for gcc-4.3. (see ArrayMath.h).

Definition at line 246 of file MArrayMathBase.h.

References casacore::False.

template<typename T , typename ARRAYITER , typename MASKITER >
size_t casacore::MArrayMathBase_global_functions_Array_basic_functions::countMasked ( ARRAYITER  abegin,
ARRAYITER  aend,
MASKITER  mbegin,
const T &  value 
)
inline

Count the number of unmasked values matching the given value.

It is similar to std::count, but a mask is applied.

Definition at line 102 of file MArrayMathBase.h.

template<typename T , typename ARRAYITER , typename MASKITER >
size_t casacore::MArrayMathBase_global_functions_Array_basic_functions::countNEMasked ( ARRAYITER  abegin,
ARRAYITER  aend,
MASKITER  mbegin,
const T &  value 
)
inline

Count the number of unmasked values not matching the given value.

It is similar to std::count, but a mask is applied.

Definition at line 115 of file MArrayMathBase.h.


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