In which a clojure-math library is mentioned the first time

2013-03-05

A small work project in Clojure was a success for me. I used:

  • hand-written and Commons Math vector arithmetics (the latter is obviously faster)
  • Rotation class from Commons Math to do 3D rotations (that was a key dependency for me)
  • EJML with custom Clojure wrappers (matrix multiplication and eigen-value decomposition)
  • hand-written Douglas-Peucker and RANSAC algorithms in Clojure
  • Incanter for plotting (only from REPL; not used in the program)
  • clojure.math.combinatorics

I've already published RANSAC implementation in Clojure. I'll probably publish Douglas-Peucker algorithm implementation soon. For now I feel the need to get a small toolbox factored-out, to be easily re-used in future projects.

The work in progress is being published as clojure-math library. I'd like it to be a no-nonsense math library with small footprint. Incanter is an overkill for me, writing custom wrappers around Java libs again and again feels wrong. There are only basic vector operations now.

Apart from Commons Math, I really liked EJML. It seems to be the rare matrix library for Java which uses a single one-dimensional array to store small matrices internally. It is also doing well in Java Matrix Benchmark. Probably, I have to check ojAlgo too.

Overall, the most fantastic thing about Clojure for me is paredit-mode. The only trouble is I didn't figure out how to prevent it from taking over the arrow keys. I've changed the package source directly, to have more reasonable keyboard defaults, and from now on it rocks. Being able to move semantic blocks around is incredibly useful.