As part of my pipeline I need to perform eigendecomposition of a big matrix in the order of 6000x6000. The matrix is dense, so except if I simplify the problem (sot sure if possible) no sparse method can be used.
At the moment I play with toy data. Using the Eigen library for a 513x513 matrix I need ~6.5 seconds, while for a 2049x2049 matrix I need ~130 seconds, which sounds prohibitive since the increase is not linear. This was achieved with Eigen::SelfAdjointEigenSolver
, while with other methods like Eigen::EigenSolver
or Eigen::ComplexEigenSolver
I didn't get notable improvement. The same happened when I tried Armadillo with arma::eig_sym
even with the option "dc"` that is supposed to give a faster but approximate result. Armadillo has some methods thatreturn only the first X eigenvalues for speedup, but this is only for sparse methods. At the moment I can probably get away with the first 10-20 eigenvalues.
Is there a way or a library/method that can give me a notable speedup?
Eigen::SelfAdjointEigenSolver
, and 280s for a 6000x6000 matrix. Make sure you compiled with compiler optimizations ON. Of course, this is still prohibitive and better use a dedicated algorithm extracting only the first eigenvectors. – Foliar