http://eigen.tuxfamily.org/index.php?title=Main_Page
Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
wget http://bitbucket.org/eigen/eigen/get/3.3.7.tar.bz2
tar -jxvf 3.3.7.tar.bz2
How to "install" Eigen?
In order to use Eigen, you just need to download and extract Eigen's source code (see the wiki for download instructions). In fact, the header files in the Eigen
subdirectory are the only files required to compile programs using Eigen. The header files are the same for all platforms. It is not necessary to use CMake or install anything.
A simple first program
Here is a rather simple program to get you started.
We will explain the program after telling you how to compile it.
Compiling and running your first program
There is no library to link to. The only thing that you need to keep in mind when compiling the above program is that the compiler must be able to find the Eigen header files. The directory in which you placed Eigen's source code must be in the include path. With GCC you use the -I option to achieve this, so you can compile the program with a command like this:
On Linux or Mac OS X, another option is to symlink or copy the Eigen folder into /usr/local/include/. This way, you can compile the program with:
When you run the program, it produces the following output: