aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/indexed_view.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2018-07-23 16:20:25 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2018-07-23 16:20:25 +0200
commitc747cde69a9ab286984a09223c3f477b782a6617 (patch)
tree570a6a08bd400a4511a1e1d63de32fb1663b72d7 /test/indexed_view.cpp
parent2bf864f1eb1b2497d28747c7f77ec3e2f1e8d9d2 (diff)
Add lastN shorcuts to seq/seqN.
Diffstat (limited to 'test/indexed_view.cpp')
-rw-r--r--test/indexed_view.cpp8
1 files changed, 8 insertions, 0 deletions
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<int,4>{{1,3,2,4}})).ColsAtCompileTime == 4);
VERIFY_IS_APPROX( (A(std::array<int,3>{{1,3,5}}, std::array<int,4>{{9,6,3,0}})), A(seqN(1,3,2), seqN(9,4,-3)) );