diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-02-11 15:32:53 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-02-11 15:32:53 +0100 |
commit | 4b22048cead4b3b34f2a784bb77f215350496103 (patch) | |
tree | 82bf61e4329d2bdf0580bca0cc7d783a0400f6f1 /test | |
parent | 83d6a529c3a917763b35aafe8cd5b3b7478fcee6 (diff) |
Fallback Reshaped to MapBase when possible (same storage order and linear access to the nested expression)
Diffstat (limited to 'test')
-rw-r--r-- | test/reshape.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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() |