Eigen转array
MatrixXd T(4,4);
T << 1, 2.5, 3, 4,
2.5, 6, 7, 8,
9, 10.7, 11, 12,
13, 14, 15, 16;
cout << T << endl;
array<double, 16> raw;
Eigen::Map<Eigen::MatrixXd>(raw.data(), T.rows(), T.cols())=T.transpose();
for (auto x : raw) cout << x<<" ";
array转Eigen
array<double, 16> a = { {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} };
MatrixXd T(4, 4);
T = Map<MatrixXd>(a.data(), 4, 4).transpose();
cout << T << endl;