
Jason Hise wrote:
I did something very much like this a while back, which was submitted as a potential jumping off point for a boost geometry library. It is in the boost vault under Math - Geometry (http://tinyurl.com/ymjsoz), along with two other submissions. (Mine is geometryJH_01.zip).
I looked at your matrix implementation briefly, and have a few suggestions: o specialized implementations of inverse and determinant for common sizes (2x2, 3x3, maybe 4x4) will probably give better performance. o I got substantially better performance for matrix multiplies by explicitly unrolling the innermost loop. but I only tested on one platform, so that my not be a universal improvement. I think that if Boost includes such a matrix implementation, it should be in some general math primitives library, because it is applicable to more than just geometry. I think that my design of the matrix class is a little better because a vector is defined as a Nx1 matrix, rather than the matrix being defined as an array of vectors. This avoids the need for special operators for vector-matrix multiplication, is closer to the underlying mathematical concept, and makes the equivalency of a vector and column matrix explicit.