12 #include <Eigen/CXX11/Tensor>
21 vec1(0) = 4; vec2(0) = 0;
22 vec1(1) = 8; vec2(1) = 1;
23 vec1(2) = 15; vec2(2) = 2;
24 vec1(3) = 16; vec2(3) = 3;
25 vec1(4) = 23; vec2(4) = 4;
26 vec1(5) = 42; vec2(5) = 5;
30 memset(col_major, 0, 6*
sizeof(
int));
31 memset(row_major, 0, 6*
sizeof(
int));
93 memset(col_major, 0, 6*
sizeof(
int));
94 memset(row_major, 0, 6*
sizeof(
int));
141 for (
int i = 0;
i < 2; ++
i) {
142 for (
int j = 0;
j < 3; ++
j) {
143 for (
int k = 0; k < 7; ++k) {
151 int col_major[2*3*7];
152 int row_major[2*3*7];
153 memset(col_major, 0, 2*3*7*
sizeof(
int));
154 memset(row_major, 0, 2*3*7*
sizeof(
int));
162 for (
int i = 0;
i < 2; ++
i) {
163 for (
int j = 0;
j < 3; ++
j) {
164 for (
int k = 0; k < 7; ++k) {
178 for (
int i = 0;
i < 2; ++
i) {
179 for (
int j = 0;
j < 3; ++
j) {
180 for (
int k = 0; k < 7; ++k) {
195 int* orig_data = orig_tensor.
data();
196 int* dest_data = dest_tensor.
data();
197 dest_tensor = orig_tensor;
200 for (
int i = 0;
i < 5; ++
i) {
208 orig_data = orig_array.
data();
209 dest_data = dest_array.
data();
210 dest_array = orig_array;
213 for (
int i = 0;
i < 5; ++
i) {
217 int orig[5] = {1, 2, 3, 4, 5};
218 int dest[5] = {6, 7, 8, 9, 10};
221 orig_data = orig_map.
data();
222 dest_data = dest_map.
data();
226 for (
int i = 0;
i < 5; ++
i) {
241 tensor1 = tensor2 = tensor3 = tensor4 = new_tensor;
264 tensor += offset_tensor;
265 for (
int i = 0;
i < 10; ++
i) {
269 tensor = start_tensor;
270 tensor -= offset_tensor;
271 for (
int i = 0;
i < 10; ++
i) {
275 tensor = start_tensor;
276 tensor *= offset_tensor;
277 for (
int i = 0;
i < 10; ++
i) {
281 tensor = start_tensor;
282 tensor /= offset_tensor;
283 for (
int i = 0;
i < 10; ++
i) {
289 #if EIGEN_HAS_VARIADIC_TEMPLATES
291 a.setValues({0, 1, 2});
297 a.setValues({10, 20});
304 a2 =
a.setValues({100, 200, 300});
313 b.setValues({{0, 1, 2}, {3, 4, 5}});
322 b.setValues({{10, 20}, {30}});
331 c.setValues({{{0, 1, 2, 3}, {4, 5, 6, 7}},
332 {{10, 11, 12, 13}, {14, 15, 16, 17}},
333 {{20, 21, 22, 23}, {24, 25, 26, 27}}});
358 #endif // EIGEN_HAS_VARIADIC_TEMPLATES