12 #include <Eigen/CXX11/Tensor> 20 TensorMap<Tensor<const float, 2>> mat1(data1, 2, 3);
22 const TensorMap<Tensor<float, 2>> mat2(data2, 2, 3);
24 for (
int i = 0; i < 6; ++i) {
40 for (
int i = 0; i < 2; ++i) {
41 for (
int j = 0; j < 3; ++j) {
42 VERIFY_IS_APPROX(rslt1(i,j), static_cast<float>(i + 2*j));
43 VERIFY_IS_APPROX(rslt2(i,j), static_cast<float>(-i - 2*j));
44 VERIFY_IS_APPROX(rslt3(i,j), static_cast<float>(i + 2*j));
45 VERIFY_IS_APPROX(rslt4(i,j), static_cast<float>(-i - 2*j));
46 VERIFY_IS_APPROX(rslt5(i,j), static_cast<float>(i + 2*j));
47 VERIFY_IS_APPROX(rslt6(i,j), static_cast<float>(-i - 2*j));
56 TensorMap<Tensor<const float, 2>> mat1(data1, 2, 3);
58 TensorMap<Tensor<float, 2>> mat2(data2, 2, 3);
60 for (
int i = 0; i < 6; ++i) {
70 for (
int i = 0; i < 2; ++i) {
71 for (
int j = 0; j < 3; ++j) {
72 VERIFY_IS_APPROX(sum1(i,j), 0.0
f);
73 VERIFY_IS_APPROX(sum2(i,j), 0.0
f);
82 TensorMap<Tensor<const float, 2>> mat1(data1, 2, 3);
84 TensorMap<Tensor<float, 2>> mat2(data2, 2, 3);
86 for (
int i = 0; i < 6; ++i) {
92 for (
int i = 0; i < 2; ++i) {
93 for (
int j = 0; j < 3; ++j) {
94 VERIFY_IS_APPROX(mat2(i,j), 0.0
f);
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
void test_cxx11_tensor_of_const_values()
static void test_plus_equal()
static void test_assign()