more efficient matrix inner product computation

Here, we use a more efficient method to compute Tr(A' B). 

Note: I'm not actually sure what the best way to do this with armadillo (for instance, `accu(a & b)` could still create a temporary matrix), but I think this is better than `trace(A * B)`.