mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Propagate compile-time size with "all" and add c++11 array unit test
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user