diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-01-06 13:29:33 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-01-06 13:29:33 +0100 |
commit | fad1fa75b32ccd3a19fc783a0c660ca512283224 (patch) | |
tree | c090caa5dce7bb8e41b4be9ea4c1c13a74316e4d /test/indexed_view.cpp | |
parent | 3730e3ca9ec8e256b76c08fb4b1e928c62f37b40 (diff) |
Propagate compile-time size with "all" and add c++11 array unit test
Diffstat (limited to 'test/indexed_view.cpp')
-rw-r--r-- | test/indexed_view.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 0be5e434c..5d8ce16ee 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -11,6 +11,10 @@ #include <vector> #include "main.h" +#if EIGEN_HAS_CXX11 +#include <array> +#endif + typedef std::pair<Index,Index> IndexPair; int encode(Index i, Index j) { @@ -108,6 +112,13 @@ void check_indexed_view() VERIFY( (B(all,1)).ColsAtCompileTime == 1); VERIFY( (B(all,1)).RowsAtCompileTime == 4); + VERIFY( (A(all, eii)).ColsAtCompileTime == eii.SizeAtCompileTime); +#if EIGEN_HAS_CXX11 + 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(span(1,3,2), span(9,4,-3)) ); +#endif + } void test_indexed_view() |