12 #include <Eigen/CXX11/Tensor> 17 template <
int DataLayout>
29 no_shuffle = tensor.
shuffle(shuffles);
36 for (
int i = 0;
i < 2; ++
i) {
37 for (
int j = 0;
j < 3; ++
j) {
38 for (
int k = 0; k < 5; ++k) {
39 for (
int l = 0;
l < 7; ++
l) {
51 shuffle = tensor.
shuffle(shuffles);
58 for (
int i = 0;
i < 2; ++
i) {
59 for (
int j = 0;
j < 3; ++
j) {
60 for (
int k = 0; k < 5; ++k) {
61 for (
int l = 0;
l < 7; ++
l) {
70 template <
int DataLayout>
82 expected = tensor.
shuffle(shuffles);
91 for (
int i = 0;
i < 5; ++
i) {
92 result.
slice(dst_slice_start, dst_slice_dim) =
93 tensor.
slice(src_slice_start, src_slice_dim).shuffle(shuffles);
94 src_slice_start[2] += 1;
95 dst_slice_start[0] += 1;
105 for (
int k = 0; k < expected.
dimension(2); ++k) {
113 dst_slice_start[0] = 0;
115 for (
int i = 0;
i < 5; ++
i) {
116 result.
slice(dst_slice_start, dst_slice_dim) =
117 tensor.
shuffle(shuffles).slice(dst_slice_start, dst_slice_dim);
118 dst_slice_start[0] += 1;
123 for (
int k = 0; k < expected.
dimension(2); ++k) {
133 template <
int DataLayout>
144 shuffle.
shuffle(shuffles) = tensor;
151 for (
int i = 0;
i < 2; ++
i) {
152 for (
int j = 0;
j < 3; ++
j) {
153 for (
int k = 0; k < 5; ++k) {
154 for (
int l = 0;
l < 7; ++
l) {
168 for (
int i = 0;
i < 5; ++
i) {
169 for (
int j = 0;
j < 7; ++
j) {
170 for (
int k = 0; k < 3; ++k) {
171 for (
int l = 0;
l < 2; ++
l) {
180 template <
int DataLayout>
188 for (
int i = 0;
i < 4; ++
i) {
192 for (
int i = 0;
i < 4; ++
i) {
193 const ptrdiff_t index = internal::random<ptrdiff_t>(
i, 3);
194 shuffles_inverse[shuffles[index]] =
i;
199 shuffle = tensor.
shuffle(shuffles).shuffle(shuffles_inverse);
206 for (
int i = 0;
i < 2; ++
i) {
207 for (
int j = 0;
j < 3; ++
j) {
208 for (
int k = 0; k < 5; ++k) {
209 for (
int l = 0;
l < 7; ++
l) {
static void test_expr_shuffling()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorSlicingOp< const StartIndices, const Sizes, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > slice(const StartIndices &startIndices, const Sizes &sizes) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorShufflingOp< const Shuffle, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > shuffle(const Shuffle &shuffle) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
void test_cxx11_tensor_shuffling()
static const Line3 l(Rot3(), 1, 1)
#define VERIFY_IS_EQUAL(a, b)
static void test_shuffle_unshuffle()
static void test_simple_shuffling()
#define CALL_SUBTEST(FUNC)
static void test_shuffling_as_value()
void swap(mpfr::mpreal &x, mpfr::mpreal &y)