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
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
static void test_same_type()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
MatrixXd mat1(size, size)
#define VERIFY_IS_EQUAL(a, b)
A tensor expression mapping an existing array of data.
void test_cxx11_tensor_assign()
static SO4::VectorN2 vec4(const Matrix4 &Q)
static void test_std_initializers_tensor()
The fixed sized version of the tensor class.
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
#define CALL_SUBTEST(FUNC)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PointerType data()
static Vector9 vec3(const Matrix3 &R)
static void test_auto_resize()
static void test_compound_assign()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setZero()