Difference between revisions of "Main Page"

From Eigen
Jump to: navigation, search
(Documentation)
(Compiler support)
Line 97: Line 97:
 
* GCC, version 3.3 and newer. Very good performance with GCC 4.2 and 4.3.
 
* GCC, version 3.3 and newer. Very good performance with GCC 4.2 and 4.3.
 
* ICC, recent versions. Very good performance.
 
* ICC, recent versions. Very good performance.
* MinGW, recent versions.
+
* MinGW, recent versions. Performance is poor because MinGW uses GCC 3. This problem will go away whenever MinGW upgrades to GCC 4.
 
* MSVC, recent versions.
 
* MSVC, recent versions.
  

Revision as of 15:18, 5 December 2008

This is the wiki for Eigen 2, currently in beta testing.
The website of Eigen 1 is still there.

Overview

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

  • Versatile. (See modules and tutorial). Eigen handles, without code duplication, and in a completely integrated way:
    • both fixed-size and dynamic-size matrices and vectors.
    • both dense and sparse (the latter is still experimental) matrices and vectors.
    • both plain matrices/vectors and abstract expressions.
    • both column-major (the default) and row-major matrix storage.
    • both basic matrix/vector manipulation and many more advanced, specialized modules providing algorithms for linear algebra, geometry, quaternions, or advanced array manipulation.
  • Fast. (See benchmark).
    • Expression templates allow to intelligently remove temporaries and enable lazy evaluation, when that is appropriate -- Eigen takes care of this automatically and handles aliasing too in most cases.
    • Explicit vectorization is performed for the SSE (2 and later) and AltiVec instruction sets, with graceful fallback to non-vectorized code. Expression templates allow to perform these optimizations globally for whole expressions.
    • With fixed-size objects, dynamic memory allocation is avoided, and the loops are unrolled when that makes sense.
    • For large matrices, special attention is paid to cache-friendliness.
  • Elegant. (See API showcase). The API is extremely clean and expressive, thanks to expression templates. Implementing an algorithm on top of Eigen feels like just copying pseudocode. You can use complex expressions and still rely on Eigen to produce optimized code: there is no need for you to manually decompose expressions into small steps.
  • Compiler-friendy. Eigen has very reasonable compilation times at least with GCC, compared to other C++ libraries based on expression templates and heavy metaprogramming. Eigen is also standard C++ and supports various compilers.

Development status and Todo

Eigen 2.0 is in beta-testing, it is essentially feature-complete and API-stable, and should be released shortly.

Features that are not considered ready for 2.0 are being postponed for 2.1, but the current code is still left in the pre-release tarballs for everyone to enjoy. This includes the Sparse module.

We try to keep the Todo up-to-date.

Documentation

The documentation is here.

It includes a Tutorial.

To learn about the internals of Eigen, read this example and check out this page about some of Eigen's internal mechanisms: EigenInternals.

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 release: eigen-2.0-beta1.tar.bz2

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

svn co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/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

Contributors (in alphabetical order):

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

Special thanks to Tuxfamily for the wonderful quality of their services!

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 being successfully used with the following compilers:

  • GCC, version 3.3 and newer. Very good performance with GCC 4.2 and 4.3.
  • ICC, recent versions. Very good performance.
  • MinGW, recent versions. Performance is poor because MinGW uses GCC 3. This problem will go away whenever MinGW upgrades to GCC 4.
  • MSVC, recent versions.

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 generally gives optimal speed. -O3 does not have much advantages over -O2, in our experience.
  • Debugging info with -g (equivalently -g2) can increase dramatically the executable file's size. This is always the case, but even more so with Eigen.
  • Disabling asserts, by defining -DNDEBUG or -DEIGEN_NO_DEBUG, improves performance in some cases.
  • Vectorization is automatically enabled if a SIMD instruction set is enabled by the compiler. On the x86 platform, SSE2 is not enabled by default and you need to pass the -msse2 option.

Projects using Eigen 2

While Eigen2 is still a pretty young library, it is already used by a couple of applications and projects:

  • Various KDE related projects such as some screensavers, kgllib, kglengine2d, solidkreator, etc.
  • Koffice2 (KDE's office suite), in particular Krita, the painting and image editing module. Eigen2 is also used a bit by KSpread, the spreadsheet module, for matrix functions such as MINVERSE, MMULT, MDETERM.
  • Avogadro, an opensource advanced molecular editor.
  • VcgLib, an opensource C++ template library for the manipulation and processing of triangle and tetrahedral meshes. (switched from home made math classes)
  • MeshLab, an opensource software for the processing and editing of unstructured 3D triangular meshes and point cloud. (switched from vcglib's math classes)
  • Expe, an experimental framework for the rapid prototyping of graphics applications. No release yet, but it uses 90% of Eigen2's features. (switched from home made math classes).
  • libmv, an opensource structure from motion library. (switched from FLENS)
  • The Yujin Robot company uses Eigen2 for the navigation and arm control of their next gen robots. (switched from blitz, ublas and tvmet)

If you are aware of some interesting projects using Eigen2, please send us a message or directly edit this wiki page !

Contact us

The best way to contact us is by means of our mailing list: eigen at lists tuxfamily org. You need to subscribe before you may post.

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.