12 #include <Eigen/CXX11/Tensor> 16 template<
int DataLayout>
28 VERIFY_RAISES_ASSERT(concatenation = left.
concatenate(right, 1));
29 VERIFY_RAISES_ASSERT(concatenation = left.
concatenate(right, 2));
32 VERIFY_RAISES_ASSERT(concatenation = left.
concatenate(right, 3));
33 VERIFY_RAISES_ASSERT(concatenation = left.
concatenate(right, -1));
36 template<
int DataLayout>
42 #ifdef CXX11_TENSOR_CONCATENATION_STATIC_DIMENSION_FAILURE 51 .concatenate(right, 0);
56 template<
int DataLayout>
65 VERIFY_IS_EQUAL(concatenation.
dimension(0), 4);
66 VERIFY_IS_EQUAL(concatenation.
dimension(1), 3);
67 VERIFY_IS_EQUAL(concatenation.
dimension(2), 1);
68 for (
int j = 0; j < 3; ++j) {
69 for (
int i = 0; i < 2; ++i) {
70 VERIFY_IS_EQUAL(concatenation(i, j, 0), left(i, j, 0));
72 for (
int i = 2; i < 4; ++i) {
73 VERIFY_IS_EQUAL(concatenation(i, j, 0), right(i - 2, j, 0));
78 VERIFY_IS_EQUAL(concatenation.
dimension(0), 2);
79 VERIFY_IS_EQUAL(concatenation.
dimension(1), 6);
80 VERIFY_IS_EQUAL(concatenation.
dimension(2), 1);
81 for (
int i = 0; i < 2; ++i) {
82 for (
int j = 0; j < 3; ++j) {
83 VERIFY_IS_EQUAL(concatenation(i, j, 0), left(i, j, 0));
85 for (
int j = 3; j < 6; ++j) {
86 VERIFY_IS_EQUAL(concatenation(i, j, 0), right(i, j - 3, 0));
91 VERIFY_IS_EQUAL(concatenation.
dimension(0), 2);
92 VERIFY_IS_EQUAL(concatenation.
dimension(1), 3);
93 VERIFY_IS_EQUAL(concatenation.
dimension(2), 2);
94 for (
int i = 0; i < 2; ++i) {
95 for (
int j = 0; j < 3; ++j) {
96 VERIFY_IS_EQUAL(concatenation(i, j, 0), left(i, j, 0));
97 VERIFY_IS_EQUAL(concatenation(i, j, 1), right(i, j, 0));
117 for (
int i = 0; i < 2; ++i) {
118 for (
int j = 0; j < 3; ++j) {
119 VERIFY_IS_EQUAL(t1(i, j), result(i, j));
120 VERIFY_IS_EQUAL(t2(i, j), result(i+2, j));
128 CALL_SUBTEST(test_dimension_failures<ColMajor>());
129 CALL_SUBTEST(test_dimension_failures<RowMajor>());
130 CALL_SUBTEST(test_static_dimension_failure<ColMajor>());
131 CALL_SUBTEST(test_static_dimension_failure<RowMajor>());
132 CALL_SUBTEST(test_simple_concatenation<ColMajor>());
133 CALL_SUBTEST(test_simple_concatenation<RowMajor>());
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor< Scalar_, NumIndices_, Options_, IndexType_ > & setRandom()
static void test_simple_concatenation()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorReshapingOp< const NewDimensions, const Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > reshape(const NewDimensions &newDimensions) const
static void test_concatenation_as_lvalue()
void test_cxx11_tensor_concatenation()
static void test_static_dimension_failure()
static void test_dimension_failures()
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