Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Matrix / Vector API for Clojure supporting multiple implementations

This branch is 0 commits ahead and 0 commits behind master

Merge pull request #13 from mikera/master

Pull from latest core.matrix master
latest commit a71f03d202
Mike Anderson mikera authored September 11, 2013
Octocat-spinner-32 src more scalar tests August 26, 2013
Octocat-spinner-32 .gitignore ignore temporary html file August 23, 2013
Octocat-spinner-32 .travis.yml Add travis config January 03, 2013
Octocat-spinner-32 readme edits August 26, 2013
Octocat-spinner-32 license.txt Add Clojure CA link February 08, 2013
Octocat-spinner-32 pom.xml [maven-release-plugin] prepare for next development iteration August 26, 2013
Octocat-spinner-32 project.clj bump project.clj version number August 22, 2013


N-dimensional Matrix / Vector maths API for Clojure. core.matrix allows you to write clean, functional code with matrices as mathematical objects

(+ [[1 2]
    [3 4]]
   (* (identity-matrix 2) 3.0))

=> [[4.0 2.0]
    [3.0 7.0]]

The objective of core.matrix is to provide a common and idiomatic abstraction for matrix maths in Clojure, independent of underlying implementations. If it looks like a matrix, it works like a matrix.

Key objectives:

  • Provide a clear, standard API / abstraction for matrix and vector maths in Clojure
  • Enable plugable support for different underlying matrix library implementations
  • Provide a general purpose n-dimensional array implementation (NDArray)
  • Provide a foundation layer for other projects (e.g. Incanter)
  • Maintain high performance throughout


core.matrix is fully functional and usable in production applications. As well as supporting the standard Clojure data structures, multiple back end implementations exist that provide optimised matrix implementations. The most mature implementations are currently:

  • vectorz-clj : a fast pure-JVM matrix library for Clojure
  • Clatrix : native code matrix library using BLAS

However the API is still subject to some changes at present (at least up until release 1.0.0), so users should be prepared to deal with potential breaking changes when updating to future releases.

The plan is to become an official Clojure Contrib language extension once the API has been well tested.

Build Status

Getting Started

Get the latest version from Clojars:

For code examples see:

For documentation and further examples see the Wiki:


All contributions / ideas welcome!

There are a number of proposed enhancements listed as GitHub issues: these are a good place to start if you wish to contribute to core.matrix:

If you wish to contribute code, please ensure you have a Clojure Contributors Agreement signed and on file. For more information see:

Discussions related to core.matrix generally take place on the "Numerical Clojure" group:

If you are interested in writing a core.matrix implementation, see:

You can also find a protocol implementation summary here:

Something went wrong with that request. Please try again.