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

More...

#include <MArrayLogical.h>

Classes

class  MAllFunc
 
class  MAnyFunc
 
class  MNFalseFunc
 
class  MNTrueFunc
 Define functors to perform a reduction function on an MArray object. More...
 

Public Member Functions

template<typename T >
MArray< Booloperator== (const MArray< T > &left, const MArray< T > &right)
 Define comparison functions between 2 MArray objects and between MArray object and scalar.
 
template<typename T >
MArray< Booloperator<= (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator< (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator>= (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator> (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator!= (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator|| (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator&& (const MArray< T > &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator== (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator<= (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator< (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator>= (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator> (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator!= (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator|| (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator&& (const MArray< T > &left, const T &right)
 
template<typename T >
MArray< Booloperator== (const T &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator<= (const T &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator< (const T &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator>= (const T &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator> (const T &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator!= (const T &left, const MArray< T > &right)
 
template<typename T >
MArray< Booloperator|| (const T &left, const MArray< T > &right)
 The logical OR of 2 MArray objects (normally Bool type)
 
template<typename T >
MArray< Booloperator&& (const T &left, const MArray< T > &right)
 The logical AND of 2 MArray objects (normally Bool type).
 
template<typename T >
MArray< Booloperator! (const MArray< T > &a)
 The logical NOT of an MArray object (normally Bool type).
 
template<typename T >
MArray< Boolnear (const MArray< T > &left, const MArray< T > &right, Double tol)
 Compare with a given relative or absolute tolerance.
 
template<typename T >
MArray< BoolnearAbs (const MArray< T > &left, const MArray< T > &right, Double tol)
 
template<typename T >
MArray< Boolnear (const MArray< T > &left, const T &right, Double tol)
 
template<typename T >
MArray< BoolnearAbs (const MArray< T > &left, const T &right, Double tol)
 
template<typename T >
MArray< Boolnear (const T &left, const MArray< T > &right, Double tol)
 
template<typename T >
MArray< BoolnearAbs (const T &left, const MArray< T > &right, Double tol)
 
template<typename T >
MArray< BoolisNaN (const MArray< T > &arr)
 Test which elements are NaN.
 
template<typename T >
MArray< BoolisInf (const MArray< T > &arr)
 Test which elements are infinite.
 
template<typename T >
MArray< BoolisFinite (const MArray< T > &arr)
 Test which elements have a finite value.
 
template<typename T >
Bool allEQ (const MArray< T > &left, const MArray< T > &right)
 Are all unmasked elements equal? The result is True if there are no unmasked elements.
 
template<typename T >
Bool allEQ (const MArray< T > &array, const T &value)
 
template<typename T >
Bool allEQ (const T &value, const MArray< T > &array)
 
template<typename T >
Bool anyEQ (const MArray< T > &left, const MArray< T > &right)
 Is any unmasked element equal? The result is False if there are no unmasked elements.
 
template<typename T >
Bool anyEQ (const MArray< T > &array, const T &value)
 
template<typename T >
Bool anyEQ (const T &value, const MArray< T > &array)
 
Bool allTrue (const MArray< Bool > &array)
 Are all unmasked elements true?
 
Bool anyTrue (const MArray< Bool > &array)
 Is any unmasked element true?
 
template<typename T >
size_t ntrue (const MArray< T > &a)
 Count the number of unmasked elements that are True.
 
template<typename T >
size_t nfalse (const MArray< T > &a)
 Count the number of unmasked elements that are False.
 
template<typename T >
MArray< size_t > partialNTrue (const MArray< T > &a, const IPosition &collapseAxes)
 Get partial ntrues.
 
template<typename T >
MArray< size_t > partialNFalse (const MArray< T > &a, const IPosition &collapseAxes)
 Get partial nfalses.
 
template<typename T >
MArray< BoolpartialAlls (const MArray< T > &a, const IPosition &collapseAxes)
 Get partial all.
 
template<typename T >
MArray< BoolpartialAnys (const MArray< T > &a, const IPosition &collapseAxes)
 Get partial any.
 
template<typename T >
MArray< uIntslidingNTrue (const MArray< T > &a, const IPosition &halfBoxSize, Bool fillEdge=True)
 Get sliding ntrues.
 
template<typename T >
MArray< uIntslidingNFalse (const MArray< T > &a, const IPosition &halfBoxSize, Bool fillEdge=True)
 Get sliding nfalses.
 
template<typename T >
MArray< BoolslidingAlls (const MArray< T > &a, const IPosition &halfBoxSize, Bool fillEdge=True)
 Get sliding all.
 
template<typename T >
MArray< BoolslidingAnys (const MArray< T > &a, const IPosition &halfBoxSize, Bool fillEdge=True)
 Get sliding any.
 
template<typename T >
MArray< uIntboxedNTrue (const MArray< T > &a, const IPosition &boxSize)
 Get boxed ntrues.
 
template<typename T >
MArray< uIntboxedNFalse (const MArray< T > &a, const IPosition &boxSize)
 Get boxed nfalses.
 
template<typename T >
MArray< BoolboxedAlls (const MArray< T > &a, const IPosition &boxSize)
 Get boxed all.
 
template<typename T >
MArray< BoolboxedAnys (const MArray< T > &a, const IPosition &boxSize)
 Get boxed any.
 

Detailed Description

Logical operations for MArray objects.

Review Status

Reviewed By:
UNKNOWN
Test programs:
tMArrayMath

Prerequisite

Synopsis

These functions perform element by element logical operations on optionally masked arrays and/or scalars. If two arrays are used, the arrays must conform, except for allEQ which returns False if the arrays do not conform.

The functions in this file can be divided in 3 groups:

  • Full array operations like ==, near, etc. They are defined for array-array and array-scalar operations. Arrays shapes have to be conformant. They operate on all elements (also the masked ones). The result is an MArray with the same shape as the input array(s). It will have a mask if one of the operands has a mask. If both operands have a mask, the resulting mask is the OR of both masks.
  • Full reduction functions like ntrue, all, allEQ, etc. They operate on the unmasked elements only. If there are no unmasked elements, the results is 0 or True.
  • Reduction functions working on unmasked elements in parts of the input array. The result is an MArray that has a mask if the input array has a mask. An output element is masked off if its input part has no unmasked elements. The functors defined at the beginning of this file are used to operate on each part. There are 3 flavours:
    • partialXXX reduces one or more axes. E.g. one can count the number of True elements for particular array axes. The result is an array with a lower dimensionality. They can be seen as a special versions of the boxedXXX functions.
    • slidingXXX operates in a sliding window over the array. So the result is an array with the same shape as the input, although the output array is smaller if the edge is not filled.
    • boxedXXX divides the input array in boxes with the given size and operates on each box. The result is an array with the same dimensionality, but with a smaller size. If the box size does not fit integrally, the edge box is smaller.


Definition at line 90 of file MArrayLogical.h.

Member Function Documentation

◆ allEQ() [1/3]

template<typename T >
Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::allEQ ( const MArray< T > & array,
const T & value )
inline

◆ allEQ() [2/3]

template<typename T >
Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::allEQ ( const MArray< T > & left,
const MArray< T > & right )
inline

Are all unmasked elements equal? The result is True if there are no unmasked elements.

Definition at line 300 of file MArrayLogical.h.

References allEQ(), and casacore::False.

Referenced by allEQ(), allEQ(), allEQ(), and allTrue().

◆ allEQ() [3/3]

template<typename T >
Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::allEQ ( const T & value,
const MArray< T > & array )
inline

Definition at line 329 of file MArrayLogical.h.

References allEQ(), casacore::array(), and casacore::value().

◆ allTrue()

Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::allTrue ( const MArray< Bool > & array)
inline

◆ anyEQ() [1/3]

template<typename T >
Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::anyEQ ( const MArray< T > & array,
const T & value )
inline

◆ anyEQ() [2/3]

template<typename T >
Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::anyEQ ( const MArray< T > & left,
const MArray< T > & right )
inline

Is any unmasked element equal? The result is False if there are no unmasked elements.

Definition at line 337 of file MArrayLogical.h.

References anyEQ(), and casacore::False.

Referenced by anyEQ(), anyEQ(), anyEQ(), and anyTrue().

◆ anyEQ() [3/3]

template<typename T >
Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::anyEQ ( const T & value,
const MArray< T > & array )
inline

Definition at line 366 of file MArrayLogical.h.

References anyEQ(), casacore::array(), and casacore::value().

◆ anyTrue()

Bool casacore::MArrayLogical_global_functions_MArray_logical_operations::anyTrue ( const MArray< Bool > & array)
inline

◆ boxedAlls()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::boxedAlls ( const MArray< T > & a,
const IPosition & boxSize )
inline

◆ boxedAnys()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::boxedAnys ( const MArray< T > & a,
const IPosition & boxSize )
inline

◆ boxedNFalse()

template<typename T >
MArray< uInt > casacore::MArrayLogical_global_functions_MArray_logical_operations::boxedNFalse ( const MArray< T > & a,
const IPosition & boxSize )
inline

◆ boxedNTrue()

template<typename T >
MArray< uInt > casacore::MArrayLogical_global_functions_MArray_logical_operations::boxedNTrue ( const MArray< T > & a,
const IPosition & boxSize )
inline

◆ isFinite()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::isFinite ( const MArray< T > & arr)
inline

Test which elements have a finite value.

Definition at line 292 of file MArrayLogical.h.

References casacore::MArray< T >::array(), and isFinite().

Referenced by isFinite().

◆ isInf()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::isInf ( const MArray< T > & arr)
inline

Test which elements are infinite.

Definition at line 287 of file MArrayLogical.h.

References casacore::MArray< T >::array(), and isInf().

Referenced by isInf().

◆ isNaN()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::isNaN ( const MArray< T > & arr)
inline

Test which elements are NaN.

Definition at line 282 of file MArrayLogical.h.

References casacore::MArray< T >::array(), and isNaN().

Referenced by isNaN().

◆ near() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::near ( const MArray< T > & left,
const MArray< T > & right,
Double tol )
inline

Compare with a given relative or absolute tolerance.

Definition at line 245 of file MArrayLogical.h.

References casacore::MArrayBase::combineMask(), and near().

Referenced by near(), near(), and near().

◆ near() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::near ( const MArray< T > & left,
const T & right,
Double tol )
inline

Definition at line 259 of file MArrayLogical.h.

References near().

◆ near() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::near ( const T & left,
const MArray< T > & right,
Double tol )
inline

Definition at line 269 of file MArrayLogical.h.

References near().

◆ nearAbs() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::nearAbs ( const MArray< T > & left,
const MArray< T > & right,
Double tol )
inline

Definition at line 252 of file MArrayLogical.h.

References casacore::MArrayBase::combineMask(), and nearAbs().

Referenced by nearAbs(), nearAbs(), and nearAbs().

◆ nearAbs() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::nearAbs ( const MArray< T > & left,
const T & right,
Double tol )
inline

Definition at line 264 of file MArrayLogical.h.

References nearAbs().

◆ nearAbs() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::nearAbs ( const T & left,
const MArray< T > & right,
Double tol )
inline

Definition at line 274 of file MArrayLogical.h.

References nearAbs().

◆ nfalse()

template<typename T >
size_t casacore::MArrayLogical_global_functions_MArray_logical_operations::nfalse ( const MArray< T > & a)
inline

◆ ntrue()

template<typename T >
size_t casacore::MArrayLogical_global_functions_MArray_logical_operations::ntrue ( const MArray< T > & a)
inline

◆ operator!()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator! ( const MArray< T > & a)
inline

The logical NOT of an MArray object (normally Bool type).

Definition at line 238 of file MArrayLogical.h.

References casacore::MArray< T >::array().

◆ operator!=() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator!= ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 152 of file MArrayLogical.h.

◆ operator!=() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator!= ( const MArray< T > & left,
const T & right )
inline

Definition at line 190 of file MArrayLogical.h.

◆ operator!=() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator!= ( const T & left,
const MArray< T > & right )
inline

Definition at line 222 of file MArrayLogical.h.

◆ operator&&() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator&& ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 164 of file MArrayLogical.h.

◆ operator&&() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator&& ( const MArray< T > & left,
const T & right )
inline

Definition at line 198 of file MArrayLogical.h.

◆ operator&&() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator&& ( const T & left,
const MArray< T > & right )
inline

The logical AND of 2 MArray objects (normally Bool type).

Definition at line 233 of file MArrayLogical.h.

◆ operator<() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator< ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 122 of file MArrayLogical.h.

◆ operator<() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator< ( const MArray< T > & left,
const T & right )
inline

Definition at line 170 of file MArrayLogical.h.

◆ operator<() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator< ( const T & left,
const MArray< T > & right )
inline

Definition at line 202 of file MArrayLogical.h.

◆ operator<=() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator<= ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 122 of file MArrayLogical.h.

◆ operator<=() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator<= ( const MArray< T > & left,
const T & right )
inline

Definition at line 170 of file MArrayLogical.h.

◆ operator<=() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator<= ( const T & left,
const MArray< T > & right )
inline

Definition at line 202 of file MArrayLogical.h.

◆ operator==() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator== ( const MArray< T > & left,
const MArray< T > & right )
inline

Define comparison functions between 2 MArray objects and between MArray object and scalar.

Definition at line 122 of file MArrayLogical.h.

◆ operator==() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator== ( const MArray< T > & left,
const T & right )
inline

Definition at line 170 of file MArrayLogical.h.

◆ operator==() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator== ( const T & left,
const MArray< T > & right )
inline

Definition at line 202 of file MArrayLogical.h.

◆ operator>() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator> ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 146 of file MArrayLogical.h.

◆ operator>() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator> ( const MArray< T > & left,
const T & right )
inline

Definition at line 186 of file MArrayLogical.h.

◆ operator>() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator> ( const T & left,
const MArray< T > & right )
inline

Definition at line 218 of file MArrayLogical.h.

◆ operator>=() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator>= ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 140 of file MArrayLogical.h.

◆ operator>=() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator>= ( const MArray< T > & left,
const T & right )
inline

Definition at line 182 of file MArrayLogical.h.

◆ operator>=() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator>= ( const T & left,
const MArray< T > & right )
inline

Definition at line 214 of file MArrayLogical.h.

◆ operator||() [1/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator|| ( const MArray< T > & left,
const MArray< T > & right )
inline

Definition at line 158 of file MArrayLogical.h.

◆ operator||() [2/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator|| ( const MArray< T > & left,
const T & right )
inline

Definition at line 194 of file MArrayLogical.h.

◆ operator||() [3/3]

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::operator|| ( const T & left,
const MArray< T > & right )
inline

The logical OR of 2 MArray objects (normally Bool type)

Definition at line 228 of file MArrayLogical.h.

◆ partialAlls()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::partialAlls ( const MArray< T > & a,
const IPosition & collapseAxes )
inline

◆ partialAnys()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::partialAnys ( const MArray< T > & a,
const IPosition & collapseAxes )
inline

◆ partialNFalse()

template<typename T >
MArray< size_t > casacore::MArrayLogical_global_functions_MArray_logical_operations::partialNFalse ( const MArray< T > & a,
const IPosition & collapseAxes )
inline

◆ partialNTrue()

template<typename T >
MArray< size_t > casacore::MArrayLogical_global_functions_MArray_logical_operations::partialNTrue ( const MArray< T > & a,
const IPosition & collapseAxes )
inline

◆ slidingAlls()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::slidingAlls ( const MArray< T > & a,
const IPosition & halfBoxSize,
Bool fillEdge = True )
inline

◆ slidingAnys()

template<typename T >
MArray< Bool > casacore::MArrayLogical_global_functions_MArray_logical_operations::slidingAnys ( const MArray< T > & a,
const IPosition & halfBoxSize,
Bool fillEdge = True )
inline

◆ slidingNFalse()

template<typename T >
MArray< uInt > casacore::MArrayLogical_global_functions_MArray_logical_operations::slidingNFalse ( const MArray< T > & a,
const IPosition & halfBoxSize,
Bool fillEdge = True )
inline

◆ slidingNTrue()

template<typename T >
MArray< uInt > casacore::MArrayLogical_global_functions_MArray_logical_operations::slidingNTrue ( const MArray< T > & a,
const IPosition & halfBoxSize,
Bool fillEdge = True )
inline

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