eigen
Eigen
Table of contents
Overview
License
Features
News
Download
Relation to KDE
Examples
Applications using Eigen
Authors
Contact us
Mailing list
Overview
Eigen is a lightweight C++ template library for vector and matrix math, a.k.a. linear algebra.
Unlike most other linear algebra libraries, Eigen focuses on the simple mathematical needs of applications: games and other OpenGL apps, spreadsheets and other office apps, etc. Eigen is dedicated to providing optimal speed with GCC.
- Its fixed-size classes are specially optimized for small sizes up to 4, although it is theoretically possible to specialize them to any size. They never cause dynamic memory applications and the simple operations on them are as fast as is possible at least for sizes up to 4 (see below).
- Its dynamic-size classes are more flexible and suitable for larger sizes.
License
Eigen is distributed under the GPL, but with an exception allowing any software to use it. Thus, to the question "Can my own project use Eigen?", the answer is a definite yes.
This is similar to the LGPL in spirit. The reason why we don't use the LGPL is that it doesn't make sense for a pure template library like Eigen, where all the code is in headers.
Features
- No dependency. Only relies on the C++ Standard Library, and only does so for a few things.
- As a consequence: very good portability.
-
Very good performance (tested with GCC, should apply to other compilers as well):
- The fixed-size classes are optimal in the sense that they're just plain C arrays with methods manipulating them. They never cause dynamic memory allocations. Checked with valgrind.
- The assembly code generated by GCC has been carefully checked to make sure that loop unrolling and function inlining work as expected with "g++ -O2" and "g++ -O3".
- For the loops that GCC fails to unroll (mostly nested loops), we provide hand-unrolled versions for sizes up to 4.
- There is no "virtual" keyword in Eigen.
- Eigen never trades performance for syntactic sugar. When some method introduces a significant language overhead (e.g. returns an object by value), we provide an alternative method doing the same thing faster but without the syntactic sugar.
- Provides easy-to-use classes for solving systems of linear equations.
- Provides easy-to-use functions for linear regression analysis.
- Can perform LU decompositions and use them to invert matrices, compute rank, kernel, etc.
-
Integrates nicely with OpenGL:
- Provides functions and classes for projective geometry.
- Stores matrices in column-dominant order, hence matrices can be directly passed between OpenGL and Eigen.
- Uses an OpenGL-like typedef naming scheme, for instance Vector3f for vectors of floats of size 3.
-
Robust:
- Only uses algorithms that are guaranteed to work in all cases. For example, the LU decomposition is done with complete pivoting, which means that it works for all square matrices, even singular ones.
- Covered by extensive unit-tests.
- Thread-safe, though that's only as a consequence of staying simple and not trying to do advanced stuff like buffer sharing.
- Floating-point-correct. Eigen has a clear, simple and sound policy with respect to the inherent problems of IEEE754 floating-point arithmetic.
- Fully supports std::complex for matrices and vectors over the complex numbers.
- Is a pure template library and consists only of header files. Thus, using Eigen will only add a build-time dependency to your project.
-
Uses standard asserts, controlled as usual by NDEBUG. To achieve optimal performance, turn them off by defining NDEBUG, e.g.
g++ -O3 -DNDEBUG myprogram.cpp
News
If you want to stay informed of Eigen news and releases, please subscribe to our mailing list. You can also browse the archive.
Download
The source code of the latest release is here: eigen-1.0.5.tar.gz
Alternatively, you can checkout the development tree by anonymous svn, by doing:
svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigenor view it online at this address: http://websvn.kde.org/trunk/kdesupport/eigen/
Relation to KDE
First of all: Eigen doesn't have any dependency. In particular, it doesn't depend on any part of KDE or on Qt.
Eigen is part of the KDE project, in the sense that:
- Its development tree is hosted in the KDE repository.
- It has been founded by, and is developed by KDE people.
- It has originally been designed for the needs of KDE applications, especially Kalzium.
Although Eigen itself doesn't have any dependency, the unit-tests and the example program require Qt 4.
Examples
In examples/qt is an example program demonstrating how Eigen's projective-geometry features can help writing OpenGL apps. See also this blog entry.
Applications using Eigen
- Kalzium, as of the current development version that'll ship with KDE 4 in 2007. Eigen already allowed to add some cool stuff to Kalzium.
- KSpread, as of the current development version that'll ship with KOffice 2 in 2007. Eigen seems to cover well KSpread's linear algebra needs.
Please tell us if you know of other interesting projects using Eigen!
Authors
Lead Developer: Benoit Jacob (jacob at math jussieu fr)
Contributors:
- Casper Boemann (cbr at boemann dk) : project co-founder, initial development
- David Faure (faure at kde dot org) : portability fixes
- Franz Keferboeck (franz keferboeck at gmail com) : contributions in matrixbase.h
- Carsten Niehaus (cniehaus at gmx de) : helped with QTestLib, Doxygen, CMake
- Inge Wallin (inge at lysator liu se) : project co-founder, initial development
Special thanks to: Cyrille Berger, Sylvain Joyeux, Thiago Macieira, Pino Toscano
Contact us
The best way to contact us is by means of our mailing list.
IRC Channel: #eigen on Freenode.
Website (you're here): http://eigen.tuxfamily.org
Mailing list
The Mailing list for Eigen is: eigen at lists tuxfamily org.
To subscribe, send a mail with subject "subscribe" to eigen-request at lists tuxfamily org.
To unsubscribe, send a mail with subject "unsubscribe" to eigen-request at lists tuxfamily org.
You can also browse the archive.
Exception to the GPL
Eigen is licensed under the GNU GPL, version 2 or later, plus the following exception, which is replicated into each of the source files of Eigen:
// As a special exception, if other files instantiate templates or use macros // or inline functions from this file, or you compile this file and link it // with other works to produce a work based on this file, this file does not // by itself cause the resulting work to be covered by the GNU General Public // License. This exception does not invalidate any other reasons why a work // based on this file might be covered by the GNU General Public License.
KDE 4.2 API Reference