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

182 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 best solutions below

5
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