eigen

Version:

3.4.0

Category:

math

Cluster:

Vali

Author / Distributor

https://eigen.tuxfamily.org

Description

Eigen is a high-level C++ library for linear algebra, matrix and vector operations, numerical solvers, and related algorithms. It is known for being:

  • Header-only (no linking required)

  • Highly optimized for performance

  • Easy to integrate into C++ projects

  • Extensively used in scientific and engineering applications

Documentation

Eigen is a header-only C++ template library. There are no binaries to install or run.

Include the headers in your project:

    #include <Eigen/Dense>
    #include <Eigen/Sparse>

Documentation and API reference:
  https://eigen.tuxfamily.org/dox/

Example build command:

    g++ -I$EIGEN_INC example.cpp -o example

Examples/Usage

  • Load the Eigen module:

    $ module load math/Eigen/3.4.0-GCCcore-11.3.0
    
  • Unload the Eigen module:

    $ module unload math/Eigen/3.4.0-GCCcore-11.3.0
    
  • Sample C++ usage:

    #include <Eigen/Dense>
    #include <iostream>
    
    int main() {
        Eigen::MatrixXd m(2, 2);
        m(0, 0) = 3;
        m(1, 0) = 2.5;
        m(0, 1) = -1;
        m(1, 1) = m(1, 0) + m(0, 1);
        std::cout << m << std::endl;
    }
    

Installation

Source code is obtained from Eigen