Question

I want to multiple matrix with self transposed. The size of matrix about X[8, 100].

Now it looks " MatrixXf h = X*X.transpose()"

a) Is it possible to use faster multiplication using explicit facts:

  1. Result matrix is symmetric
  2. The X matrix use same data so, can use custom procedure for multiplication. ?

b)Also i can generate X matrix as transposed and use X.transpose()*X, whitch i should prefer for my dimensions ?

c) Any tips on faster multiplication of such matrixes.

Thanks.

Was it helpful?

Solution

(a) Your matrix is too small to take advantage of the symmetry of the result because if you do so, then you will loose vectorization. So there is not much you can do.

(b) The default column storage should be fine for that example.

(c) Make sure you compile with optimizations ON, that you enabled SSE2 (this is the default on 64 bits systems), the devel branch is at least twice as fast for such sizes, and you can get additional speedup by enabling AVX.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top