I need a 3D matrix/array structure on my code, and right now I\'m relying on Eigen for both my matrices and vectors.
Right now I am creating a 3D structure using
An alternative is to create a very large chunk of memory ones, and maps Eigen matrices from it:
double* data = new double(60*60 * 60*60*60);
Map Mijk(data+60*(60*(60*k)+j)+i), 60, 60);
At this stage you can use Mijk like a MatrixXd object. However, since this not a MatrixXd type, if you want to pass it to a function, your function must either:
foo(Map mat)
template void foo(const MatrixBase& mat)
Ref
object which can handle both Map<>
and Matrix<>
objects without being a template function and without copies. (doc)