| Interface | Description |
|---|---|
| ArrayND |
Interface describing a multidimensional array
|
| Class | Description |
|---|---|
| AbstractArrayND |
Abstract base implementation of a multidimensional array.
|
| Coordinates |
Methods that provide streams over the coordinates of multidimensional
arrays, based on a given array size.
|
| Indexers |
Methods to create functions that map
IntTuple instances to
1-dimensional (array) indices. |
| Utils |
Internal utility methods for the arrays package.
|
de.javagl.nd.arrays.d: Arrays consisting
of double values
de.javagl.nd.arrays.i: Arrays consisting
of int values
de.javagl.nd.arrays.j: Arrays consisting
of long values
0 1 2 3
4 5 6 7
8 9 10 11
The column-major iteration order is
0 3 6 9
1 4 7 10
2 5 8 11
Intuitively, the difference here is whether one starts walking over
the first row or the first column: In the row-major order, the
iteration first walks over the row (increasing the column index, or the
x-coordinate in the array). In the column-major order, the iteration first
walks over the column (increasing the row index, or the y-coordinate
in the array).
0, 0
0, 1
0, 2
0, 3
1, 0
1, 1
1, 2
1, 3
2, 0
2, 1
2, 2
2, 3
Here, the rightmost coordinate element varies fastest. The ordering of
the coordinate tuples is referred to as the lexicographical
ordering.
0, 0
1, 0
2, 0
0, 1
1, 1
2, 1
0, 2
1, 2
2, 2
0, 3
1, 3
2, 3
Here, the leftmost coordinate element varies fastest. The ordering of
the coordinate tuples is then referred to as the colexicographical
ordering.Coordinates and
Indexers.lexicographical coordinates for an array,
the rightmost coordinate element varies fastest. For an array with a
size of (4,3,2), the coordinates will be ordered as follows:
0, 0, 0
0, 0, 1
0, 1, 0
0, 1, 1
0, 2, 0
0, 2, 1
1, 0, 0
1, 0, 1
...
3, 2, 1
The lexicographical indexer will compute
1D indices for these coordinates accordingly:
0, 0, 0 : Index 0
0, 0, 1 : Index 1
0, 1, 0 : Index 2
0, 1, 1 : Index 3
0, 2, 0 : Index 4
0, 2, 1 : Index 5
1, 0, 0 : Index 6
1, 0, 1 : Index 7
...
3, 2, 1 : Index 23
Copyright © 2015. All Rights Reserved.