30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/MArrayBase.h>
130 template <
typename U>
141 template <
typename U>
170 mask()(start, end, stride));
186 flatten (vec.
data(), itsArray.size());
193 if (size < itsArray.size()) {
194 throw ArrayError (
"MArray::flatten - size " + std::to_string(size) +
195 " of output buffer is too small");
205 if (itsArray.contiguousStorage() &&
mask().contiguousStorage()) {
209 iter!=iterEnd; ++iter, ++miter) {
210 if (!*miter) out[nr++] = *iter;
216 iter!=iterEnd; ++iter, ++miter) {
217 if (!*miter) out[nr++] = *iter;
const IPosition & shape() const
The length of each axis.
T * data()
Get a pointer to the beginning of the array.
void setBase(const ArrayBase &arr, const Array< Bool > &mask)
Reference the mask and set the shape.
Bool isNull() const
Is the array null?
const Array< Bool > & mask() const
Get the mask.
void resizeBase(const ArrayBase &arr, Bool useMask)
Set the array shape and resize the mask.
size_t size() const
Get the size.
void referenceBase(const MArrayBase &other)
Reference another MArray.
Bool hasMask() const
Is there a mask?
const IPosition & shape() const
Get the shape.
MArray(const MArray< T > &array, const MArray< Bool > &mask)
Construct from two MArrays, one the array, the other the mask.
Vector< T > flatten() const
Flatten the unmasked elements of the array to a vector.
MArray(const Array< T > &array, const MArrayBase &marray)
Construct from an array with the mask and null from another MArray.
void reference(const MArray< T > &other)
Reference another array.
size_t flatten(T *out, size_t size) const
Copy the unmasked elements to the out.
MArray< T > operator()(const IPosition &start, const IPosition &end, const IPosition &stride)
Get a subset of the array.
const Array< T > & array() const
Get access to the array.
void fill(const Array< U > &from)
Copy the array from a normal Array.
void fill(const MArray< U > &from)
Copy the array data and possible mask from another one.
MArray(const Array< T > &array)
Construct from an array without a mask.
void resize(const IPosition &shape, Bool useMask)
Resize the array and optionally the mask.
MArray()
Default constructor creates a null array.
MArray(const Array< T > &array, const Array< Bool > &mask, Bool isNull=False)
Construct from an array and a mask.
@ SHARE
Share means that the Array will just use the pointer (no copy), however the Array will NOT delete it ...
this file contains all the compiler specific defines
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
bool Bool
Define the standard types used by Casacore.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.