The MultiArray API provides an abstraction for multidimensional array access and some concrete implementations. By use of the MultiArrayProxy and IndexMaps, it also provides techniques by which a MultiArray can be viewed as if it had different structure.
This discussion is made somewhat confusing by imprecise usage in our field. When we say "array", or "vector", it isn't clear whether we are talking about constructs in a given programming language or mathematical abstractions. In the following discussion, we will use the unadorned term "array" to mean the Java language construct, The term "multidimensional array" for a mathematical abstraction which is modeled by the MultiArray class in this package.
A multidimensional array is a collection of elements which are accessed by index. The elements may be objects or primitives. The index is a one dimensional array of integers. The number of dimensions of a multidimensional array is called its rank. Each of the dimensions has a length, which determines the possible values of the corresponding index element. A multidimensional array of rank 1 is often referred to as a vector. A multidimensional array of rank 0 is referred to as a scalar.
The Java language, like C and C++, provides an array primitive which is actually a vector. Also like C and C++, this primitive is used in the language to build up multidimensional arrays as vectors of vectors. Numerical programs in C and C++ rarely use the higher dimensional array construct for several reasons. (TODO: more detail on why?) One purpose of this API is to codify that practice into a clear object framework.
The MultiArray API consists of:
The MultiArray methods to get() and set() values operate on single values. To grab a slice, clipped region or some other aggregate out of a MultiArray, use MultiArrayProxy and the appropriate concrete IndexMappings to create that view of the MultiArray. The concrete MultiArrayImpl provides a copy constructor for which the view can be used as initializer. The copyin() and copyout() methods of MultiArray may also be used for simple clippings.