I have a large matrix M (M is positive definite) with dimension (10000,10000) and I want to do the following operations:
r = transpose(e_i - e_j) * M * (e_i - e_j)
where e_i is zeros vector(10000 x 1) with all zero entries except at ith entry
I want to do this operation for (e_1,e_2)....(e_1,e_10000)... i.e all pair of i,j belong to {1,10000}.
I have try
-do the calculation directly
-Cholesky factorization
Nevertheless, both methods take too long. They took >=0.5 seconds to finished one calculation and therefore it is not feasible in time.
Is there any methods/library I could try to speed up this process?