This commit is contained in:
Shuo Feng 2024-01-28 20:14:37 -05:00
commit de866d23bf
Signed by: sfeng
GPG key ID: 1E83AE6CD1C037B1
28 changed files with 46878 additions and 0 deletions

42
external/test_eigen.cpp vendored Normal file
View file

@ -0,0 +1,42 @@
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Dense>
#include <sstream>
using namespace std;
int print_eigen(Eigen::Matrix4d m)
{
// Eigen Matrices do have rule to print them with std::cout
std::cout << m << std::endl;
return 0;
}
int test_eigen()
{
Eigen::Matrix4d test; //4 by 4 double precision matrix initialization
// Let's make it a symmetric matrix
for(int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
test(i,j) = (i+1)*(1+j);
}
// Print
print_eigen(test);
return 0;
}