- COPY
- COPY is used when an internal copy of the storage is to be made. The array is NOT responsible for deleting the external storage.
- TAKE_OVER
- TAKE_OVER is used to indicate that the Array should just use the external storage (i.e., no copy is made). The Array class is now responsible for deleting the storage (hence it must have come from a call to new[]).
- SHARE
- Share means that the Array will just use the pointer (no copy), however the Array will NOT delete it upon destruction.
ArrayBase is only used to factor out common code from the templated Array class.
Create an array of the given shape, i.e. after construction array.ndim() == shape.nelements() and array.shape() == shape. The origin of the Array is zero.
Copy constructor.
Assignment.
Destructor.
The dimensionality of this array.
How many elements does this array have? Product of all axis lengths.
Are the array data contiguous? If they are not contiguous, getStorage (see below) needs to make a copy.
Check to see if the Array is consistent. This is about the same thing as checking for invariants. If AIPS_DEBUG is defined, this is invoked after construction and on entry to most member functions.
The length of each axis.
A convenience function: endPosition(i) = shape(i) - 1; i.e. this is the IPosition of the last element of the Array.
Return steps to be made if stepping one element in a dimension. This is the 'physical' step, thus it also works correctly for non-contiguous arrays. E.g. data() + steps(0) gives the second element of the first axis.
Array version for major change (used by ArrayIO). enum did not work properly with cfront 3.0.1), so replaced by a static inline function. Users won't normally use this.
Determine if the storage of a subset is contiguous.
Check if the shape of a vector is correct. If possible, adjust if not. It is possible if at most one axis has length > 1.
Check if the shape of a matrix is correct. Adjust it if smaller.
Check if the shape of a cube is correct. Adjust it if smaller.
Reform the array to a shape with the same nr of elements.
Remove the degenerate axes from the Array object. This is the implementation of the nonDegenerate functions. It has a different name to be able to make it virtual without having the "hide virtual function" message when compiling derived classes.
These member functions return an Array reference with the specified number of extra axes, all of length one, appended to the end of the Array. Note that the reform function can also be used to add extra axes.
Make a subset of an array. It checks if start,end,incr are within the array limits. It returns the offset of the subset in the array.
Are the shapes identical?
Make the indexing step sizes.
Various helper functions.
What is the volume of an N-dimensional array. Shape[0]*Shape[1]*...*Shape[N-1]. An Array helper function.
What is the linear index into an "Ndim" dimensional array of the given "Shape", "Origin", and "Increment" for a given IPosition Index. An Array helper function.