Eigen库介绍
Eigen is an open-source linear algebra library implemented in C++. It’s fast and well-suited for a
wide range of tasks, from heavy numerical computation, to simple vector arithmetic. The goal of
this tutorial is to introduce the features of Eigen required for implementing graphics applications,
to readers possessing basic knowledge of C++, linear algebra, and computer graphics.
Eigen库是适用C++的开源线性代数库,进行复杂的数值计算简化向量计算。教程的目的在于实现Eigen库的简单应用,需要我们的读者有C++基础,线性代数以及计算机图形学。
教程目标
After reading this tutorial, the reader should be able to
- Install Eigen on computers running Linux, Mac OS, and Windows.
- Create and initialize matrices and vectors of any size with Eigen in C++.
- Use Eigen for basic algebraic operations on matrices and vectors. The reader should be
able to perform addition, multiplication, scalar multiplication, and matrix inversion and
transposition.- Use Eigen’s built-in functions to create 4x4 transformation matrices.
在学习完教程后,读者可以完成
- 在不同环境下Eigen库的安装
- 在C++中创建或初始化任意大小的矩阵和矢量
- 使用Eigen库进行最基本的线性代数操作,加减乘除,标量乘,矩阵的逆和转置
- 使用Eigen库的内置函数创建转置矩阵
安装Eigen库
$ cd ~
$ git clone https :// github .com/ eigenteam /eigen -git - mirror
验证是否安装成功
std::cout << " Eigen version : " << EIGEN_MAJOR_VERSION << "."<< EIGEN_MINOR_VERSION << std::endl ;
会在我们的终端中显示出来版本。
Eigen version : 4.99
遇到没有找到文件的情况要Fatal error :Eigen/core没有那个文件或目录