Tue, May 11 2010 | programming
I just discovered eigen, a really nice template library for linear algebra. I was using newmat until now, but was not very satisfied with its API design, and was looking for a single efficient library for both small (3×3) and large matrices. That is were eigen comes in: It has a very intuitive and handy API and can handle both fixed and dynamic-sized matrices in a unified way. Some highlights are
- Direct mapping of STL vector and C array memory into eigen's classes
- Classes for transformations, including quaternions (!)
- Sparse matrix support
- Handy typedefs for common structures, i.e.
Vector3ffor a 3-float-vector andMatrix2dfor a 2×2-double matrix - Comma initialization aka
Vector3f X = Vector3f::Zero(); X << 1, 2, 3;
Eigen is a pure template library, meaning that you can include it in your project by copying the 1-2 MB of Header files into your source tree.
Really great work!