28 #ifndef CASA_MASKEDARRAY2_H
29 #define CASA_MASKEDARRAY2_H
323 template<
typename T,
typename ArrayAlloc,
typename MaskAlloc>
560 {
return pArray->shape(); }
730 template<
typename TL,
typename ArrayAllocL,
typename MaskAllocL,
typename TR,
typename ArrayAllocR>
732 template<
typename TL,
typename ArrayAllocL,
typename TR,
typename ArrayAllocR,
typename MaskAllocR>
734 template<
typename TL,
typename ArrayAllocL,
typename MaskAllocL,
typename TR,
typename ArrayAllocR,
typename MaskAllocR>
743 #include "MaskedArray.tcc"
A Vector of integers, for indexing into Array<T> objects.
void freeMaskStorage(const LogicalArrayElem *&storage, bool deleteIt) const
bool conform(const array_type &other) const
Are the shapes identical?
const LogicalArrayElem * getMaskStorage(bool &deleteIt) const
Manipulate the storage for the underlying Mask.
bool ok() const
Check to see if the masked array is consistent.
masked_array_type & operator=(const array_type &inarray)
Copy the values in inarray to this, only copying those elements for which the corresponding mask elem...
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
const array_type & getArray() const
Return the internal Array.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
size_t nelements() const
The number of elements of this masked array.
MaskedArray< T, ArrayAlloc, MaskAlloc > masked_array_type
std::unique_ptr< mask_type > pMask
The mask.
size_t ndim() const
The dimensionality of this masked array.
masked_array_type copy() const
Class for masking an Array for operations on that Array.
void freeArrayStorage(const T *&storage, bool deleteIt) const
masked_array_type operator()(const LogicalArray &mask) const
Return a MaskedArray.
bool isRO
Is the array read only?
void setCompressedArray(const array_type &inarr)
Set only the valid elements of the MaskedArray from the argument "compressed" Array.
bool isReadOnly() const
Is the array read only?
void setReadOnly() const
Set the array to be read only.
array_type & getRWArray() const
Return the internal Array, writeable.
void putArrayStorage(T *&storage, bool deleteAndCopy) const
const IPosition & shape() const
The length of each axis.
Array< T, ArrayAlloc > array_type
Array< LogicalArrayElem, MaskAlloc > mask_type
Array< T, ArrayAlloc > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the MaskedArray.
A templated N-D Array class with zero origin. Array<T, Alloc> is a templated, N-dimensional, Array class. The origin is zero, but by default indices are zero-based. This Array class is the base class for the Vector, Matrix, and Cube subclasses.
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask...
Specify which elements to extract from an n-dimensional array.
const mask_type & getMask() const
Return the (const) internal Mask.
std::unique_ptr< array_type > pArray
The array.
size_t nelemValid
Cache the number of valid elements.
size_t nelementsValid() const
The number of valid elements of this masked array.
const T * getArrayStorage(bool &deleteIt) const
Manipulate the storage for the underlying Array.
T * getRWArrayStorage(bool &deleteIt) const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
void setData(const array_type &data, const mask_type &mask, bool isReadOnly=false)
Reset the data and mask of the the MaskedArray.
bool nelemValidIsOK
Is the number of valid elements cache OK? i.e.