Go to the documentation of this file.
33 #include <casacore/casa/aips.h>
34 #include <casacore/casa/Arrays/Array.h>
39 template<
class T>
class Matrix;
80 template<
class T>
class Cube :
public Array<T>
88 Cube(
size_t l1,
size_t l2,
size_t l3);
91 Cube(
size_t l1,
size_t l2,
size_t l3, ArrayInitPolicy initPolicy);
95 Cube(
size_t l1,
size_t l2,
size_t l3,
const T &initialValue);
98 Cube(
const IPosition &len);
101 Cube(
const IPosition &len, ArrayInitPolicy initPolicy);
105 Cube(
const IPosition &len,
const T &initialValue);
108 Cube(
const Cube<T> &);
113 Cube(
const Array<T> &);
121 Cube(
const IPosition &
shape,
const T *storage);
128 virtual void assign (
const Array<T>& other);
132 virtual void reference(
const Array<T> &other);
177 #if defined(AIPS_ARRAY_INDEX_CHECK)
178 this->validateIndex(i1, i2, i3);
185 #if defined(AIPS_ARRAY_INDEX_CHECK)
186 this->validateIndex(i1, i2, i3);
193 T &
at(
size_t i1,
size_t i2,
size_t i3)
195 #if defined(AIPS_ARRAY_INDEX_CHECK)
196 this->validateIndex(i1, i2, i3);
198 return this->contiguous_p ? this->begin_p[i1 + i2*
yinc_p + i3*
zinc_p] :
202 const T &
at(
size_t i1,
size_t i2,
size_t i3)
const
204 #if defined(AIPS_ARRAY_INDEX_CHECK)
205 this->validateIndex(i1, i2, i3);
207 return this->contiguous_p ? this->begin_p[i1 + i2*
yinc_p + i3*
zinc_p] :
222 const Slice &sliceZ);
224 const Slice &sliceZ)
const;
293 {
return this->length_p; }
295 { s1 = this->length_p(0); s2=this->length_p(1); s3=this->length_p(2); }
299 {
return this->length_p(0); }
303 {
return this->length_p(1); }
307 {
return this->length_p(2); }
329 #ifndef CASACORE_NO_AUTO_TEMPLATES
330 #include <casacore/casa/Arrays/Cube.tcc>
331 #endif //# CASACORE_NO_AUTO_TEMPLATES
Specify which elements to extract from an n-dimensional array.
A 2-D Specialization of the Array class.
size_t nrow() const
The number of rows in the Cube, i.e.
A Vector of integers, for indexing into Array<T> objects.
Array< T > operator()(const Slicer &slicer)
virtual Bool ok() const
Checks that the cube is consistent (invariants check out).
virtual ~Cube()
Define a destructor, otherwise the (SUN) compiler makes a static one.
StorageInitPolicy
A global enum used by some Array constructors.
Cube< T > & operator=(const Cube< T > &other)
Copy the values from other to this cube.
virtual void resize()
Make this array a different shape.
Cube()
A Cube of length zero in each dimension; zero origin.
Matrix< T > xyPlane(size_t zplane)
Extract a plane as a matrix referencing the original data.
A global enum used by some Array/Block constructors.
T & at(size_t i1, size_t i2, size_t i3)
A 3-D Specialization of the Array class.
T & operator()(const IPosition &i)
Single-pixel addressing.
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
Array< T > operator()(const IPosition &blc, const IPosition &trc)
const IPosition & shape() const
The length of each axis of the cube.
const Array< T > operator()(const Slicer &slicer) const
T & operator()(const IPosition &)
Access a single element of the array.
T & operator()(size_t i1, size_t i2, size_t i3)
@ COPY
COPY is used when an internal copy of the storage is to be made.
virtual Array< T > & operator=(const Array< T > &other)
Copy the values in other to this.
define a (start,length,increment) along an axis
void shape(Int &s1, Int &s2, Int &s3) const
virtual void preTakeStorage(const IPosition &shape)
this file contains all the compiler specific defines
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
size_t nplane() const
The number of planes in the Cube, i.e.
void makeIndexingConstants()
Helper fn to calculate the indexing constants.
Class for masking an Array for operations on that Array.
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
const T & operator()(const IPosition &i) const
const T & at(size_t i1, size_t i2, size_t i3) const
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
TableExprNode marray(const TableExprNode &array, const TableExprNode &mask)
Form a masked array.
template <class T, class U> class vector;
const T & operator()(size_t i1, size_t i2, size_t i3) const
bool Bool
Define the standard types used by Casacore.
virtual void reference(const Array< T > &other)
Make this cube a reference to other.
size_t xinc_p
Cached constants to improve indexing.
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes)
Remove the degenerate axes from other and store result in this cube.
virtual void postTakeStorage()
size_t ncolumn() const
The number of columns in the Cube, i.e.
Matrix< T > xzPlane(size_t yplane)
Array< T > & operator=(const T &val)
Copy val into every element of this cube; i.e.
void resize(size_t nx, size_t ny, size_t nz, Bool copyValues=False)
Matrix< T > yzPlane(size_t xplane)
virtual void assign(const Array< T > &other)
Assign the other array (which must be dimension 3) to this cube.