12 #include <Eigen/CXX11/Tensor> 24 for (
int i = 0; i < 6; ++i) {
25 std::ostringstream s1;
28 std::ostringstream s2;
44 for (
int i = 0; i < 2; ++i) {
45 for (
int j = 0; j < 3; ++j) {
46 VERIFY_IS_EQUAL(rslt1(i,j), data1[i+2*j]);
47 VERIFY_IS_EQUAL(rslt2(i,j), data2[i+2*j]);
48 VERIFY_IS_EQUAL(rslt3(i,j), data1[i+2*j]);
49 VERIFY_IS_EQUAL(rslt4(i,j), data2[i+2*j]);
50 VERIFY_IS_EQUAL(rslt5(i,j), data1[i+2*j]);
51 VERIFY_IS_EQUAL(rslt6(i,j), data2[i+2*j]);
62 for (
int i = 0; i < 2; ++i) {
63 for (
int j = 0; j < 3; ++j) {
64 std::ostringstream s1;
65 s1 <<
"abc" << i + j*2;
67 std::ostringstream s2;
68 s2 <<
"def" << i*5 + j*32;
77 for (
int i = 0; i < 2; ++i) {
78 for (
int j = 0; j < 3; ++j) {
79 VERIFY_IS_EQUAL(result(i, j), t1(i, j));
80 VERIFY_IS_EQUAL(result(i, j+3), t2(i, j));
89 for (
int i = 0; i < 2; ++i) {
90 for (
int j = 0; j < 3; ++j) {
91 std::ostringstream s1;
92 s1 <<
"abc" << i + j*2;
93 data(i, j) = s1.str();
104 for (
int i = 0; i < 2; ++i) {
105 for (
int j = 0; j < 3; ++j) {
106 VERIFY_IS_EQUAL(data(i, j), t1(i, j));
107 VERIFY_IS_EQUAL(data(i, j+3), t2(i, j));
117 for (
int i = 0; i < 3; ++i) {
119 std::ostringstream s1;
125 for (
int i = 0; i < 3; ++i) {
126 std::ostringstream concat;
127 concat <<
"abc" << i;
128 std::string expected = concat.str();
129 VERIFY_IS_EQUAL(
sum(i), expected);
138 for (
int i = 0; i < 2*3; ++i) {
139 VERIFY_IS_EQUAL(a(i), std::string(
"foo"));
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorSlicingOp< const StartIndices, const Sizes, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > slice(const StartIndices &startIndices, const Sizes &sizes) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
static void test_concat()
static void test_additions()
static void test_slices()
void test_cxx11_tensor_of_strings()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setConstant(const Scalar &val)
A tensor expression mapping an existing array of data.
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
static void test_initialization()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorConcatenationOp< const Axis, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ >, const OtherDerived > concatenate(const OtherDerived &other, const Axis &axis) const
static void test_assign()