26#ifndef CASA_MASKEDARRAY2_H
27#define CASA_MASKEDARRAY2_H
558 {
return pArray->shape(); }
728template<
typename TLL,
typename TRR>
730template<
typename TLL,
typename TRR>
732template<
typename TLL,
typename TRR>
741#include "MaskedArray.tcc"
masked_array_type operator()(const IPosition &start, const IPosition &end)
Get a reference to an array part which extends from "start" to end.
void setReadOnly() const
Set the array to be read only.
masked_array_type operator()(const Slicer &)
Get a reference to an array using a Slicer.
std::unique_ptr< mask_type > pMask
MaskedArray(const masked_array_type &other, bool isreadonly)
Copy constructor.
MaskedArray(const masked_array_type &other)
array_type & getRWArray() const
Return the internal Array, writeable.
const T * getArrayStorage(bool &deleteIt) const
Manipulate the storage for the underlying Array.
masked_array_type copy(bool isreadonly) const
Make a copy of the masked array.
Array< T > getCompressedArray(const IPosition &shape) const
The returned Array will have the input shape.
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask.
masked_array_type & operator=(const T &value)
Set every element of this array to "value", only setting those elements for which the corresponding m...
MaskedArray< LogicalArrayElem > masked_array_type
masked_array_type operator()(const LogicalArray &mask) const
Return a MaskedArray.
MaskedArray(const masked_array_type &inarray, const LogicalArray &inmask, bool isreadonly)
Create a MaskedArray from a MaskedArray and a LogicalArray.
void getCompressedArray(array_type &inarr) const
Fill the argument "compressed" Array with only the valid elements of the MaskedArray.
MaskedArray(const masked_array_type &inarray, const MaskedLogicalArray &inmask, bool isreadonly)
Create a MaskedArray from a MaskedArray and a MaskedLogicalArray.
const mask_type & getMask() const
Return the (const) internal Mask.
size_t nelementsValid() const
The number of valid elements of this masked array.
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...
void setData(const array_type &data, const mask_type &mask, bool isReadOnly=false)
Reset the data and mask of the the MaskedArray.
MaskedArray(const array_type &inarray, const LogicalArray &inmask, bool isreadonly)
Create a MaskedArray from an Array and a LogicalArray.
void freeMaskStorage(const LogicalArrayElem *&storage, bool deleteIt) const
const array_type & getArray() const
Return the internal Array.
void setData(const masked_array_type &array, bool isReadOnly=false)
std::unique_ptr< array_type > pArray
Array< LogicalArrayElem > array_type
void putArrayStorage(T *&storage, bool deleteAndCopy) const
MaskedArray(const masked_array_type &inarray, const MaskedLogicalArray &inmask)
masked_array_type copy() const
void freeArrayStorage(const T *&storage, bool deleteIt) const
Array< LogicalArrayElem > mask_type
masked_array_type & operator=(masked_array_type &&other)
const IPosition & shape() const
The length of each axis.
size_t nelements() const
The number of elements of this masked array.
MaskedArray(const masked_array_type &inarray, const LogicalArray &inmask)
const LogicalArrayElem * getMaskStorage(bool &deleteIt) const
Manipulate the storage for the underlying Mask.
MaskedArray(const array_type &inarray, const LogicalArray &inmask)
size_t ndim() const
The dimensionality of this masked array.
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...
Array< T > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the MaskedArray.
void setCompressedArray(const array_type &inarr)
Set only the valid elements of the MaskedArray from the argument "compressed" Array.
bool ok() const
Check to see if the masked array is consistent.
MaskedArray(masked_array_type &&source)
The source is left empty after moving.
T * getRWArrayStorage(bool &deleteIt) const
bool conform(const masked_array_type &other) const
MaskedArray(const array_type &inarray, const MaskedLogicalArray &inmask)
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, const IPosition &inc)
Along the ith axis, every inc[i]'th element is chosen.
bool conform(const array_type &other) const
Are the shapes identical?
masked_array_type & operator=(array_type &&inarray)
this file contains all the compiler specific defines
TYPE * array
the allocated array
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
Array< LogicalArrayElem > LogicalArray
MaskedArray< LogicalArrayElem > MaskedLogicalArray
NewDelAllocator< T > NewDelAllocator< T >::value
General global functions for MaskedArrays, and MaskedArrays and Arrays.
bool conform2(const MaskedArray< TLL > &left, const MaskedArray< TRR > &right)
bool conform2(const Array< TLL > &left, const MaskedArray< TRR > &right)
bool conform2(const MaskedArray< TLL > &left, const Array< TRR > &right)
Test conformance for masked arrays and arrays of different types.