There are some much faster algorithms for generic matrix multiplication than the trivial one from Netlib. ATLAS implements one using a lot of #define statements. It'd be good if we could do the same thing in our gemm.template.c generic version, so that we have fast multiplication for rational, integer, and Ruby obj matrices.
This particular ticket involves some research. A good place to start would be Strassen's algorithm.