diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-02-17 09:54:40 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-02-17 09:54:40 -0800 |
commit | 00f048d44f7dd40a0a4e80e40787a930db0f18f0 (patch) | |
tree | 69c121d695e0b5f261648528bb24fc8e140b0f18 /unsupported/test/cxx11_tensor_concatenation.cpp | |
parent | 159fb181c222afb3634006f0a620dd5b5419e924 (diff) |
Added support for tensor concatenation as lvalue
Diffstat (limited to 'unsupported/test/cxx11_tensor_concatenation.cpp')
-rw-r--r-- | unsupported/test/cxx11_tensor_concatenation.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/unsupported/test/cxx11_tensor_concatenation.cpp b/unsupported/test/cxx11_tensor_concatenation.cpp index 9fdf33c16..cc9dfb769 100644 --- a/unsupported/test/cxx11_tensor_concatenation.cpp +++ b/unsupported/test/cxx11_tensor_concatenation.cpp @@ -103,6 +103,25 @@ static void test_simple_concatenation() // TODO(phli): Add test once we have a real vectorized implementation. // static void test_vectorized_concatenation() {} +static void test_concatenation_as_lvalue() +{ + Tensor<int, 2> t1(2, 3); + Tensor<int, 2> t2(2, 3); + t1.setRandom(); + t2.setRandom(); + + Tensor<int, 2> result(4, 3); + result.setRandom(); + t1.concatenate(t2, 0) = result; + + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 3; ++j) { + VERIFY_IS_EQUAL(t1(i, j), result(i, j)); + VERIFY_IS_EQUAL(t2(i, j), result(i+2, j)); + } + } +} + void test_cxx11_tensor_concatenation() { @@ -113,4 +132,6 @@ void test_cxx11_tensor_concatenation() CALL_SUBTEST(test_simple_concatenation<ColMajor>()); CALL_SUBTEST(test_simple_concatenation<RowMajor>()); // CALL_SUBTEST(test_vectorized_concatenation()); + CALL_SUBTEST(test_concatenation_as_lvalue()); + } |