Eigen (C++ library): Difference between revisions

From David's Wiki
No edit summary
No edit summary
Line 17: Line 17:
Eigen comes with a few SVD implementations in its [https://eigen.tuxfamily.org/dox/group__SVD__Module.html SVD Module].<br>
Eigen comes with a few SVD implementations in its [https://eigen.tuxfamily.org/dox/group__SVD__Module.html SVD Module].<br>
If you only need low-rank approximations then you may be interested in randomized SVD.<br>
If you only need low-rank approximations then you may be interested in randomized SVD.<br>
This can be 10-20x faster when calculating low-rank approximations on large matrices.<br>
[https://github.com/kazuotani14/RandomizedSvd Github Implementation]<br>
[https://github.com/kazuotani14/RandomizedSvd Github Implementation]<br>
[https://arxiv.org/abs/0909.4061 Finding structure with randomness paper]<br>
[https://arxiv.org/abs/0909.4061 Finding structure with randomness paper]<br>
[https://research.fb.com/blog/2014/09/fast-randomized-svd/ Facebook Blog post]
[https://research.fb.com/blog/2014/09/fast-randomized-svd/ Facebook Blog post]

Revision as of 19:37, 14 October 2019

Eigen is a template header-only C++ linear algebra library. It is one of the fastest and most popular.

Website

Usage

Compilation

Reference
For optimal performance, I recommend using the following flags when compiling.

GCC

  • -mfma Enable fused multiply add
  • -mavx2 Enable avx2 vector instructions
  • -DEIGEN_NO_DEBUG Set preprocessor define for eigen optimizations
  • -fopenmp OpenMP parallel execution

Math

SVD

Eigen comes with a few SVD implementations in its SVD Module.
If you only need low-rank approximations then you may be interested in randomized SVD.
This can be 10-20x faster when calculating low-rank approximations on large matrices.
Github Implementation
Finding structure with randomness paper
Facebook Blog post