array data


The array is defined with respect to some explicitly or implicitly specified type T in a recursive sense as a sequence of elements e₁, e₂, ..., where each eᵢ is either some data of type T or again an array of T

For example, assume T stands for integer
Then an array of integers is the sequence consisting of the 3 numbers (placed in brackets for notational purposes): {4, 5, 8}
Now replace the second number 5 with the new sequence {3, 0, 2, 4}
The original sequence transforms into: {4, {3, 0, 2, 4}, 8}, which is still an array of integers due to the recursive part of the above definition.

An array of which none of the elements is itself an array, is also referred by the more specialized term
1D-array and said to have rank = 1
The original array {4, 5, 8} of the above example is has rank = 1

An array is referred as a
2D-array if it has at least one element that is a 1D-array and all other elements are non-arrays (i.e. scalar)
A 2D-array is said to have rank = 2
The transformed array {4, {3, 0, 2, 4}, 8} of the above example has rank = 2 since its second element is the array {3, 0, 2, 4}, which has rank = 1

An array is referred as a
3D-array if it has at least one element that is a 2D-array and all other elements are either non-arrays or 1D-arrays
A 3D-array is said to have rank = 3
An example of such an array can be constructed substituting the number 0 of the transformed array with the array {9, 1}
The resulting array is {4, {3, {9, 1}, 2, 4}, 8} and has rank = 3 since its second element is the array {3, {9, 1}, 2, 4}, which has rank = 2

Deriscope can handle arrays of any rank, although its Excel interface is limited to arrays of maximum rank = 3