3 #include <Eigen/CXX11/Tensor> 19 #define TEST_TENSOR_EQUAL(e1, e2) \ 20 b = ((e1) == (e2)).all(); \ 23 #define TEST_OP(op) TEST_TENSOR_EQUAL(t op 0, t op t.constant(0)) 32 #undef TEST_TENSOR_EQUAL 42 const float alpha = 0.43f;
43 const float beta = 0.21f;
44 const float gamma = 0.14f;
46 Tensor<float, 3> R = A.constant(gamma) + A * A.constant(alpha) + B * B.constant(beta);
50 for (
int i = 0; i < 6*7*5; ++i) {
51 VERIFY_IS_APPROX(R(i), S(i));
52 VERIFY_IS_APPROX(R(i), T(i));
62 const float alpha = 0.43f;
63 const float beta = 0.21f;
64 const float gamma = 0.14f;
65 const float delta = 0.32f;
68 - B.constant(beta) / B - A.constant(delta);
71 for (
int i = 0; i < 6*7*5; ++i) {
72 VERIFY_IS_APPROX(R(i), S(i));
void test_cxx11_tensor_sugar()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
static void test_scalar_sugar_add_mul()
static void test_comparison_sugar()
static void test_scalar_sugar_sub_div()
const mpreal gamma(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC const Scalar & b