28 #ifndef CASA_ARRAYBASE_H
29 #define CASA_ARRAYBASE_H
41 class ArrayPositionIterator;
191 Int64 nElementsAllocated,
192 Bool copyDataIfNeeded,
193 uInt resizePercentage);
309 const ssize_t*
Origin,
const ssize_t* Inc,
312 const ssize_t* Inc,
const IPosition& Index);
IPosition endPosition() const
A convenience function: endPosition(i) = shape(i) - 1; i.e.
Bool contiguous_p
Are the data contiguous?
A Vector of integers, for indexing into Array<T> objects.
ArrayBase & operator=(const ArrayBase &)
Assignment.
void baseReform(ArrayBase &tmp, const IPosition &shape, Bool strict=True) const
Reform the array to a shape with the same nr of elements.
virtual void resize(const IPosition &newShape, Bool copyValues=False)
Resize the array and optionally copy the values.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Non-templated base class for templated Array class.
void throwNdimVector()
Throw expection if vector dimensionality is incorrect.
Share means that the Array will just use the pointer (no copy), however the Array will NOT delete it ...
size_t nelements() const
How many elements does this array have? Product of all axis lengths.
IPosition steps_p
Used to hold the step to next element in each dimension.
IPosition originalLength_p
uInt ndimen_p
Dimensionality of the array.
size_t nels_p
Number of elements in the array.
virtual void assignBase(const ArrayBase &source, Bool checkType=True)
Assign the source array to this array.
void checkMatrixShape()
Check if the shape of a matrix is correct.
Bool empty() const
Is the array empty (i.e.
ABSTRACT CLASSES Abstract class for colors Any implementation of color should be able to provide a hexadecimal form of the if a human readable name(i.e."black").In many places throughout the plotter
Bool isEqual(const IPosition &other) const
Element-by-element comparison for equality.
size_t makeSubset(ArrayBase &out, const IPosition &b, const IPosition &e, const IPosition &i)
Make a subset of an array.
Bool contiguousStorage() const
Are the array data contiguous? If they are not contiguous, getStorage (see below) needs to make a cop...
A global enum used by some Array/Block constructors.
Bool isStorageContiguous() const
Determine if the storage of a subset is contiguous.
IPosition length_p
Used to hold the shape, increment into the underlying storage and originalLength of the array...
virtual CountedPtr< ArrayBase > makeArray() const
Make an empty array of the same type.
void validateIndex(const IPosition &) const
void baseCopy(const ArrayBase &that)
virtual ~ArrayBase()
Destructor.
Referenced counted pointer for constant data.
void checkVectorShape()
Check if the shape of a vector is correct.
uInt ndim() const
The dimensionality of this array.
void baseAddDegenerate(ArrayBase &, uInt numAxes)
These member functions return an Array reference with the specified number of extra axes...
void checkCubeShape()
Check if the shape of a cube is correct.
void checkArrayShapes(const ArrayBase &left, const ArrayBase &right, const char *name)
bool Bool
Define the standard types used by Casacore.
Origin
casacore::Data for raster plots, which can be thought of as three-dimensional.
TAKE_OVER is used to indicate that the Array should just use the external storage (i...
size_t ArrayVolume(uInt Ndim, const Int *Shape)
General global functions for Arrays.
void baseMakeSteps()
Make the indexing step sizes.
Specify which elements to extract from an n-dimensional array.
Bool conform2(const ArrayBase &other) const
Are the shapes identical?
const Double e
e and functions thereof:
static uInt arrayVersion()
Array version for major change (used by ArrayIO).
void validateConformance(const ArrayBase &) const
Various helper functions.
void baseNonDegenerate(const ArrayBase &other, const IPosition &ignoreAxes)
Remove the degenerate axes from the Array object.
Bool copyVectorHelper(const ArrayBase &other)
Helper function for templated Vector class.
size_t makeDiagonal(uInt firstAxis, Int64 diag)
Set the length and stride such that the diagonal of the matrices defined by two consecutive axes is f...
COPY is used when an internal copy of the storage is to be made.
StorageInitPolicy
A global enum used by some Array constructors.
const IPosition & steps() const
Return steps to be made if stepping one element in a dimension.
virtual Bool ok() const
Check to see if the Array is consistent.
virtual CountedPtr< ArrayPositionIterator > makeIterator(uInt byDim) const
Create an ArrayIterator object of the correct type.
size_t ArrayIndexOffset(uInt Ndim, const ssize_t *Shape, const ssize_t *Origin, const ssize_t *Inc, const IPosition &Index)
What is the linear index into an "Ndim" dimensional array of the given "Shape", "Origin", and "Increment" for a given IPosition Index.
virtual CountedPtr< ArrayBase > getSection(const Slicer &) const
Get a reference to a section of an array.
Bool reformOrResize(const IPosition &newShape, Bool resizeIfNeeded, uInt nReferences, Int64 nElementsAllocated, Bool copyDataIfNeeded, uInt resizePercentage)
Either reforms the array if size permits or resizes it to the new shape.
void throwArrayShapes(const IPosition &shape1, const IPosition &shape2, const char *name)
Function to check the shapes.
virtual void freeVStorage(const void *&storage, Bool deleteIt) const
virtual void putVStorage(void *&storage, Bool deleteAndCopy)
const IPosition & shape() const
The length of each axis.
virtual void * getVStorage(Bool &deleteIt)
The following functions behave the same as the corresponding getStorage functions in the derived temp...
#define casacore
<X11/Intrinsic.h> #defines true, false, casacore::Bool, and String.