From 4b22048cead4b3b34f2a784bb77f215350496103 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 11 Feb 2017 15:32:53 +0100 Subject: Fallback Reshaped to MapBase when possible (same storage order and linear access to the nested expression) --- test/reshape.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/reshape.cpp') diff --git a/test/reshape.cpp b/test/reshape.cpp index 37b6a007f..9b2825d86 100644 --- a/test/reshape.cpp +++ b/test/reshape.cpp @@ -48,6 +48,18 @@ void reshape_all_size(MatType m) ), MapMat(m.data(), 4, 4) ); + + VERIFY_IS_EQUAL(m.reshaped( 1, 16).data(), m.data()); + VERIFY_IS_EQUAL(m.reshaped( 1, 16).innerStride(), 1); + + VERIFY_IS_EQUAL(m.reshaped( 2, 8).data(), m.data()); + VERIFY_IS_EQUAL(m.reshaped( 2, 8).innerStride(), 1); + VERIFY_IS_EQUAL(m.reshaped( 2, 8).outerStride(), 2); + + m.reshaped(2,8,ColOrder); + + MatrixXi m28r = m.reshaped(2,8,RowOrder); + std::cout << m28r << "\n"; } void test_reshape() -- cgit v1.2.3