Another project that I’ve been working or more or less actively for a while, and that I used internally until now, but which may now find its way into the public:
It consists of several submodules:
[ul]
[li]nd-tuples : Multidimensional tuples of primitive types
[/li][li]nd-iteration : Classes for the iteration over multidimensional ranges
[/li][li]nd-arrays : Multidimensional arrays of primitive types
[/li][li]nd-distance : Distance functions for multidimensional tuples of primitive types
[/li][/ul]
Of course, there are dozens of libraries with similar goals. There are primitive specializations for lists and other collections, and a vast number of matrix libraries that all offer tuples („vectors“) and 2D arrays.
However, the goal of these ND libraries was not to build yet-another-Java-Matrix-library.
The „nd-tuples“ library should mainly offer the most basic abstraction of primitive arrays (in form of a Java interface) that one can imagine:
[ul]
[li]One method to read an element
[/li][li]One method to obtain the size
[/li][li]For the mutable version: One method to set an element
[/li][/ul]
yet still allowing a bit of the engineered abstractions that are possible with interfaces. E.g. the tuples and arrays offer the subTuple
method, which creates a view on a part of another tuple. Additionally, some obvious static utility methods and possibly useful default implementations are offered.
The „nd-arrays“ library is the generalization of this concept for multidimensional arrays. The array interfaces also offer things like a subArray
method, and consequently, the arrays are accessed via IntTuple
instances.
The „nd-iteration“ library covers the different iteration orders for multidimensional arrays, namely an iteration in lexicographical and colexicographical order. It also offers methods for the iteration through neighborhoods of points - namely the Moore Neighborhood and the Von Neumann Neighborhood.
The „nd-distance“ library contains some implementations of distance functions for tuples (Euclidean, Manhattan, Chebyshev, some of them also for toroid topologies, and a „Dynamic Time Warping“ distance for DoubleTuple
s.
Sooner or later, this will also go to Maven Central.