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 A Vector of integers, for indexing into Array<T> objects.
uInt nelementsValid() const
The number of valid elements of this masked array.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
uInt nelements() const
The number of elements of this masked array.
Bool conform(const Array< T > &other) const
Are the shapes identical?
void putArrayStorage(T *&storage, Bool deleteAndCopy) const
Bool isReadOnly() const
Is the array read only?
void freeArrayStorage(const T *&storage, Bool deleteIt) const
Array< T > * pArray
The array.
Array< T > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the MaskedArray.
const IPosition & shape() const
The length of each axis.
const LogicalArray & getMask() const
Return the (const) internal Mask.
Bool isRO
Is the array read only?
MaskedArray< T > operator()(const LogicalArray &mask) const
Return a MaskedArray.
Class for masking an Array for operations on that Array.
T * getRWArrayStorage(Bool &deleteIt) const
MaskedArray< T > & operator=(const Array< T > &inarray)
Copy the values in inarray to this, only copying those elements for which the corresponding mask elem...
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask...
void freeMaskStorage(const LogicalArrayElem *&storage, Bool deleteIt) const
void setReadOnly() const
Set the array to be read only.
void setData(const Array< T > &data, const LogicalArray &mask, Bool isReadOnly=False)
Reset the data and mask of the the MaskedArray.
bool Bool
Define the standard types used by Casacore.
void setCompressedArray(const Array< T > &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< T > copy() const
Bool nelemValidIsOK
Is the number of valid elements cache OK? i.e.
template <class T, class U> class vector;
uInt nelemValid
Cache the number of valid elements.
const T * getArrayStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Array.
const Array< T > & getArray() const
Return the internal Array.
LogicalArray * pMask
The mask.
uInt ndim() const
The dimensionality of this masked array.
const LogicalArrayElem * getMaskStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Mask.
Array< T > & getRWArray() const
Return the internal Array, writeable.
this file contains all the compiler specific defines
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.