80 Cube(
size_t l1,
size_t l2,
size_t l3,
const T &initialValue=T());
112 void resize(
size_t nx,
size_t ny,
size_t nz,
bool copyValues=
false);
141 if (source.
ndim() == 3) {
152 if (source.ndim() == 3) {
155 (*this) =
Cube<T>(std::move(source));
204 const Slice &sliceZ);
206 const Slice &sliceZ)
const;
276 void shape(
int &s1,
int &s2,
int &s3)
const
292 virtual bool ok()
const override;
312 size_t index(
size_t i1,
size_t i2,
size_t i3)
const {
size_t ndim() const
The dimensionality of this array.
IPosition originalLength_p
IPosition length_p
Used to hold the shape, increment into the underlying storage and originalLength of the array.
Array< T > & operator=(const Array< T > &other)
TODO we should change the semantics.
T * begin_p
This pointer is adjusted to point to the first element of the array.
T & operator()(const IPosition &)
Access a single element of the array.
void resize()
Make this array a different shape.
Cube(size_t l1, size_t l2, size_t l3, const T &initialValue=T())
A l1xl2xl3 sized cube.
const Matrix< T > xyPlane(size_t zplane) const
Cube(const IPosition &length, const T &initialValue=T())
A Cube where the shape ("len") is defined with IPositions.
void resize(size_t nx, size_t ny, size_t nz, bool copyValues=false)
T & operator()(size_t i1, size_t i2, size_t i3)
const Array< T > operator()(const IPosition &blc, const IPosition &trc) const
Matrix< T > xyPlane(size_t zplane)
Extract a plane as a matrix referencing the original data.
virtual void doNonDegenerate(const Array< T > &other, const IPosition &ignoreAxes) override
Remove the degenerate axes from other and store result in this cube.
Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr)
Slice using IPositions.
Cube< T > & operator=(const Cube< T > &source)
Copy the values from other to this cube.
Cube(const Array< T > &)
Construct a cube by reference from "other".
const Array< T > operator()(const Slicer &slicer) const
size_t fixedDimensionality() const override
Subclasses can return their dimensionality.
Cube< T > operator()(const Slice &sliceX, const Slice &sliceY, const Slice &sliceZ)
Take a slice of this cube.
Cube(const IPosition &shape, T *storage, StorageInitPolicy policy=COPY)
Create an Cube of a given shape from a pointer.
Cube(size_t l1, size_t l2, size_t l3, typename Array< T >::uninitializedType)
An uninitialized l1xl2xl3 sized cube.
Cube(const IPosition &length, typename Array< T >::uninitializedType)
An uninitialized Cube where the shape ("len") is defined with IPositions.
size_t nplane() const
The number of planes in the Cube, i.e.
const T & operator()(const IPosition &i) const
Matrix< T > xzPlane(size_t yplane)
size_t ncolumn() const
The number of columns in the Cube, i.e.
const Matrix< T > yzPlane(size_t xplane) const
size_t xinc() const
Cached constants to improve indexing.
void shape(int &s1, int &s2, int &s3) const
Cube(const IPosition &shape, const T *storage)
Create an Cube of a given shape from a pointer.
Cube< T > & operator=(Array< T > &&source)
size_t index(size_t i1, size_t i2, size_t i3) const
Cube(const Cube< T > &)
The copy constructor uses reference semantics.
Array< T > & operator=(const T &val)
Copy val into every element of this cube; i.e.
Array< T > operator()(const Slicer &slicer)
virtual bool ok() const override
Checks that the cube is consistent (invariants check out).
const Cube< T > operator()(const Slice &sliceX, const Slice &sliceY, const Slice &sliceZ) const
const Matrix< T > xzPlane(size_t yplane) const
Array< T > operator()(const IPosition &blc, const IPosition &trc)
const T & operator()(size_t i1, size_t i2, size_t i3) const
size_t nrow() const
The number of rows in the Cube, i.e.
const IPosition & shape() const
The length of each axis of the cube.
Cube< T > & operator=(const Array< T > &source)
T & operator()(const IPosition &i)
Copy to this those values in marray whose corresponding elements in marray's mask are true.
size_t index_continuous(size_t i1, size_t i2, size_t i3) const
Cube< T > & operator=(Cube< T > &&source)
virtual void preTakeStorage(const IPosition &shape) override
pre/post processing hook of takeStorage() for subclasses.
Cube()
A Cube of length zero in each dimension; zero origin.
Matrix< T > yzPlane(size_t xplane)
const Array< T > operator()(const IPosition &blc, const IPosition &trc, const IPosition &incr) const
@ COPY
COPY is used when an internal copy of the storage is to be made.
this file contains all the compiler specific defines
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
This is a tag for the constructor that may be used to construct an uninitialized Array.