diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-03 07:37:12 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-07-03 08:13:09 +0200 |
commit | 88534ba623421c956d8ffcda2d27f41d704d15ef (patch) | |
tree | fccc55245aec3f7381cd525a1355568e10ea37f4 /eigen/test/block.cpp | |
parent | 3ee09beb3f0458fbeb0b0e816f854b9d5b406e6b (diff) |
update eigen
Diffstat (limited to 'eigen/test/block.cpp')
-rw-r--r-- | eigen/test/block.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/eigen/test/block.cpp b/eigen/test/block.cpp index d610598..39565af 100644 --- a/eigen/test/block.cpp +++ b/eigen/test/block.cpp @@ -29,13 +29,6 @@ block_real_only(const MatrixType &, Index, Index, Index, Index, const Scalar&) { return Scalar(0); } -// Check at compile-time that T1==T2, and at runtime-time that a==b -template<typename T1,typename T2> -typename internal::enable_if<internal::is_same<T1,T2>::value,bool>::type -is_same_block(const T1& a, const T2& b) -{ - return a.isApprox(b); -} template<typename MatrixType> void block(const MatrixType& m) { @@ -94,9 +87,10 @@ template<typename MatrixType> void block(const MatrixType& m) m1.block(r1,c1,r2-r1+1,c2-c1+1) = s1 * m2.block(0, 0, r2-r1+1,c2-c1+1); m1.block(r1,c1,r2-r1+1,c2-c1+1)(r2-r1,c2-c1) = m2.block(0, 0, r2-r1+1,c2-c1+1)(0,0); - const Index BlockRows = 2; - const Index BlockCols = 5; - + enum { + BlockRows = 2, + BlockCols = 5 + }; if (rows>=5 && cols>=8) { // test fixed block() as lvalue @@ -112,11 +106,6 @@ template<typename MatrixType> void block(const MatrixType& m) m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols)(0,3) = m1.template block<2,5>(1,1)(1,2); Matrix<Scalar,Dynamic,Dynamic> b2 = m1.template block<Dynamic,BlockCols>(3,3,2,5); VERIFY_IS_EQUAL(b2, m1.block(3,3,BlockRows,BlockCols)); - - VERIFY(is_same_block(m1.block(3,3,BlockRows,BlockCols), m1.block(3,3,fix<Dynamic>(BlockRows),fix<Dynamic>(BlockCols)))); - VERIFY(is_same_block(m1.template block<BlockRows,Dynamic>(1,1,BlockRows,BlockCols), m1.block(1,1,fix<BlockRows>,BlockCols))); - VERIFY(is_same_block(m1.template block<BlockRows,BlockCols>(1,1,BlockRows,BlockCols), m1.block(1,1,fix<BlockRows>(),fix<BlockCols>))); - VERIFY(is_same_block(m1.template block<BlockRows,BlockCols>(1,1,BlockRows,BlockCols), m1.block(1,1,fix<BlockRows>,fix<BlockCols>(BlockCols)))); } if (rows>2) |