12 #include <Eigen/CXX11/Tensor> 21 TensorMap<Tensor<const int, 3> > constant(random.
data(), 2, 3, 7);
25 for (
int i = 0; i < 2; ++i) {
26 for (
int j = 0; j < 3; ++j) {
27 for (
int k = 0; k < 7; ++k) {
28 VERIFY_IS_EQUAL((result(i,j,k)),
random(i,j,k));
40 TensorMap<Tensor<const int, 3> > constant1(random.
data(), 2, 3, 7);
41 TensorMap<const Tensor<int, 3> > constant2(random.
data(), 2, 3, 7);
42 const TensorMap<Tensor<int, 3> > constant3(random.
data(), 2, 3, 7);
48 for (
int i = 0; i < 2; ++i) {
49 for (
int j = 0; j < 3; ++j) {
50 VERIFY_IS_EQUAL((result1(i,j)),
random(i,j,0));
51 VERIFY_IS_EQUAL((result2(i,j)),
random(i,j,0));
52 VERIFY_IS_EQUAL((result3(i,j)),
random(i,j,0));
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorChippingOp< DimId, const Derived > chip(const Index offset) const
static void test_assign_of_const_tensor()
static void test_simple_assign()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
const mpreal random(unsigned int seed=0)
void test_cxx11_tensor_const()