Storing 3D data with Eigen library

早过忘川 提交于 2021-02-10 18:01:42

问题


How can I store a 3D data using Eigen C++ library? Vector is for 1D data, Matrix is for 2D data but what is for a 3D data? Or is it possible to create a vector of matrix?


回答1:


You could use the Tensor module. It is not yet stable though.

Eigen::Tensor<double, 3> epsilon(4,5,6);  // 3 dimensions (4x5x6)
epsilon.setZero();
epsilon(0,1,2) = 1;
epsilon(0,2,1) = -1;

http://eigen.tuxfamily.org/index.php?title=Tensor_support



来源:https://stackoverflow.com/questions/47704691/storing-3d-data-with-eigen-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!