go-gl/mathgl — pull request #16 by Jragonmiris (2014-06-14 14:23:20+00:00)
Title: Add n-dimensional math

Basic utility for n-dimensional math is added. To help curb potential garbage collection issues, it makes use of an optional reallocation callback to release resources when a realloc is needed for the underlying slices.

This is meant for simple, low-dimensional cases and the documentations stresses this. This package is not meant for, and will never be meant for high-dimensional linear algebra. These are simple utilities for corner cases you may run into in your graphical application.

Please take a look and code review the changes because, while it doesn't directly break the API, it is a fairly major change and the API of these functions should be finalized in a way users are happy with before merging the changes into the main branch.

Currently the determinant and inverse are missing. I plan on potentially adding these after a bit of research. I'm determining if cofactor expansion is "good enough". Last time I tried it, it blew up so much after 4x4 it wasn't even worth it. I'm not against writing basic LU decomposition, but I really want to make sure it's necessary first.

Also missing is the Rows/Cols and FromRows/FromCols. This isn't for any particular reason, they'll probably be added later. They didn't seem very pressing to add. In the n-dimensional case they're a bit of a PITA because of all the bounds checking.