# Difference between revisions of "FAQ"

(→How does Eigen compare to BLAS/LAPACK?) |
|||

Line 1: | Line 1: | ||

+ | [[Image:owl_faq.jpg|right]] | ||

+ | |||

==Why another matrix library? What is the need for Eigen?== | ==Why another matrix library? What is the need for Eigen?== | ||

## Revision as of 14:19, 18 December 2008

## Why another matrix library? What is the need for Eigen?

First of all, see the Overview. No other library provides all of the features and benefits listed there.

Some other libraries do satisfy very well certain specialized needs, but none is as versatile as Eigen, has such a nice API, etc.

The fact that so many projects are quickly adopting Eigen 2, shows that it fills a gap.

The state of existing matrix libraries before Eigen is that:

- some are Free Software
- some are fast
- some have a decent API
- some handle fixed-size matrices, some handle dynamic-size dense, some handle sparse
- some also provide linear algebra and/or geometry algorithms

However none of the existing libraries satisfies all, or nearly all, these criteria.

The Eigen project started when some hackers from the large KDE meta-project realized the need for a single unified matrix library.

## How does Eigen compare to BLAS/LAPACK?

Eigen covers many things that BLAS/LAPACK don't:

- Eigen handles fixed-size matrices and vectors, which are very widely used.
- Eigen provides a lot of convenience features (see Geometry module, Array module, etc), which are also very widely used.

Eigen compares very well performance-wise against the existing BLAS implementations. See the benchmark. It shows that:

- Eigen is much faster than every Free BLAS, such as ATLAS or Boost::uBlas.
- Eigen is overall of comparable speed (faster or slower depending on what you do) to the best BLAS, namely Intel MKL and GOTO, both of which are non-Free.

Eigen has an incomparably better API than BLAS and LAPACK.

- See the API Showcase.
- For operations involving complex expressions, Eigen is inherently faster than any BLAS implementation because it can handle and optimize a whole operation globally -- while BLAS forces the programmer to split complex operations into small steps that match the BLAS fixed-function API, which incurs inefficiency due to introduction of temporaries.

Miscellaneous advantages:

- Eigen is only a compile-time dependency for your project. No need to redistribute, or ask your user to install, any library.
- Eigen is multi-platform, and is actually being used on a number of different operating systems, hardware platforms, and compilers.
- Eigen, compared to certain other C++ template libraries, is relatively easy on the compiler. Compilation times stay reasonable -- we are very careful about that.
- Eigen is small, so it is feasible to include a copy of it in your own source tree, if you want to.