1
votes

I'm using eigen tensor library and it seems to me that shuffle() method wants as input an object Eigen::array<type,int>.

In my implementation I have a std::list of int I need to pass to shuffle (of course I know the second int param (the rank) only at runtime!)

1
I doubt they would break their naming convention and create a type with a lowercase name, most likely they are referring to Eigen::Array<>. - Mansoor
You can see here, in section Reduction Dimensions, an example where they create an object with std::array eigen.tuxfamily.org/dox/unsupported/eigen_tensors.html - Virginie
I agree with you that is strange they defined their own array, but I tested that example on my laptop and it works writing Eigen::array ... - Virginie
Sorry, on my previous comment I wrote std::array instead of Eigen::array - Virginie

1 Answers

3
votes

Not long ago Eigen's Tensor module was C++03 compatible. That implies that std::array is not available. For that reason the Tensor module defined its own Eigen::array class that is in fact a typedef for std::array if C++11 is available.

The file unsupported/Eigen/CXX11/src/util/EmulateArray.h contains something that boils down to (pseudo-code)

#if C++11 not available
  // Define a custom std::array like Eigen::array class
#else
  template <typename T, std::size_t N> using array = std::array<T, N>;
#endif

The Tensor module has dropped C++03 compatibility and parts of this code could probably be removed.