Maja Piechotka
Maja Piechotka

Reputation: 7216

Java slicing multidimensional array library

Is there a Java array library which supports slicing? I just need regular n x n' x n'' x ... arrays and either taking one slice from given dimension or whole dimension (i.e. no need for ranges).

Notes (read replies to potential comments):

EDIT: Unfortunaly I need to store objects inside array - not only double's.

Upvotes: 3

Views: 1041

Answers (1)

mikera
mikera

Reputation: 106381

Vectorz is a vector/matrix library supports slicing and is a good choice if you are doing numerical work with arrays of double values. It is specifically designed for vector/matrix maths in 3D modelling, gaining, simulation or machine learning contexts.

Advantages:

  • Very fast (everything backed by primitive doubles and double[] arrays)
  • 100% Pure Java
  • Supports arbitrary slicing and dicing, mostly as O(1) operations (i.e. no data copying required)
  • Slices are fully read/write enabled, i.e. you can use them to modify the original structures
  • You can also join vectors together, take subvector views etc.
  • Specialised classes for numerical work, e.g. diagonal matrices etc.

It currently supports 0, 1 and 2 dimensional arrays, higher dimensional arrays are planned but not yet implemented.

Upvotes: 5

Related Questions