28 #ifndef CASA_MASKEDARRAY_H
29 #define CASA_MASKEDARRAY_H
47 template <
class T>
class Array;
325 template<
class T>
class MaskedArray
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
MaskedArray< T > copy() const
A Vector of integers, for indexing into Array<T> objects.
Array< T > & getRWArray() const
Return the internal Array, writeable.
Bool isReadOnly() const
Is the array read only?
void setReadOnly() const
Set the array to be read only.
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
const IPosition & shape() const
The length of each axis.
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
Array< T > * pArray
The array.
uInt nelements() const
The number of elements of this masked array.
const_iterator end() const
Bool conform(const Array< T > &other) const
Are the shapes identical?
Bool isRO
Is the array read only?
ABSTRACT CLASSES Deliberately vague to be general enough to allow for many different types of data
Class for masking an Array for operations on that Array.
void putArrayStorage(T *&storage, Bool deleteAndCopy) const
const LogicalArrayElem * getMaskStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Mask.
T * getRWArrayStorage(Bool &deleteIt) const
void freeArrayStorage(const T *&storage, Bool deleteIt) const
Array< T > getCompressedArray() const
Return a "compressed" Array containing only the valid elements of the 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...
MaskedArray()
Default constructor for a MaskedArray does not allocate any memory for the Data array or Mask...
const Array< T > & getArray() const
Return the internal Array.
void freeMaskStorage(const LogicalArrayElem *&storage, Bool deleteIt) const
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.
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.
LogicalArray * pMask
The mask.
MaskedArray< T > operator()(const LogicalArray &mask) const
Return a MaskedArray.
const T * getArrayStorage(Bool &deleteIt) const
Manipulate the storage for the underlying Array.
uInt ndim() const
The dimensionality of this masked array.
const LogicalArray & getMask() const
Return the (const) internal Mask.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
uInt nelementsValid() const
The number of valid elements of this masked array.
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.