Create a N-D matrix in Eigen (C++ Library)

183 views Asked by At

How could we create a T(n, m, k) matrix like MATLAB using Eigen in c++? It creates k matrices which are n*m.

1

There are 1 answers

5
Thiago Duarte On

Include the tensor module:

#include <unsupported/Eigen/CXX11/Tensor>

Declare it like this:

Eigen::Tensor<double, 3> epsilon(3,3,3);

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