diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-02-21 13:56:26 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-02-21 13:56:26 +0100 |
commit | f8179385bd299966bded1b99328ef1bd67faacc6 (patch) | |
tree | 274544f9cbd999c5edd3b00781160d32d2cdc041 /test/reshape.cpp | |
parent | 1e3aa470fa6c22df8c89b1d0cef416dc5e07b6de (diff) |
Add missing const version of mat(all).
Diffstat (limited to 'test/reshape.cpp')
-rw-r--r-- | test/reshape.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/reshape.cpp b/test/reshape.cpp index 40d98ca1f..a38f5e098 100644 --- a/test/reshape.cpp +++ b/test/reshape.cpp @@ -10,6 +10,13 @@ #include "main.h" +template<typename T1,typename T2> +typename internal::enable_if<internal::is_same<T1,T2>::value,bool>::type +is_same_eq(const T1& a, const T2& b) +{ + return (a.array() == b.array()).all(); +} + // just test a 4x4 matrix, enumerate all combination manually template <typename MatType> void reshape4x4(MatType m) @@ -75,6 +82,7 @@ void reshape4x4(MatType m) VERIFY_IS_EQUAL( m28r1, m28r2); using placeholders::all; + VERIFY(is_same_eq(m.reshaped(fix<MatType::SizeAtCompileTime>(m.size()),fix<1>), m(all))); VERIFY_IS_EQUAL(m.reshaped(16,1), m(all)); VERIFY_IS_EQUAL(m.reshaped(1,16), m(all).transpose()); VERIFY_IS_EQUAL(m(all).reshaped(2,8), m.reshaped(2,8)); |