c Eigen庫的使用(附demo)

2021-09-13 16:25:45 字數 407 閱讀 2299

eigen是可以用來進行線性代數,矩陣,向量操作等運算的c++庫,它裡面包含了很多的演算法。

矩陣的定義:eigen中關於矩陣類的模板函式中,共有六個模板引數,常用的只有前三個引數,分別為矩陣元素的型別,行數和列數

ps:矩陣定義時可以使用dynatic來表示矩陣的行列數未知。

例程:

//兩個矩陣相乘

#include #include templateviod matrix_mul_matrix(t &p1, int irow1, int icol1, t &p2, int irow2, int icol2, t &p3)

C Eigen 庫的使用

include ros ros.h include include using namespace std using namespace eigen double m pi 3.14159265358979323 double x,y,z,w void test01 基本型別 定義 void te...

C Eigen庫的配置和基本使用

1.配置 2.配置 資料夾名字較長,解壓後可重新命名,如我命名為eigen3,把d program eigen3新增到visual studio專案屬性裡的庫目錄即可。在程式頭部包含 include 即可使用eigen的各項功能了。2.基本使用 testeigen3.cpp 定義控制台應用程式的入口...

C Eigen庫的學習 6

在eigen中,定義零陣的函式是zeros 有三種定義方式,如下示例 std cout 固定大小的陣列 n array33f a1 array33f zero std cout a1 n n std cout 一維動態大小陣列 n arrayxf a2 arrayxf zero 3 std cout...