Main Page

From Eigen
Revision as of 18:16, 13 June 2008 by Ggael (Talk | contribs)

Jump to: navigation, search

Overview

This is the wiki for Eigen 2, currently under heavy development. The website of Eigen 1 is still there.

Eigen 2 is a C++ template library for linear algebra (vectors, matrices, and related algorithms). It is:

  • Versatile. Eigen handles both fixed-size and dynamic-size matrices and vectors, without code duplication, and in a completely integrated way. It aims to provide not only vectors and matrices but also many algorithms.
  • Fast. Expression templates remove temporaries and enable lazy evaluation. Explicit vectorization is performed for the SSE2 and AltiVec architectures, with graceful fallback to non-vectorized code. With fixed-size objects, dynamic memory allocation is avoided, and the loops are unrolled when that makes sense. For large matrices, our cache-friendly implementation of matrix product has performance comparable to good BLAS implementations.
  • Good API. Expression templates allow for a very clean and expressive API. Implementing an algorithm on top of Eigen feels like just copying pseudocode.

Development status and Todo

Eigen 2 is in alpha status, it is far from feature-complete. The basic vector/matrix functionality is there, and already heavily optimized, with several rough edges remaining. Many linear algebra algorithms are not yet or incompletely implemented.

We try to keep the Todo up-to-date. There are also documentations about some of the Eigen's internal mechanisms there: EigenInternals.

API documentation

The doxygen-generated API documentation is here.

Requirements

Eigen 2 doesn't have any dependency. It just uses a little the C++ standard library.

It uses the CMake build system. However, this is only to build the documentation and unit-tests, and to automate installation. If you just want to use Eigen, you can use the header files right away. There is no binary library to link to (pure template library), and no configured header file.

Download

Here is the source tarball for the latest alpha: eigen-2.0-alpha5.tar.gz

Alternatively, you can checkout the development tree by anonymous svn, by doing:

svn co svn://anonsvn.kde.org/home/kde/branches/work/eigen2

or view it online here

License

Eigen is dual-licensed: it can be redistributed and/or modified, at your choice,

  • either under the LGPL, version 3 or later,
  • or under the GPL, version 2 or later.

Note that this is an OR, not an AND. You do not need to conform to both licenses, you just pick the one that you prefer. Typically, GPL projects will regard Eigen as GPL-licensed while non-GPL projects will regard Eigen as LGPL-licensed.

Short licensing FAQ:

  • Question: Why not just license under the LGPL, since anyway it is more liberal than the GPL?
    • Answer: A library licensed under the LGPL3 cannot be used by a program licensed under the GPL2 (see here for details). Therefore, we offer the GPL2 as an alternative license choice for Eigen, in order to allow GPL2 programs to use it.
  • Question: Why require the LGPL version to be at least 3?
    • Answer: Because up to version 2.1, the LGPL does not handle the case of C++ template libraries, where all the code is in headers. This problem was solved in version 3 of the LGPL.

Authors

Core developers (in alphabetical order):

  • Gaël Guennebaud
  • Benoît Jacob (original developer)

Contributors (in alphabetical order):

  • David Benjamin (draws the owls)
  • Konstantinos Margaritis (Altivec vectorization)
  • Christian Mayer
  • Michael Olbrich

Compiler support

Eigen is standard C++98 and so should theoretically be compatible with any compliant compiler. Of course, in practice, things are slightly different.

Eigen is well tested with recent versions of GCC and gives very good performance with GCC 4.2 and 4.3. For some reason the performance is not so great with GCC 4.1.

Eigen is also well tested on ICC, and gives very good performance there too.

Here are some comments about GCC compiler flags.

  • At least some optimization is mandatory to get even remotely decent speed. -O1 gives something decent for a debug mode, at 30-60% of the optimal speed. -O2 gives optimal speed. Using -O3 does not bring any benefit over -O2, in our experience.
  • Debugging info with -g (equivalently -g2) almost doesn't slow down speed in small programs, but it increases dramatically executable code size (which might cause bad performance if code gets flushed out of cache). Using -g1 brings the executable code size down to a much more reasonable level, close to the code size of non-debug code.

Also, disabling asserts by defining -DNDEBUG or -DEIGEN_NO_DEBUG generally doesn't improve performance much.

However, for benchmarking purposes one should still try with -O3 -DNDEBUG.

Contact us

The best way to contact us is by means of our mailing list: 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

We also have an IRC channel: #eigen on Freenode.