weavejester/euclidean — pull request #3 by aamedina (2014-08-21 16:47:49+00:00)
Title: Matrix

I know this is a very large PR but I hope you give it a chance. :)

Overview of enhancement:

1. Adds a Vector4D type. Follows all existing conventions you laid down in existing Vector implementations.
2. Vectors now implement clojure.lang.Associative to permit `assoc`ing new values. This was done to facilitate nested assoc'ing necessary for the Matrix type. e.g., (update-in matrix-4 [3 3] + 1) since matrices return a sequence of Vectors when seq'd.
3. Adds Matrix2D, Matrix3D, and Matrix4D types and a suite of basic matrix functions, like add, sub, mult, etc.
4. Define a matrix test suite to verify the correctness of the implementations. The tests generate random instances of various dimensional matrices and performs the same operation using my implementation and an implementation used by a Java library called LWJGL, which has a number of Matrix/Vector utility classes. I chose LWJGL arbitrarily.

I'm not sure what else to write at the moment, but I'll be happy to answer any questions you have if you decide to review this PR. Thanks for taking the time!

Preliminary benchmarking with Criterium shows that, at least compared to LWJGLs implementations, matrix operations are between 5-20% more efficient on average.

Adrian