Propagate compile-time size with "all" and add c++11 array unit test

This commit is contained in:
Gael Guennebaud
2017-01-06 13:29:33 +01:00
parent 3730e3ca9e
commit fad1fa75b3
3 changed files with 20 additions and 5 deletions

View File

@@ -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()