From 3264d3c761e6b08101e7577b4278119dea42ec09 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 6 Jan 2017 21:53:32 +0100 Subject: Add support for plain-array as indices, e.g., mat({1,2,3,4}) --- 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 bc69adf13..4ab1a5251 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -93,6 +93,7 @@ void check_indexed_view() "600 601 602 603 604 605 606 607 608 609\n" "500 501 502 503 504 505 506 507 508 509") ); + // takes the row numer 3, and repeat it 5 times VERIFY( MATCH( A(span(3,5,0), all), "300 301 302 303 304 305 306 307 308 309\n" @@ -138,10 +139,17 @@ void check_indexed_view() VERIFY_IS_EQUAL( (A(eii, eii)).InnerStrideAtCompileTime, 0); VERIFY_IS_EQUAL( (A(eii, eii)).OuterStrideAtCompileTime, 0); + + #if EIGEN_HAS_CXX11 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(span(1,3,2), span(9,4,-3)) ); + +#if (!EIGEN_COMP_CLANG) || (EIGEN_COMP_CLANG>=308 && !defined(__apple_build_version__)) + VERIFY_IS_APPROX( A({3, 1, 6, 5}, all), A(std::array{{3, 1, 6, 5}}, all) ); +#endif + #endif } -- cgit v1.2.3