Registered Member
|
Hello,
I have a need for a 3D datatype. In a new project I would *very much* like to use Eigen for all of the complex-valued math operations. Unrolling of small-sized operations, vectorized operations, and MKL-support combine with the highlevel API to make it seem compelling to me. I need to convince others. In particular, I want to be able to make a data storage object with named indices, let's call them East, North, and Up. And to then have the code doing math operations be valid if the underlying storage order is changed. I envision a "slice at" method to return valid Eigen lvalues and rvalues as 2D views of the data. So, a processing chain somewhat like:
And then also have similar access to .array() operations like .abs2() and .max(). There are .solve() operations to apply to slices as well. In the above, changing tmp1's storage order would change which operations are cache-friendly and (easily-) vectorizable, but not correctness of the result once the slicing methods are correct. I can see two ways to do this, either with tensors, or without. I did see in forum history someone posting that they had constructed a 3D class with associated accessors, but that tensors were the better solution. 1) No tensors. Extend a 2D matrix, so all the .array() scalar operations should "just work". Accessors need to be written for all the Map/Stride combinations needed. 2) Use tensors. Simple translations between named indices and tensor indices. Drawbacks: Tensors officially "unsupported", and, tensor documentation is such that I can't yet figure out the mapping between what I want and the existing methods! The great documentation of other Eigen features has spoiled me. Is there any guidance or pointers that one can give me? I thought I read (in the wiki?) that some aspects of tensors were well tested and working. If I can go look at the correct methods and testcases, I think that would go a long way towards helping me get started in understanding what tensor features I would use. Alternately, if it is the case that tensors are not of interest to anyone active, and that things may work but it is unclear what, even to experts, I would probably go the other route! So, with all that framework, is there a clear path of 1 or 2, where the other would seem wrong or shortsighted to Eigen experts? Is there the particular area of test cases and methods that I should be looking at? Thank you, Eric |
Moderator
|
I'm no expert of the Tensor module, but I can at confirm that it is actively developed and maintained by Google which use it as the foundation for their famous TensorFlow library. Then, I guess that you can simply define East, North, ... to integers 0, 1, ... and shuffle the values to change the memory layout. The documentation is not yet integrated, but it can be read there:
https://bitbucket.org/eigen/eigen/src/b ... at=default The slice and chip methods should be of particular interest to you. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]