More...
|
class | casacore::Array< T, Alloc > |
| More...
|
|
class | casacore::ArrayAccessor< T, U > |
| Fast 1D accessor/iterator for nD array classes. More...
|
|
class | casacore::ArrayAccessor< T, AxisN > |
| Specialization for run-time axes. More...
|
|
class | casacore::ArrayBase |
| Non-templated base class for templated Array class. More...
|
|
class | casacore::ArrayError |
| More...
|
|
class | casacore::ArrayIndexError |
| An error thrown when an index is out of range. More...
|
|
class | casacore::ArrayConformanceError |
| An error thrown when two arrays do not conform. More...
|
|
class | casacore::ArrayNDimError |
| Thrown when two arrays have different dimensionality. More...
|
|
class | casacore::ArrayShapeError |
| An error thrown when two arrays have different shapes. More...
|
|
class | casacore::ArrayIteratorError |
| An error thrown by an ArrayIterator. More...
|
|
class | casacore::ArraySlicerError |
| An error thrown by an Slicer member function. More...
|
|
class | casacore::ArrayIterator< T, Alloc > |
| More...
|
|
class | casacore::ReadOnlyArrayIterator< T, Alloc > |
| Iterate a const Array cursor through a const Array. More...
|
|
struct | casacore::ArrayLogical_global_functions_Array_logical_operations |
| More...
|
|
struct | casacore::ArrayMath_global_functions_Array_mathematical_operations |
| More...
|
|
class | casacore::ArrayFunctorBase< T, RES > |
| More...
|
|
struct | casacore::ArrayOpsDiffShapes_global_functions_OpsDiff_functions |
| More...
|
|
struct | casacore::ArrayPartMath_global_functions_Array_partial_operations |
| More...
|
|
class | casacore::ArrayPositionIterator |
| More...
|
|
struct | casacore::ArrayUtil_global_functions_stringToVector |
| More...
|
|
struct | casacore::ArrayUtil_global_functions_concatenateArray |
| Concatenate two Arrays. More...
|
|
struct | casacore::ArrayUtil_global_functions_partialFuncHelper |
| Helper function for partialX functions. More...
|
|
struct | casacore::ArrayUtil_global_functions_reverseArray |
| Reverse the order of one or more axes of an array. More...
|
|
struct | casacore::ArrayUtil_global_functions_reorderArray |
| Reorder the axes of an array. More...
|
|
class | casacore::AxesSpecifier |
| More...
|
|
class | casacore::Cube< T, Alloc > |
| More...
|
|
class | casacore::IPosition |
| More...
|
|
struct | casacore::IPosition_global_functions_IPosition_Arithmetic |
| Arithmetic Operations for IPosition's Element by element arithmetic on IPositions. More...
|
|
struct | casacore::IPosition_global_functions_IPosition_Logical |
| Logical operations for IPosition's Element by element boolean operations on IPositions. More...
|
|
struct | casacore::IPosition_global_functions_IPosition_Indexing |
| Indexing functions for IPosition's Convert between IPosition and offset in an array. More...
|
|
struct | casacore::LogiArray_global_functions_LogicalArray |
| More...
|
|
struct | casacore::LogiCube_global_functions_LogicalCube |
| More...
|
|
struct | casacore::LogiMatrix_global_functions_LogicalMatrix |
| More...
|
|
struct | casacore::LogiVector_global_functions_LogicalVector |
| More...
|
|
struct | casacore::MaskArrIO_global_functions_MaskedArray_IO |
| More...
|
|
struct | casacore::MaskArrLogi_global_functions_MaskedArray_logical_operations |
| More...
|
|
struct | casacore::MaskArrMath_global_functions_MaskedArray_mathematical_operations |
| More...
|
|
class | casacore::MaskedArray< T, ArrayAlloc, MaskAlloc > |
| More...
|
|
struct | casacore::MaskedArray_global_functions_MaskedArray_general_global_functions |
| General global functions for MaskedArrays, and MaskedArrays and Arrays. More...
|
|
struct | casacore::MaskLogiArr_global_functions_MaskedLogicalArray |
| More...
|
|
struct | casacore::MaskLogiArrFwd_global_functions_MaskedLogicalArray_forwards |
| More...
|
|
class | casacore::Matrix< T, Alloc > |
| More...
|
|
class | casacore::MatrixIterator< T, Alloc > |
| More...
|
|
class | casacore::ReadOnlyMatrixIterator< T > |
| Iterate a Matrix cursor through a R/O Array. More...
|
|
struct | casacore::MatrixMath_global_functions_Linear_Algebra |
| More...
|
|
class | casacore::Slice |
| More...
|
|
class | casacore::Slicer |
| More...
|
|
struct | casacore::Slicer_global_functions_Slicer_IO |
| IO functions for Slicer's
More...
|
|
class | casacore::Vector< T, Alloc > |
| More...
|
|
class | casacore::VectorIterator< T, Alloc > |
| More...
|
|
class | casacore::ReadOnlyVectorIterator< T, Alloc > |
| Iterate a Vector cursor through another Array. More...
|
|
class | casacore::VectorSTLIterator< T, Alloc > |
| More...
|
|
A module implementing multidimensional arrays and operations.
See below for an overview of the classes in this module.
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
Etymology
This module provides classes and global functions for multidimensional arrays.
Synopsis
Arrays have traditionally played an important role in scientific computation. While it is certainly true that some of the reliance on arrays was due to the paucity of other data structures in FORTRAN, it is also true that computation on arrays reflects the common occurrence of regularly sampled multi-dimensioned data in science.
The Lattices are a generalization of Arrays. They can handle memory- and disk-based arrays as well as other types of arrays (eg. expressions).
The module consists of various parts:
-
Array is the basic array class. It is only templated on data type, not on dimensionality like the array classes in Blitz and boost. It has a non-templated base class ArrayBase.
Vector, Matrix, and Cube are the one, two, and three dimensional specializations respectively of Array.
-
MaskedArray is the class used to mask an Array for operations on that Array.
-
ArrayError is the base class for all Array exception classes.
-
There are several ways o iterate through an array:
-
The STL-style Array iterators can be used to iterate element by element through an array. This is the fastest way. They also make it possible to virtually extend an array (called shape broadcasting in numpy) and to reorder the iteration axes.
-
ArrayIterator can be used to iterate line by line, plane by plane, etc. through an array. Each subset is an array in itself, thus can be iterated again.
-
The Array function operators () can be used to get a subset from an array. They can be used for iteration, but that is slower than the ways mentioned above.
-
The array operator[] can be used to get the i-th subset. It can be used for iteration, but ArrayIterator does the same and is faster.
-
ArrayAccessor is useful when neighbours of an array element have to be visited.
-
LatticeIterator can be used on a ArrayLattice object for more advanced iteration. However, they are part of the lattices packages.
-
Mathematical, logical, chunked mathematical and logical, IO, and other useful operations are provided for Arrays and MaskedArrays.
ArrayMath also defines various STL-style transform functions that use the Array iterators and functors like Plus to apply the mathematical and logical operations. They can, however, also be used directly on arrays of different types making it possible to, say, add a Complex and double array with a DComplex result.
It also has a transformInPlace
to avoid needless incrementing of iterators which have to be done when using std::transform
for in-place operations.
-
Orthogonal n-space descriptors - useful when a shape of an Array is needed or when a sub-region within an Array is required.
-
The IPosition class name is a concatenation of "Integer Position." IPosition objects are normally used to index into, and define the shapes of, Arrays and Lattices. For example, if you have a 5-dimensional array, you need an IPosition of length 5 to index into the array (or to define its shape, etc.). It is essentially a vector of integers. The IPosition vector may point to the "top right corner" of some shape, or it may be an indicator of a specific position in n-space. The interpretation is context dependent. The constructor consists of an initial argument which specifies the number of axes, followed by the appropriate number of respective axis lengths. Thus the constructor needs N+1 arguments for an IPosition of length N. IPositions have the standard integer math relationships defined. The dimensionality of the operator arguments must be the same.
IPosition threeSpace(3, 24, 48, 16);
Int xShape = threeSpace(0);
Int zShape = threeSpace(2);
IPosition threeSpaceAlso(3,666);
threeSpace += threeSpaceAlso;
#define AlwaysAssert(expr, exception)
These marcos are provided for use instead of simply using the constructors of assert_ to allow additi...
-
The Slicer class name may be thought of as a short form of "n-Dimensional Slice Specifier."
This object is used to bundle into one place all the information necessary to specify a regular subregion within an Array or Lattice. In other words, Slicer holds the location of a "slice" of a greater whole. Construction is with up to 3 IPositions: the start location of the subspace within the greater space; the shape or end location of the subspace within the greater space; and the stride, or multiplier to be used for each axis. The stride gives the user the chance to use every i-th piece of data, rather than every position on the axis.
It is possible to leave some values in the given start or end/length unspecified. Such unspecified values default to the boundaries of the array to which the slicer will be applied. It is also possible to use a non-zero origin when applying the slicer to an array.
IPosition
shape(2,20,30);
IPosition origin(2,-5,15);
Slicer ns0(IPosition(2,0,24));
IPosition blc,trc,inc;
ns0.inferShapeFromSource (
shape, origin, blc,trc,inc);
cout << blc << trc << inc << endl;
Slicer ns1(IPosition(2,3,5), IPosition(2,13,21), IPosition(2,3,2),
IPosition shp = ns1.inferShapeFromSource (
shape, blc,trc,inc);
cout << shp << blc << trc << inc << endl;
@ endIsLast
The end-values given in the constructor define the trc.
TableExprNode shape(const TableExprNode &array)
Function operating on any scalar or array resulting in a Double array containing the shape.
The detailed discussions for the classes and global functions will describe how to use them.
◆ StorageInitPolicy
A global enum used by some Array constructors.
Synopsis
StorageInitPolicy is used in functions where an array is formed from a shape and an ordinary pointer. This enum should be in Array but that causes gcc to be unhappy.
Enumerator |
---|
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.
|
Definition at line 51 of file ArrayBase.h.
◆ ArrayVolume()
size_t casacore::ArrayVolume |
( |
size_t |
Ndim, |
|
|
const int * |
Shape |
|
) |
| |
General global functions for Arrays.
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
- Test programs:
- tArray
Prerequisite
Synopsis
These are generally useful global functions which operate on all Arrays.
What is the volume of an N-dimensional array. Shape[0]*Shape[1]*...*Shape[N-1]. An Array helper function.