Registered Member
|
Is there a easy way to extend the matrix to 3D array? I need to compute something like A+B, 2*A, where A and B are 3 dimensional array/volume data. I guess I can define some tensor type for the element of a matrix, so each element of a matrix is a vector itself. But I did not find any information about that. The main page said it's easy to extend to 'user-defined' type for matrix. I'll appreciate if anyone can give me a clue.
Wei Liu University of Utah |
Registered Member
|
Indeed, Eigen doesn't have any native support for n-dimensional arrays with n>2 or tensors; and indeed, one way to get basic functionality for 3d arrays is to use a vector type as the scalar type, i.e. something like Matrix<VectorXd, Dynamic, Dynamic>.
Indeed, this doesn't work out of the box and you have to add yourself the support for the vector type as a scalar type. To do that, you need to edit the files MathFunctions.h and NumTraits.h in Eigen/src/Core. See this: http://eigen.tuxfamily.org/dox/Customiz ... ScalarType
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
Thanks, I'll look at that, though the customization is difficult to me considering my current knowledge of c++.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]