casacore
Loading...
Searching...
No Matches
casacore::MArrayMathBase_global_functions_Array_basic_functions Struct Reference

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 

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 63 of file MArrayMathBase.h.

Member Function Documentation

◆ accumulateMasked() [1/2]

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 71 of file MArrayMathBase.h.

◆ accumulateMasked() [2/2]

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

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

needed for sum).

Definition at line 87 of file MArrayMathBase.h.

◆ compareAllLeftMasked()

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAllLeftMasked ( InputIterator1 first1,
InputIterator1 last1,
T 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 161 of file MArrayMathBase.h.

References casacore::False.

◆ compareAllMasked() [1/2]

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 144 of file MArrayMathBase.h.

References casacore::False.

◆ compareAllMasked() [2/2]

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 130 of file MArrayMathBase.h.

References casacore::False.

◆ compareAllRightMasked()

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAllRightMasked ( InputIterator1 first1,
InputIterator1 last1,
T 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 177 of file MArrayMathBase.h.

References casacore::False.

◆ compareAnyLeftMasked()

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAnyLeftMasked ( InputIterator1 first1,
InputIterator1 last1,
T 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 228 of file MArrayMathBase.h.

References casacore::False.

◆ compareAnyMasked() [1/2]

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 211 of file MArrayMathBase.h.

References casacore::False.

◆ compareAnyMasked() [2/2]

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 197 of file MArrayMathBase.h.

References casacore::False.

◆ compareAnyRightMasked()

template<typename InputIterator1 , typename T , typename MaskIterator , typename CompareOperator >
bool casacore::MArrayMathBase_global_functions_Array_basic_functions::compareAnyRightMasked ( InputIterator1 first1,
InputIterator1 last1,
T 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 244 of file MArrayMathBase.h.

References casacore::False.

◆ countMasked()

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 100 of file MArrayMathBase.h.

References casacore::value().

◆ countNEMasked()

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 113 of file MArrayMathBase.h.

References casacore::value().


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