Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
To check out the Eigen repository using Git, do:
git clone https://gitlab.com/libeigen/eigen.git
- 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.
- 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 up to version 3.4 is standard C++03 and maintains reasonable compilation times. Versions following 3.4 will be C++14.
- Eigen 3 documentation: this includes a getting started guide, a long tutorial, a quick reference, and page about porting from Eigen 2 to Eigen 3.
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.
Earlier versions were licensed under the LGPL3+.
Note that currently, a few features rely on third-party code licensed under the LGPL: constrained_cg. Such features can be explicitly disabled by compiling with the EIGEN_MPL2_ONLY preprocessor symbol defined. Furthermore, 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.
Eigen is standard C++98 and so should theoretically be compatible with any compliant compiler. Whenever we use some non-standard feature, that is optional and can be disabled.
Eigen is being successfully used with the following compilers:
- GCC, version 4.8 and newer. Older versions of gcc might work as well but they are not tested anymore.
- MSVC (Visual Studio), 2012 and newer. Be aware that enabling IntelliSense (/FR flag) is known to trigger some internal compilation errors. The old 3.2 version of Eigen supports MSVC 2010, and the 3.1 version supports MSVC 2008.
- Intel C++ compiler. Enabling the -inline-forceinline option is highly recommended.
- LLVM/CLang++, version 3.4 and newer. (The 2.8 version used to work fine, but it is not tested with up-to-date versions of Eigen)
- XCode 7 and newer. Based on LLVM/CLang.
- MinGW, recent versions. Based on GCC.
- QNX's QCC compiler.
Regarding performance, Eigen performs best with compilers based on GCC or LLVM/Clang. See this page for some known compilation issues.
Need help using Eigen? Try this:
- To get help, stackoverflow is your best resource. You can also search within the forum archives.
- Want to discuss something with the developers? Use our mailing list.
- Want to have an informal chat on Eigen? Use our Discord server.
For bug reports and feature requests, please use the issue tracker on GitLab.
- To subscribe, send a mail with subject subscribe to firstname.lastname@example.org
- To unsubscribe, send a mail with subject unsubscribe to email@example.com
In both cases, you will get a confirmation mail to which you need to reply. If you have any trouble please ask at the eigen-core-team address for help.
The Eigen mailing list can be used for discussing general Eigen development topics. End-user questions are often better asked on the Use our Discord server or Users Forum. Development of specific features is best tracked and discussed on our issue tracker on GitLab.
This mailing list is public and has public archives.
Important: You must subscribe before you may post. Sorry, this is our only way to prevent spam.
Important: After you sent your subscription request, you will receive a confirmation e-mail. Check your spam folder, as these confirmation e-mails are often filtered as spam!
There is also a private mailing list which should only be used if you want to write privately to a few core developers (it is read by Gaël, Christoph, Rasmus, Antonio, David, and Constantino). The address is eigen-core-team at the same lists server as for the Eigen mailing list. You do not need to subscribe (actually, subscription is closed). For all Eigen development discussion, use the public mailing list or the issue tracker on GitLab instead.
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 and formal discussions should happen on the mailing list. 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
Feel free to add yourself! If you don't have access to the wiki or if you are not sure about the relevance of your project, ask at the #Mailing list.
Extensions, numerical computation
- Google's TensorFlow is an Open Source Software Library for Machine Intelligence
- Google's Ceres solver is a portable C++ library that allows for modeling and solving large complicated nonlinear least squares problems.
- The Manifold ToolKit MTK provides easy mechanisms to enable arbitrary algorithms to operate on manifolds. It also provides a Sparse Least Squares Solver (SLoM) and an Unscented Kalman Filter (UKFoM).
- IFOPT is a modern, light-weight, Eigen-based C++ interface to Nonlinear Programming solvers, such as Ipopt and Snopt.
- CppNumericalSolvers is a lightweight header-only library for non-linear optimization including various solvers: CG, L-BGFS-B, CMAes, Nelder-Mead.
- GTSAM is a library implementing smoothing and mapping (SAM) in robotics and vision, using factor graphs and Bayes networks.
- g2o is an open-source C++ framework for optimizing graph-based nonlinear least-square problems.
- redsvd is a RandomizED Singular Value Decomposition library for sparse or very large dense matrices.
- trustOptim is a trust-region based non linear solver supporting sparse Hessians (C++ implementation with R binding).
- Shogun: a large scale machine learning toolbox.
- Stan: a statistical package based on Eigen that includes a reverse-mode automatic differentiation implementation.
- StOpt, the STochastic OPTimization library aims at providing tools in C++ for solving some stochastic optimization problems encountered in finance or in the industry.
- Nelson an open computing environment for engineering and scientific applications using modern C/C++ libraries (Boost, Eigen, FFTW, …) and others state of art numerical libraries. (GPL2)
- EigenLab is a header only library to parse and evaluate expressions working on Eigen matrices.
- SpaFEDte a C++ library for discontinuous Galerkin discretizations on general meshes.
- biicode a C and C++ dependency manager that #includes the most popular and useful C/C++ libs and frameworks.
- CERTH's AKSDA: a GPU-accelerated dimensionality reduction and classification method for high-dimensional data.
- Spectra stands for Sparse Eigenvalue Computation Toolkit as a Redesigned ARPACK. It is a header-only C++ library for large scale eigenvalue problems, built on top of Eigen.
- preCICE is a coupling library for partitioned multi-physics simulations, including, but not restricted to fluid-structure interaction and conjugate heat transfer simulations. It supports OpenFOAM, CalculiX, SU2, and several other well-known, as well as in-house solvers. It is free/open-source software and its code is available on GitHub under the LGPL3 license. Link to source code and documentation
- The RcppEigen package provides bindings and more for R.
- minieigen is small boost::python wrapper for Eigen's core classes (dense fixed and dynamic-sized vectors, matrices, aligned boxes, quaternions; with integer, floating and complex scalars) including operators and subset of Eigen's API methods.
- Eigency is a Cython interface between the numpy arrays and the Matrix/Array classes of the Eigen C++ library.
- sparray: a python binding of the Sparse module - alpha stage.
- OCamlEigen, a thin OCaml interface to the Eigen 3 C++ library.
- haskell-eigen offers bindings for the Haskell language.
- jeigen, a Java wrapper for Eigen.
- Eigen4AutoIt, a wrapper for the AutoIt scripting language.
- eigen-lua, a Lua wrapper around parts of the Eigen numerical library.
- Eigenpy: Efficient bindings between Numpy and Eigen using Boost.Python with support of the Geometry module
- GINESTRA, a semiconductor device simulator with a focus on advanced dielectric materials and interfaces.
- G+Smo, an open-source library for geometric design and numerical simulation with isogeometric analyis.
- FlexibleSUSY, a spectrum generator which calculates the masses of elementary particles.
- The ATLAS experiment at the LHC (Large Hadron Collider) at CERN is using Eigen, as reported in this article, noting "Eigen was chosen since it offered the largest performance improvements for ATLAS use cases of the options investigated."
- The Large Survey Synoptic Telescope (website; trac) is a project to build a 3.2Mpixel camera on an 8.4m telescope and survey the entire visible sky every three days.
- Gnu Data Language, a GPL interpretor of IDL syntax codes.
- Avogadro, an opensource advanced molecular editor.
- The 3D astronomical visualization application Celestia is now using Eigen for all orbital and geometric calculation.
- Yade, platform for dynamic particle models, uses Eigen for geometric computations (switched from the WildMagic package)
- SLangTNG, an application suite for numerical analysis, linear algebra, advanced statistics, FEM, structural dynamics, data visualization, etc.
- Clip, an opensource program for the orientation of Laue exposures.
- Multiprecision Computing Toolbox for MATLAB uses Eigen as core library for matrix computations.
- Pteros, a C++ library for molecular modeling.
- Cufflinks, a tool for transcript assembly, differential expression, and differential regulation for RNA-Sequences.
- Vortexje: a GPL library for simulation implementing the source-doublet panel method.
- Woo(dem), particle dynamics software (DEM, FEM); Eigen wrapped using minieigen in Python.
- NIMBLE, a system for programming statistical algorithms such as Markov chain Monte Carlo from R. NIMBLE includes a compiler for a subset of R to C++ that uses Eigen.
- ENigMA is a multiphysics numerical library which uses Eigen.
- iMSTK is an open source software toolkit written in C++ that aids rapid prototyping of interactive multi-modal surgical simulations.
- mbsolve is an open-source solver tool for the Maxwell-Bloch equations, which are used to model light-matter interaction in nonlinear optics.
- Spin-Scenario, a flexible scripting environment for realistic magnetic resonance (NMR/MRI) simulations.
- Quantum++ is a modern C++ general purpose quantum computing library, composed solely of template header files.
- elsa, an elegant framework for tomographic reconstruction.
- Quit, a collection of programs for processing quantitative MRI data.
Robotics and engineering
- The Yujin Robot company uses Eigen for the navigation and arm control of their next gen robots. (switched from blitz, ublas and tvmet)
- The Robotic Operating System (ROS) developed by Willow Garage.
- 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.
- The Mobile Robot Programming Toolkit (MRPT), a set of libraries for SLAM, localization and computer vision, moved to Eigen (switched from home made math classes).
- RBDL: a C++ library for rigid body dynamics.
- RL a self-contained C++ library for robot kinematics, motion planning and control.
- BTK is a Biomechanical ToolKit, licensed under BSD whose primary goal is to propose a set of tools for the analysis of the human body motion which is independent of any acquisition system. It proposes bindings for Matlab/Octave and Python, and a GUI software called Mokka to visualize/analyze 3D/2D motion capture data.
- libpointmatcher is a "Iterative Closest Point" library for 3D mapping in robotics.
- RobOptim is a modern, Open-Source, C++ library for numerical optimization applied to robotics.
- towr is a light-weight and extensible C++ library for trajectory optimization for legged robots.
- Pinocchio: a fast and efficient Rigid Body Dynamics library
- The Humanoid Path Planner: a software for Motion and Manipulation Planning
- MIRA is a cross-platform framework written in C++ that provides a middleware for the development of complex robotic applications, which consists of distributed software modules.
Computer Graphics, Geometry, Visualization
- Computational Geometry Algorithms Library (CGAL), a collaborative effort to develop a robust, easy to use, and efficient C++ software library of geometric data structures and algorithms.
- Point Cloud Library (PCL), a large scale, BSD licensed, open project for point cloud processing. Uses Eigen as their math backend.
- 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)
- eos, an opensource and lightweight 3D Morphable Face Model fitting library in modern C++11/14.
- The Topology ToolKit (TTK), an open-source library and software collection for topological data analysis in scientific visualization.
- Theia, an opensource C++ structure from motion library tailored for researchers, BSD licensed.
- libmv, an opensource structure from motion library. (switched from FLENS)
- openMVG, a simple library for multiple view geometry.
- metronome , a simple metric storage/graphing engine using Eigen for SVD least squares interpolation & data consolidation
- piccante, a C++ imaging library designed for High Dynamic Range (HDR) processing.
- libigl is a simple C++ geometry processing library with wide functionality.
- ApproxMVBB is a small library to compute fast approximate oriented bounding boxes of 3D point clouds.
- Madplotlib makes it easier to plot 2D charts on Qt from data created by Eigen::ArrayXf.
- 3DF Zephyr is a commercial photogrammetry and 3D modeling software, developed by 3Dflow srl
- Layar, an augmented reality application for IPhone and Android.
- Red Sword Studios, maker of the iPhone games Gradient, Fortress Luna, Stimulus, and Lustre, uses Eigen extensively. Why roll your own matrix/vector/transformation code when there's Eigen?
- WhirlyGlobe-Maply an open source geospatial display toolkit for iOS and Android. It implements both a 3D interactive globe and a 2D (slippy) map
KDE (our origins!)
- Step, an educational physics simulator.
- Calligra Sheets, the spreadsheet module of KDE's office suite uses Eigen for matrix functions such as MINVERSE, MMULT, MDETERM.
- Krita, a professional free and open-source painting program
- Kalzium uses Eigen indirectly through the aforementioned Avogadro library.
- the Mandelbrot wallpaper plugin, some screensavers, kgllib, solidkreator, etc.
If you are aware of some interesting projects using Eigen, please send us a message (including a link and short description) or directly edit this wiki page!
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!)
|Fix bug and add functionality to AutoDiff module
|Added functions for cwise min/max with a scalar
|Wrote some of the pages of the tutorial
|Artwork: the owls
|Fix error in logic of installation script
|Lots of fixes (compilation warnings and errors)
|Jose Luis Blanco
|Build fixes for MSVC and AMD64, correction in docs
|Updates to Sparse solvers
|Added docs to Householder module, fixes for ARPACK wrapper, KroneckerProduct and GMRES
|Making a start with a divide-and-conquer SVD implementation
|Vector2d cross product
|Bug fix when differentiating a one-dimensional spline
|Migration to mercurial, Non-linear optimization and numerical differentiation, cron-job to update the online dox
|Making a start with a divide-and-conquer SVD implementation
|Making a start with a divide-and-conquer SVD implementation
|Bug fix for PolynomialSolver (linear polynomials), various typos
|Fixes (including a compilation error)
|Spline interpolation with derivatives
|General performance enhancements for PowerPC
|MSVC compilation fix, support for ARM NEON with Clang 3.0 and LLVM-GCC
|Fix in vectorized square root for small arguments
|CMake and STL fixes
|MSVC compilation fix
|Make our aligned allocator support C++11
|Daniel Gomez Ferro
|Improvements in Sparse and in matrix product
|Vectorized quaternion and cross products, improved integer product
|QuaternionMap and related improvements
|Visual Studio 2008 and GCC 4.6 compilation fixes
|Prevent allocations in LU decomposition
|C++11 compilation issues (suffices for literals)
|Improve filter for hidden files in CMake
|Add SuperLU 5 support
|Allow CMake project to be included in another project
|Marcus D. Hanwell
|CMake improvements. Marcus is a developer at Kitware!
|Arpack support module
|Many improvements to MatrixFunctions and KroneckerProduct modules
|Extended matrix functions, STL compatibility, Splines, CMake improvements, and more ...
|Quaternions, shifts for Cholmod, bug fixes, lots of user support on forums and IRC
|Multi-precision support with MPFR C++, bug fixes for non-standard scalar types
|Improvements to tutorial, LDLT update and downdate
|Back-end to Intel Math Kernel Library (MKL)
|Square root for complex numbers, fix compile errors and mistake in docs
|Bram de Jong
|Improvement to benchmark suite
|Implement *= /= * / operations for VectorwiseOp
|Avoid memory leak when constructor of user-defined type throws exception
|Improvements to Fortran and FFTW in CMake
|Add RealQZ class
|Properly cast constants when using non-standard scalars
|Fix compilation errors in OpenGL demos
|Allow solving transposed problem with SuperLU
|Rasmus Munk Larsen
|Fix bugs in Spline constructor
|MSVC compilation support
|Add SparseView class
|David J. Luitz
|Bug fix for sparse * dense matrix product
|Bug fix in polynomial solver test
|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
|Component-wise arc tangent function
|Reverse, redux improvements, the count() method, some dox
|Vincenzo Di Massa
|Early code review and input in technical/design discussions
|MSVC compatibility fixes
|LDLT decomposition and other improvements, help with MPL relicensing
|CMake improvements. Laurent is (with Alexander) one of the CMake gurus at KDE!
|Compilation fixes for win32
|CMake improvements. Alexander is (with Laurent) one of the CMake gurus at KDE!
|Componentwise tangent functions
|Matrix functions, large improvements in the Eigenvalues module and in the docs, and more ...
|Many improvements to Sparse module: SparseLU, SparseQR, ILUT, PaStiXSupport, …
|Compatibility with termios.h
|Jos van den Oever
|Early patches, including the initial loop meta-unroller
|Optimizations for NEON
|Visual C compilation fix
|Add conservativeResize() for sparse matrices
|Copy-editing of tutorial
|MINRES iterative solver
|Fix bug in SelfAdjointEigenSolver
|Introduce middleRows() / middleCols(), bug fix for nonstandard numeric types
|MSVC compatibility fix
|Kenneth Frank Riddile
|Lots of Windows/MSVC compatibility fixes, handling of alignment issues
|Bug fix in selection of MKL Householder QR
|Prevent allocations in matrix decompositions
|Support for SuperLU's ILU factorization
|Bug fix in sparse matrix product with row-major matrices
|Radu Bogdan Rusu
|Fix compilation warning
|C. Antonio Sanchez
|Typo in documentation
|gdb pretty printers
|Fix in assembly when identifying CPU, Compilation fix connected to min/max
|New typedefs like AlignedBox3f
|Test for unaligned quaternions, Benchmark for Geometry module
|The Tensor module
|Bug fix for empty matrices
|Fix gdb pretty printer for variable-size matrices
|Functions to get intersection between two ParametrizedLines
|Help with tough C++ questions
|Faster matrix multiplication, Tensor module, CUDA
|Add intersects() method to AlignedBox
|Fix oversight in installation scripts
|Bug fix in MatrixBase::makeHouseholder()
|Fix for FindEigen3.cmake
|QCC compilation fixes
|Bugfix in QTransform and QMatrix support
|Adolfo Rodriguez Tsourouksdissian
|Version of JacobiSVD that pre-allocates its resources
|General project maintenance, Continuous Integration, various code contributions
|James Richard Tyrer
|Pkg-config support, improved GDB pretty-printer
|Henry de Valence
|Typo in documentation
|Michiel Van Dyck
|Multi-threading documentation bug fix
|CMake fixes, allow LevenbergMarquardt to work with non-standard types
|Fixed a serious warning
|Bug fixes, work on inverse-with-check, the Polynomial module
|Making a start with a divide-and-conquer SVD implementation
|Bugfixes for CUDA support
Eigen is also using code that we copied from other sources. They are acknowledged in our sources and in the Mercurial history, but let's also mention them here:
|SSE code for 4x4 matrix inversion taken from here.
|AMD reordering simplicial sparse Cholesky factorization adapted from SuiteSparse
|SSE implementation of exp,log,cos,sin math functions from GMM++
|IncompleteLUT preconditioner coming from ITSOL
|Algorithms for non linear optimization.
Special thanks to Tuxfamily for the wonderful quality of their services, 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.