From c747cde69a9ab286984a09223c3f477b782a6617 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 23 Jul 2018 16:20:25 +0200 Subject: Add lastN shorcuts to seq/seqN. --- test/indexed_view.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/indexed_view.cpp') diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 4cc0954f7..7219c777f 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -293,6 +293,14 @@ void check_indexed_view() } #if EIGEN_HAS_CXX11 + // check lastN + VERIFY_IS_APPROX( a(lastN(3)), a.tail(3) ); + VERIFY( MATCH( a(lastN(3)), "7\n8\n9" ) ); + VERIFY_IS_APPROX( a(lastN(fix<3>())), a.tail<3>() ); + VERIFY( MATCH( a(lastN(3,2)), "5\n7\n9" ) ); + VERIFY( MATCH( a(lastN(3,fix<2>())), "5\n7\n9" ) ); + VERIFY( a(lastN(fix<3>())).SizeAtCompileTime == 3 ); + VERIFY( (A(all, std::array{{1,3,2,4}})).ColsAtCompileTime == 4); VERIFY_IS_APPROX( (A(std::array{{1,3,5}}, std::array{{9,6,3,0}})), A(seqN(1,3,2), seqN(9,4,-3)) ); -- cgit v1.2.3