EIGEN is a C++ template library for linear algebra, including natural and usable definitions of vectors and matrices, norms, factorizations, solution of linear systems, evaluation of eigenvalues, and many standard linear algebra algorithms for dense and sparse matrices.

The project web site is http://eigen.tuxfamily.org/index.php?title=Main_Page .

The online reference for EIGEN may be found at http://eigen.tuxfamily.org/dox/ .


Version 3.2.10 of EIGEN is available on the ARC cluster Cascades. Version 3.2.5 is available on BlueRidge, DragonsTooth, HokieSpeed, and NewRiver. To check the latest information on available versions on any ARC cluster, type "module spider eigen".


EIGEN can be loaded directly, that is, it only requires a single module command, which might read as follows:

      module load eigen/3.2.5


Here is an portion of a C++ code which computes a matrix vector product:

  MatrixXd m = MatrixXd::Random ( 3, 3 );
  VectorXd v(3);
  v << 1.0, 2.0, 3.0;
  VectorXd mv = m * v;
  cout << mv << "\n";

The full text of this example and several more are provided below.Here is an example batch file that could be used to compile and run a program that includes EIGEN. We include a module command that loads the particular compiler family we prefer.

#! /bin/bash
#PBS -l walltime=00:05:00
#PBS -l nodes=1:ppn=1
#PBS -W group_list=newriver
#PBS -q open_q
#PBS -j oe


module purge
module load gcc/5.2.0
module load eigen/3.2.5

g++ -c -I$EIGEN_INC eigen_test.cpp
g++ -o eigen_test eigen_test.o

A complete set of files to carry out a similar example calculation are available in a tar file