Eigen3.3.7庫安裝、配置及測試

安裝及配置

轉載:(轉載)無法打開 Eigen/Dense 等文件

關於VS2015無法打開Eigen/Dense的錯誤 

Solution

1、下載Eigen,並解壓。

1)CSDNhttp://download.csdn.net/download/airaybaiju/10237226

2)官網:http://eigen.tuxfamily.org/index.php?title=Main_Page#Download

 

2、解壓之後的文件夾,重命名爲 eigen3 

3、在項目屬性-> 配置屬性-> vc++目錄-> 包含目錄,

比如我的eigen3F:\Eigen install pack\eigen3,包含目錄就是:F:\Eigen install pack\eigen3; 

測試

  • 我的工程文件位置:E:\VStestlibrary\test_eigen
  • 我的庫安裝路徑:F:\eigen3(目前版本3.3.7)
  • 我的屬性表位置:E:\prop(名字:eigen3.props,這個庫好像不分debug,release,64,32位,超級簡單!)
    測試程序:
#include <iostream>
#include <Eigen\Dense>
using namespace std;
using namespace Eigen;

void main()
{
	Matrix2d a;
	a << 1, 2,
		3, 4;
	MatrixXd b(2, 2);
	b << 2, 3,
		1, 4;
	cout << "a + b =\n" << a + b << endl;
	cout << "a - b =\n" << a - b << endl;
	cout << "Doing a += b;" << endl;
	a += b;
	cout << "Now a =\n" << a << endl;
	cout << "a^T=  " << a.transpose() << endl;
	cout << "a*b= " << a*b << endl;
	Vector3d v(1, 2, 3);
	Vector3d w(1, 0, 0);
	cout << "-v + w - v =\n" << -v + w - v << endl;
	cout << v << endl;
	cout << v.transpose() << endl;
	system("pause");
}

結果:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章