Go to the documentation of this file.
28 #ifndef CASA_MASKEDARRAY_H
29 #define CASA_MASKEDARRAY_H
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/IPosition.h>
35 #include <casacore/casa/Utilities/CountedPtr.h>
36 #include <casacore/casa/Arrays/LogiArrayFwd.h>
37 #include <casacore/casa/Arrays/MaskLogiArrFwd.h>
47 template <
class T>
class Array;
325 template<
class T>
class MaskedArray
338 void setData(
const Array<T> & data,
const LogicalArray &
mask,
359 MaskedArray(
const Array<T> &inarray,
const LogicalArray &inmask,
361 MaskedArray(
const Array<T> &inarray,
const LogicalArray &inmask);
385 MaskedArray(
const MaskedArray<T> &inarray,
const LogicalArray &inmask,
387 MaskedArray(
const MaskedArray<T> &inarray,
const LogicalArray &inmask);
408 MaskedArray(
const Array<T> &inarray,
const MaskedLogicalArray &inmask,
410 MaskedArray(
const Array<T> &inarray,
const MaskedLogicalArray &inmask);
436 const MaskedLogicalArray &inmask,
439 const MaskedLogicalArray &inmask);
487 MaskedArray<T>
operator()(
const IPosition &start,
const IPosition &end);
489 MaskedArray<T>
operator()(
const IPosition &start,
const IPosition &end,
490 const IPosition &inc);
509 MaskedArray<T>
copy(
Bool isreadonly)
const;
510 MaskedArray<T>
copy()
const;
525 const LogicalArray &
getMask()
const;
556 {
return pArray->shape(); }
723 template<
class T,
class U>
725 template<
class T,
class U>
727 template<
class T,
class U>
737 #ifndef CASACORE_NO_AUTO_TEMPLATES
738 #include <casacore/casa/Arrays/MaskedArray.tcc>
739 #endif //# CASACORE_NO_AUTO_TEMPLATES
uInt nelements() const
The number of elements of this masked array.
uInt nelementsValid() const
The number of valid elements of this masked array.
A Vector of integers, for indexing into Array<T> objects.
Bool conform(const Array< T > &other) const
Are the shapes identical?
const LogicalArray & getMask() const
Return the (const) internal Mask.
void putArrayStorage(T *&storage, Bool deleteAndCopy) const
Bool isReadOnly() const
Is the array read only?
Array< T > * pArray
The array.
Array< T > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the MaskedArray.
void freeArrayStorage(const T *&storage, Bool deleteIt) const
void setReadOnly() const
Set the array to be read only.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
const IPosition & shape() const
The length of each axis.
Bool isRO
Is the array read only?
T * getRWArrayStorage(Bool &deleteIt) const
MaskedArray< T > operator()(const LogicalArray &mask) const
Return a MaskedArray.
MaskedArray< T > & operator=(const Array< T > &inarray)
Copy the values in inarray to this, only copying those elements for which the corresponding mask elem...
void setData(const Array< T > &data, const LogicalArray &mask, Bool isReadOnly=False)
Reset the data and mask of the the MaskedArray.
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask.
this file contains all the compiler specific defines
Bool nelemValidIsOK
Is the number of valid elements cache OK? i.e.
General global functions for MaskedArrays, and MaskedArrays and Arrays.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Bool ok() const
Check to see if the masked array is consistent.
void freeMaskStorage(const LogicalArrayElem *&storage, Bool deleteIt) const
Class for masking an Array for operations on that Array.
uInt nelemValid
Cache the number of valid elements.
const T * getArrayStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Array.
uInt ndim() const
The dimensionality of this masked array.
void setCompressedArray(const Array< T > &inarr)
Set only the valid elements of the MaskedArray from the argument "compressed" Array.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
const Array< T > & getArray() const
Return the internal Array.
template <class T, class U> class vector;
Array< T > & getRWArray() const
Return the internal Array, writeable.
MaskedArray< T > copy() const
LogicalArray * pMask
The mask.
bool Bool
Define the standard types used by Casacore.
const LogicalArrayElem * getMaskStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Mask.
Bool conform2(const MaskedArray< T > &left, const Array< U > &right)
Test conformance for masked arrays and arrays of different types.