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"
MaskedArray(masked_array_type &&source)
The source is left empty after moving.
MaskedArray(const masked_array_type &inarray, const MaskedLogicalArray &inmask)
Array< T, ArrayAlloc > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the MaskedArray.
MaskedArray(const array_type &inarray, const LogicalArray &inmask, bool isreadonly)
Create a MaskedArray from an Array and a LogicalArray.
MaskedArray(const array_type &inarray, const LogicalArray &inmask)
const T * getArrayStorage(bool &deleteIt) const
Manipulate the storage for the underlying Array.
void setData(const array_type &data, const mask_type &mask, bool isReadOnly=false)
Reset the data and mask of the the MaskedArray.
void setReadOnly() const
Set the array to be read only.
const LogicalArrayElem * getMaskStorage(bool &deleteIt) const
Manipulate the storage for the underlying Mask.
bool conform(const masked_array_type &other) const
std::unique_ptr< array_type > pArray
The array.
masked_array_type & operator=(const T &value)
Set every element of this array to "value", only setting those elements for which the corresponding m...
masked_array_type operator()(const Slicer &)
Get a reference to an array using a Slicer.
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...
MaskedArray(const masked_array_type &other)
size_t ndim() const
The dimensionality of this masked array.
bool isRO
Is the array read only?
Array< LogicalArrayElem, MaskAlloc > mask_type
bool conform(const array_type &other) const
Are the shapes identical?
MaskedArray(const masked_array_type &inarray, const LogicalArray &inmask, bool isreadonly)
Create a MaskedArray from a MaskedArray and a LogicalArray.
MaskedArray(const masked_array_type &inarray, const LogicalArray &inmask)
const IPosition & shape() const
The length of each axis.
size_t nelementsValid() const
The number of valid elements of this masked array.
void getCompressedArray(array_type &inarr) const
Fill the argument "compressed" Array with only the valid elements of the MaskedArray.
Array< T, ArrayAlloc > array_type
bool ok() const
Check to see if the masked array is consistent.
const mask_type & getMask() const
Return the (const) internal Mask.
void setCompressedArray(const array_type &inarr)
Set only the valid elements of the MaskedArray from the argument "compressed" Array.
void freeMaskStorage(const LogicalArrayElem *&storage, bool deleteIt) const
array_type & getRWArray() const
Return the internal Array, writeable.
const array_type & getArray() const
Return the internal Array.
Array< T, ArrayAlloc > getCompressedArray(const IPosition &shape) const
The returned Array will have the input shape.
void freeArrayStorage(const T *&storage, bool deleteIt) const
void putArrayStorage(T *&storage, bool deleteAndCopy) const
MaskedArray(const array_type &inarray, const MaskedLogicalArray &inmask)
std::unique_ptr< mask_type > pMask
The mask.
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask.
bool nelemValidIsOK
Is the number of valid elements cache OK? i.e.
MaskedArray(const array_type &inarray, const MaskedLogicalArray &inmask, bool isreadonly)
Create a MaskedArray from an Array and a MaskedLogicalArray.
masked_array_type operator()(const IPosition &start, const IPosition &end)
Get a reference to an array part which extends from "start" to end.
MaskedArray(const masked_array_type &inarray, const MaskedLogicalArray &inmask, bool isreadonly)
Create a MaskedArray from a MaskedArray and a MaskedLogicalArray.
masked_array_type operator()(const LogicalArray &mask) const
Return a MaskedArray.
size_t nelemValid
Cache the number of valid elements.
bool isReadOnly() const
Is the array read only?
T * getRWArrayStorage(bool &deleteIt) const
masked_array_type operator()(const IPosition &start, const IPosition &end, const IPosition &inc)
Along the ith axis, every inc[i]'th element is chosen.
masked_array_type & operator=(array_type &&inarray)
void setData(const masked_array_type &array, bool isReadOnly=false)
masked_array_type & operator=(const masked_array_type &other)
Copies/moves the values in other to this, only copying those elements for which the logical AND of th...
masked_array_type copy() const
size_t nelements() const
The number of elements of this masked array.
masked_array_type copy(bool isreadonly) const
Make a copy of the masked array.
MaskedArray(const masked_array_type &other, bool isreadonly)
Copy constructor.
masked_array_type & operator=(masked_array_type &&other)
MaskedArray< T, ArrayAlloc, MaskAlloc > masked_array_type
this file contains all the compiler specific defines
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
bool conform2(const MaskedArray< TL, ArrayAllocL, MaskAllocL > &left, const Array< TR, ArrayAllocR > &right)
Test conformance for masked arrays and arrays of different types.
bool conform2(const MaskedArray< TL, ArrayAllocL, MaskAllocL > &left, const MaskedArray< TR, ArrayAllocR, MaskAllocR > &right)
bool conform2(const Array< TL, ArrayAllocL > &left, const MaskedArray< TR, ArrayAllocR, MaskAllocR > &right)