Eigen

ℹ️ Site translation in progress

This is a rebuild of the original https://eigen.tuxfamily.org wiki site. Please bear with us as we slowly make the transition to GitLab pages. If you find any issues, please let us know, or submit a merge request to fix it.

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

Download

The latest stable release is Eigen 5.0.0. Get it here: tar.bz2, tar.gz, zip.

The development version can be downloaded here: tar.bz2, tar.gz, zip.

Alternatively, you can check out the Eigen source code using Git:

git clone https://gitlab.com/libeigen/eigen.git

[ Other releases ] [ Browse the source code ]

Recent Announcements

Overview

  • Eigen is versatile.
    • It supports all matrix sizes, from small fixed-size matrices to arbitrarily large dense matrices, and even sparse matrices.
    • It supports all standard numeric types, including std::complex, integers, and is easily extensible to custom numeric types.
    • It supports various matrix decompositions and geometry features.
    • Its ecosystem of unsupported modules provides many specialized features such as non-linear optimization, matrix functions, a polynomial solver, FFT, and much more.
  • Eigen is fast.
    • Expression templates allow intelligently removing temporaries and enable lazy evaluation, when that is appropriate.
    • Explicit vectorization is performed for SSE 2/3/4, AVX, AVX2, FMA, AVX512, ARM NEON (32-bit and 64-bit), PowerPC AltiVec/VSX (32-bit and 64-bit), ZVector (s390x/zEC13) SIMD instruction sets, and since 3.4 MIPS MSA with graceful fallback to non-vectorized code.
    • Fixed-size matrices are fully optimized: dynamic memory allocation is avoided, and the loops are unrolled when that makes sense.
    • For large matrices, special attention is paid to cache-friendliness.
  • Eigen is reliable.
    • Algorithms are carefully selected for reliability. Reliability trade-offs are clearly documented and extremely safe decompositions are available.
    • Eigen is thoroughly tested through its own test suite (over 500 executables), the standard BLAS test suite, and parts of the LAPACK test suite.
  • Eigen is elegant.
    • The API is extremely clean and expressive while feeling natural to C++ programmers, thanks to expression templates.
    • Implementing an algorithm on top of Eigen feels like just copying pseudocode.
  • Eigen has good compiler support as we run our test suite against many compilers to guarantee reliability and work around any compiler bugs. Eigen 3.4 is standard C++03 and is still supported for bug fixes. Eigen 5.0 and later require C++14.

Documentation

Requirements

Eigen doesn’t have any dependencies other than the C++ standard library.

We use the CMake build system, but 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, and no configured header file. Eigen is a pure template library defined in the headers.

License

Eigen is Free Software. Starting from the 3.1.1 version, it is licensed under the MPL2, which is a simple weak copyleft license. Common questions about the MPL2 are answered in the official MPL2 FAQ.

Earlier versions were licensed under the LGPL3+.

Eigen provides interface classes for various third-party libraries (usually recognizable by the <Eigen/*Support> header name). Of course you have to mind the license of the so-included library when using them.

Virtually any software may use Eigen. For example, closed-source software may use Eigen without having to disclose its own source code. Many proprietary and closed-source software projects are using Eigen right now, as well as many BSD-licensed projects.

See the MPL2 FAQ for more information, and do not hesitate to contact us if you have any questions.

Compiler support

The latest version of Eigen is standard C++14 and so should theoretically be compatible with any compliant compiler. Whenever we use some non-standard feature, that is optional and can be disabled.

Regarding performance, Eigen performs best with compilers based on GCC or LLVM/Clang. See this page for some known compilation issues.

Get support

Need help using Eigen? Try this:

  • To get help, stackoverflow is your best resource.
  • Want to discuss something with the developers or have an informal chat on Eigen? Use our Discord server.

Bug reports

For bug reports and feature requests, please use the issue tracker on GitLab.

Discord Server

Join our Discord server!

Everybody’s welcome to discuss Eigen-related topics or just chat. Bugs should still be reported on the issue tracker on GitLab. Discord is an ideal place to ask other users and developers for help.

Contributing to Eigen

Eigen is written and maintained by volunteers. You can contribute in many ways to help: give support to new users, write and improve documentation, helping with bugs and other issues in the issue tracker on GitLab, discussing the design and the API, running tests and writing code. See our page on Contributing to Eigen for pointers to get you started.

Projects using Eigen

If you’d like your project listed here, please submit a merge request or ask on Discord.

Machine Learning and AI

  • TensorFlow — Google’s open-source machine learning framework
  • MuJoCo — a physics engine for model-based design, by Google DeepMind
  • Shogun — a large scale machine learning toolbox
  • Stan — a statistical package based on Eigen with reverse-mode automatic differentiation

Optimization and Numerical Computation

  • Ceres — Google’s portable C++ library for modeling and solving large nonlinear least squares problems
  • GTSAM — a library implementing smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks
  • g2o — an open-source C++ framework for optimizing graph-based nonlinear error functions
  • IFOPT — a modern, lightweight, Eigen-based C++ interface to nonlinear programming solvers such as Ipopt and Snopt
  • CppNumericalSolvers — a lightweight header-only library for non-linear optimization (CG, L-BFGS-B, CMAes, Nelder-Mead)
  • Spectra — a header-only C++ library for large scale eigenvalue problems, built on top of Eigen
  • StOpt — the STochastic OPTimization library for stochastic optimization problems in finance and industry
  • trustOptim — a trust-region based nonlinear solver supporting sparse Hessians (C++ with R binding)
  • preCICE — a coupling library for partitioned multi-physics simulations. Source code
  • The Manifold ToolKit MTK — mechanisms to enable algorithms to operate on manifolds, with a Sparse Least Squares Solver (SLoM) and Unscented Kalman Filter (UKFoM)

Robotics

  • The Robot Operating System (ROS) — the de facto standard middleware for robotics
  • Drake — a planning, control, and analysis toolbox for nonlinear dynamical systems, by Toyota Research Institute
  • MoveIt — the most widely used open-source software for robotic manipulation
  • Cartographer — Google’s real-time simultaneous localization and mapping (SLAM) library
  • Pinocchio — a fast and efficient rigid body dynamics library
  • Sophus — a C++ implementation of Lie groups (SO(3), SE(3), etc.) built on Eigen
  • The Mobile Robot Programming Toolkit (MRPT) — a set of libraries for SLAM, localization, and computer vision
  • RBDL — a C++ library for rigid body dynamics
  • RL — a self-contained C++ library for robot kinematics, motion planning, and control
  • libpointmatcher — an Iterative Closest Point library for 3D mapping in robotics
  • towr — a lightweight C++ library for trajectory optimization for legged robots
  • The Humanoid Path Planner — software for motion and manipulation planning
  • Yujin Robot — uses Eigen for navigation and arm control of their robots
  • openAHRS — open source IMU / AHRS
  • The Darmstadt Dribblers autonomous Humanoid Robot Soccer Team and Darmstadt Rescue Robot Team — use Eigen for navigation and world modeling
  • MIRA — a cross-platform middleware for the development of robotic applications

Computer Vision and 3D Reconstruction

  • OpenCV — the most widely used open-source computer vision library
  • COLMAP — a general-purpose structure-from-motion and multi-view stereo pipeline
  • ORB-SLAM3 — a versatile visual-inertial SLAM system
  • Open3D — a modern library for 3D data processing
  • OpenMVS — open multi-view stereo reconstruction library
  • openMVG — a library for multiple view geometry
  • libmv — an open-source structure from motion library used in Blender
  • Point Cloud Library (PCL) — a large scale open project for point cloud processing

Computer Graphics, Geometry, and Visualization

  • CGAL — the Computational Geometry Algorithms Library
  • VTK — the Visualization Toolkit for 3D computer graphics, image processing, and visualization
  • FreeCAD — a free and open-source parametric 3D CAD modeler
  • libigl — a simple C++ geometry processing library
  • MeshLab — open-source software for processing and editing 3D triangular meshes and point clouds
  • VcgLib — an open-source C++ template library for manipulation and processing of triangle and tetrahedral meshes
  • The Topology ToolKit (TTK) — an open-source library for topological data analysis in scientific visualization
  • eos — a lightweight 3D Morphable Face Model fitting library
  • ApproxMVBB — fast approximate oriented bounding boxes of 3D point clouds
  • piccante — a C++ imaging library for High Dynamic Range (HDR) processing
  • 3DF Zephyr — a commercial photogrammetry and 3D modeling software by 3Dflow
  • WhirlyGlobe-Maply — an open-source geospatial display toolkit for iOS and Android

Science and Engineering

  • The ATLAS experiment at the LHC at CERN uses Eigen, as reported in this article
  • Avogadro — an open-source advanced molecular editor
  • Quantum++ — a modern C++ general purpose quantum computing library
  • iMSTK — an open-source toolkit for interactive multi-modal surgical simulations
  • FlexibleSUSY — a spectrum generator for calculating the masses of elementary particles
  • Yade — a platform for dynamic particle models
  • NIMBLE — a system for programming statistical algorithms such as MCMC from R, with a compiler from R to C++ using Eigen
  • Multiprecision Computing Toolbox for MATLAB — uses Eigen as core library for matrix computations
  • elsa — an elegant framework for tomographic reconstruction
  • G+Smo — an open-source library for geometric design and numerical simulation with isogeometric analysis
  • BTK — Biomechanical ToolKit for analysis of human body motion
  • Nelson — an open computing environment for engineering and scientific applications
  • GINESTRA — a semiconductor device simulator
  • Gnu Data Language — a GPL interpreter of IDL syntax codes
  • Cufflinks — a tool for transcript assembly and differential expression for RNA-Seq
  • EigenLab — a header-only library to parse and evaluate expressions working on Eigen matrices

Bindings

  • Eigenpy — efficient bindings between NumPy and Eigen using Boost.Python with Geometry module support
  • RcppEigen — bindings and more for R
  • OCamlEigen — a thin OCaml interface to Eigen
  • haskell-eigen — bindings for the Haskell language
  • jeigen — a Java wrapper for Eigen
  • minieigen — a small boost::python wrapper for Eigen’s core classes
  • Eigency — a Cython interface between NumPy arrays and Eigen Matrix/Array classes
  • sparray — a Python binding of the Sparse module
  • Eigen4AutoIt — a wrapper for the AutoIt scripting language
  • eigen-lua — a Lua wrapper around parts of Eigen

KDE (our origins!)

Credits

The Eigen project was started by Benoît Jacob (founder) and Gaël Guennebaud (guru). Many other people have since contributed their talents to help make Eigen successful. Here’s an alphabetical list: (note to contributors: do add yourself!)

Philip Avery Fix bug and add functionality to AutoDiff module
Abraham Bachrach Added functions for cwise min/max with a scalar
Sebastien Barthelemy Fix EIGEN_INITIALIZE_MATRICES_BY_NAN
Carlos Becker Wrote some of the pages of the tutorial
David Benjamin Artwork: the owls
Cyrille Berger Fix error in logic of installation script
Armin Berres Lots of fixes (compilation warnings and errors)
Jose Luis Blanco Build fixes for MSVC and AMD64, correction in docs
Mark Borgerding FFT module
Romain Bossart Updates to Sparse solvers
Steve Bronder AVX-512 optimizations
Kolja Brix Added docs to Householder module, fixes for ARPACK wrapper, KroneckerProduct and GMRES
Gauthier Brun Making a start with a divide-and-conquer SVD implementation
Gabriele Buondonno Vector2d cross product
Philipp Büttgenbach Bug fix when differentiating a one-dimensional spline
Thomas Capricelli Non-linear optimization and numerical differentiation, cron-job to update the online dox
Nicolas Carre Making a start with a divide-and-conquer SVD implementation
Jean Ceccato Making a start with a divide-and-conquer SVD implementation
Vladimir Chalupecky CMake fix
Benjamin Chrétien Bug fix for PolynomialSolver (linear polynomials), various typos
Andrew Coles Fixes (including a compilation error)
Jeff “complexzeros” Spline interpolation with derivatives
Everton Constantino General performance enhancements for PowerPC
Marton Danoczy MSVC compilation fix, support for ARM NEON with Clang 3.0 and LLVM-GCC
Jeff Dean Fix in vectorized square root for small arguments
Georg Drenkhahn CMake and STL fixes
Christian Ehrlicher MSVC compilation fix
Martinho Fernandes Make our aligned allocator support C++11
Daniel Gomez Ferro Improvements in Sparse and in matrix product
Rohit Garg Vectorized quaternion and cross products, improved integer product
Mathieu Gautier QuaternionMap and related improvements
Anton Gladky Visual Studio 2008 and GCC 4.6 compilation fixes
Stuart Glaser Prevent allocations in LU decomposition
Marc Glisse C++11 compilation issues (suffices for literals)
Frederic Gosselin Improve filter for hidden files in CMake
Christoph Grüninger Add SuperLU 5 support
Gaël Guennebaud Core developer
Philippe Hamelin Allow CMake project to be included in another project
Marcus D. Hanwell CMake improvements. Marcus is a developer at Kitware!
David Harmon Arpack support module
Chen-Pang He Many improvements to MatrixFunctions and KroneckerProduct modules
Hauke Heibel Extended matrix functions, STL compatibility, Splines, CMake improvements, and more …
Christoph Hertzberg Quaternions, shifts for Cholmod, bug fixes, lots of user support on forums and IRC
Pavel Holoborodko Multi-precision support with MPFR C++, bug fixes for non-standard scalar types
Tim Holy Improvements to tutorial, LDLT update and downdate
Intel Back-end to Intel Math Kernel Library (MKL)
Trevor Irons Square root for complex numbers, fix compile errors and mistake in docs
Benoît Jacob Core developer
Bram de Jong Improvement to benchmark suite
Chip Kerchner PowerPC performance optimizations
Kibeom Kim Implement *= /= * / operations for VectorwiseOp
Moritz Klammler Avoid memory leak when constructor of user-defined type throws exception
Claas Köhler Improvements to Fortran and FFTW in CMake
Alexey Korepanov Add RealQZ class
Igor Krivenko Properly cast constants when using non-standard scalars
Marijn Kruisselbrink CMake fixes
Abhijit Kundu Fix compilation errors in OpenGL demos
Moritz Lenz Allow solving transposed problem with SuperLU
Rasmus Munk Larsen Core Developer, matrix decompositions, SIMD math functions
Bo Li Fix bugs in Spline constructor
Sebastian Lipponer MSVC compilation support
Daniel Lowenberg Add SparseView class
David J. Luitz Bug fix for sparse * dense matrix product
Naumov Maks Bug fix in polynomial solver test
Angelos Mantzaflaris Fix to allow IncompleteLUT to be used with MPFR
D J Marcin Fix operator& precedence bug
Konstantinos A. Margaritis AltiVec/VSX, ARM NEON (32-bit/64-bit) and S390x SIMD (ZVector) vectorization
Roger Martin Component-wise arc tangent function
Ricard Marxer Reverse, redux improvements, the count() method, some dox
Vincenzo Di Massa CMake fix
Christian Mayer Early code review and input in technical/design discussions
Frank Meier-Dörnberg MSVC compatibility fixes
Keir Mierle LDLT decomposition and other improvements, help with MPL relicensing
Laurent Montel CMake improvements. Laurent is (with Alexander) one of the CMake gurus at KDE!
Eamon Nerbonne Compilation fixes for win32
Alexander Neundorf CMake improvements. Alexander is (with Laurent) one of the CMake gurus at KDE!
Jason Newton Componentwise tangent functions
Jitse Niesen Matrix functions, large improvements in the Eigenvalues module and in the docs, and more …
Desire Nuentsa Many improvements to Sparse module: SparseLU, SparseQR, ILUT, PaStiXSupport, …
Jan Oberländer Compatibility with termios.h
Jos van den Oever Compilation fix
Michael Olbrich Early patches, including the initial loop meta-unroller
Simon Pilgrim Optimizations for NEON
Bjorn Piltz Visual C compilation fix
Benjamin Piwowarski Add conservativeResize() for sparse matrices
Zach Ploskey Copy-editing of tutorial
Giacomo Po MINRES iterative solver
Sergey Popov Fix bug in SelfAdjointEigenSolver
Guoqiang QI Several performance improvements for ARM and x86 [MRs].
Manoj Rajagopalan Introduce middleRows() / middleCols(), bug fix for nonstandard numeric types
Stjepan Rajko MSVC compatibility fix
Jure Repinc CMake fixes
Kenneth Frank Riddile Lots of Windows/MSVC compatibility fixes, handling of alignment issues
Richard Roberts Bug fix in selection of MKL Householder QR
Adolfo Rodriguez Prevent allocations in matrix decompositions
Peter Román Support for SuperLU’s ILU factorization
Oliver Ruepp Bug fix in sparse matrix product with row-major matrices
Radu Bogdan Rusu Fix compilation warning
C. Antonio Sanchez Core Developer
Guillaume Saupin Skyline matrices
Olivier Saut Typo in documentation
Benjamin Schindler gdb pretty printers
Charles Schlosser Core Developer
Michael Schmidt Fix in assembly when identifying CPU, Compilation fix connected to min/max
Dennis Schridde New typedefs like AlignedBox3f
Jakob Schwendner Test for unaligned quaternions, Benchmark for Geometry module
Christian Seiler The Tensor module
Martin Senst Bug fix for empty matrices
Sameer Sheorey Fix gdb pretty printer for variable-size matrices
Andy Somerville Functions to get intersection between two ParametrizedLines
Alex Stapleton Help with tough C++ questions
Benoit Steiner Faster matrix multiplication, Tensor module, CUDA
Ludwig Striet Complex QZ eigensolver
Sven Strothoff Add intersects() method to AlignedBox
Leszek Swirski Fix oversight in installation scripts
Adam Szalkowski Bug fix in MatrixBase::makeHouseholder()
Silvio Traversaro Fix for FindEigen3.cmake
Piotr Trojanek QCC compilation fixes
Anthony Truchet Bugfix in QTransform and QMatrix support
Adolfo Rodriguez Tsourouksdissian Version of JacobiSVD that pre-allocates its resources
David Tellenbach General project maintenance, Continuous Integration, various code contributions
James Richard Tyrer CMake fix
Rhys Ulerich Pkg-config support, improved GDB pretty-printer
Henry de Valence Typo in documentation
Ingmar Vanhassel CMake fix
Michiel Van Dyck Multi-threading documentation bug fix
Scott Wheeler Documentation improvements
Freddie Witherden CMake fixes, allow LevenbergMarquardt to work with non-standard types
Urs Wolfer Fixed a serious warning
Manuel Yguel Bug fixes, work on inverse-with-check, the Polynomial module
Pierre Zoppitelli Making a start with a divide-and-conquer SVD implementation
Jonas Adler Bugfixes for CUDA support

Eigen is also using code that we copied from other sources. They are acknowledged in our sources and in the Git history, but let’s also mention them here:

Intel Corporation SSE code for 4x4 matrix inversion taken from here.
Tim Davis AMD reordering simplicial sparse Cholesky factorization adapted from SuiteSparse
Julien Pommier SSE implementation of exp,log,cos,sin math functions from GMM++
Yousef Saad IncompleteLUT preconditioner coming from ITSOL
Minpack authors Algorithms for non linear optimization.

Special thanks to GitLab for hosting the Eigen project, Tuxfamily for their long-time hosting of the original site, and the GCC Compile Farm Project that gives us access to many various systems including ARM NEON.

If you are looking for a BibTeX entry to use to cite Eigen in academic papers, see the BibTeX page.