Live data from Hacker News

Eigen: A C++ template library for linear algebra

eigen.tuxfamily.org

11–20 of 85 posts

Re: Eigen: A C++ template library for linear algebra

#11
My only complaint is that using OpenMP Eigen can be slower with SMT than without SMT. They even suggest telling to use half as many threads as you have "cores" when "cores" means twice as many due to SMT.

Otherwise, we've seen a 8-10x performance increase in SolveSpace (CAD) in some situations after switching from home-grown matrix operations to Eigen.

Re: Eigen: A C++ template library for linear algebra

#14
post #8

Using it for years, and mostly happy with that library. The performance is awesome for very long vectors / large matrices. It’s less than ideal for small things when the size is known at compile-time. If one knows SIMD intrinsics, in some of these cases the Eigen’s implementation can be outperformed by a large factor like 2-4. Also it’s very hard to mess with RAM layout of some things (like sparse matrices), just too…

Can confirm the poor performance on small matrices (less than 20x20). This is a problem particularly for robotics applications when your entities are positions, velocities, etc.

https://stackoverflow.com/questions/58071344/is-eigen-slow-a...

Re: Eigen: A C++ template library for linear algebra

#15

Eigen is a great library. A similar one to consider that can at times be slightly easier to use coming from a python background is armadillo: http://arma.sourceforge.net/

I wonder how Eigen compares to xtensor, which was inspired by Numpy and has support for views, slicing, and broadcasting?

https://github.com/xtensor-stack/xtensor

Re: Eigen: A C++ template library for linear algebra

#17
post #12

God bless Eigen, I am using it to implement the state matrices of a Kalman Filter and it's a joy to use its APIs.

Eigen has one of if not the best linear algebra APIs I've ever seen. In particular, vectors are column vectors by default and you never need to touch row vectors (if I can editorialize, row vectors shouldn't exist at all), and vectors are not simply "n-by-1" matrices -- they're true vectors.

Re: Eigen: A C++ template library for linear algebra

#18
post #8

Using it for years, and mostly happy with that library. The performance is awesome for very long vectors / large matrices. It’s less than ideal for small things when the size is known at compile-time. If one knows SIMD intrinsics, in some of these cases the Eigen’s implementation can be outperformed by a large factor like 2-4. Also it’s very hard to mess with RAM layout of some things (like sparse matrices), just too…

Can confirm the poor performance on small matrices (less than 20x20). This is a problem particularly for robotics applications when your entities are positions, velocities, etc. https://stackoverflow.com/questions/58071344/is-eigen-slow-a...

No estoy de acuerdo con tus politicas

Re: Eigen: A C++ template library for linear algebra

#19

My only complaint is that using OpenMP Eigen can be slower with SMT than without SMT. They even suggest telling to use half as many threads as you have "cores" when "cores" means twice as many due to SMT. Otherwise, we've seen a 8-10x performance increase in SolveSpace (CAD) in some situations after switching from home-grown matrix operations to Eigen.

I think this is generally true if your workload is SIMD/AVX heavy: these types of “heavy” instructions cannot execute on a single core simultaneously.

Re: Eigen: A C++ template library for linear algebra

#20
post #13

A great library, a cornerstone. Many big libraries build on top of it (e.g. OpenCV, PointCloud Library)

Can you elaborate on how OpenCV is built on top of Eigen? From what I can google it seems that OpenCV can interoperate with Eigen but is not build on top of it.
Post reply on HN