Skip to content

Matrix implementations

Luca Antiga edited this page Aug 30, 2015 · 10 revisions

Overview

core.matrix supports multiple implemntations of vector/matrix maths conforming to the same API.

Implementations included in core.matrix

  • :persistent-vector : regular Clojure vectors work as core.matrix implementations
  • :double-array : Java double[] arrays work as 1D mutable vectors
  • :ndarray : a general purpose mutable n-dimensional array, stores objects of any type
  • :sequence : Clojure sequences (anything implementing ISeq) can be used

Main external core.matrix implementations:

  • vectorz-clj : An implementation based on the Vectorz library, which offers fast pure-JVM matrix and vector computation with double-valued matrices. Designed for games, simulations and machine learning. Particularly efficient for small matrix and vector maths.
  • Clatrix : A wrapper of jblas which in uses the BLAS native libraries for matrix computation. Offers high performance for large matrices, at the cost of needing a native code dependency.

Work in progress / experimental implementations

  • Parallel Colt - Support for Parallel Colt matrices
  • Cerebro - inital support for EJML
  • image-matrix - Support for treating a Java BufferedImage as a matrix of pixel colour data
  • apache-commons-matrix - Support for Apache Commons Math matrices
  • MTJ - Support for MTJ (Matrix Toolkits Java) vectors and matrices. MTJ is known to be faster than Clatrix (JBlas) for very big vectors and matrices.

Example implementations we might want to support in the future:

  • javax.vecmath (part of Java3D)
  • UJMP