diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-01-06 13:10:10 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-01-06 13:10:10 +0100 |
commit | 3730e3ca9ec8e256b76c08fb4b1e928c62f37b40 (patch) | |
tree | 6470f9f5666d933de11090b4d68427f24354744d /test/indexed_view.cpp | |
parent | 60e99ad8d76c167a48dab82d2fc16a87956fd7a4 (diff) |
Use "fix" for compile-time values, propagate compile-time sizes for span, clean some cleanup.
Diffstat (limited to 'test/indexed_view.cpp')
-rw-r--r-- | test/indexed_view.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 1bb2b4256..0be5e434c 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -13,8 +13,8 @@ typedef std::pair<Index,Index> IndexPair; -Index encode(Index i, Index j) { - return i*100 + j; +int encode(Index i, Index j) { + return int(i*100 + j); } IndexPair decode(Index ij) { @@ -97,6 +97,17 @@ void check_indexed_view() "300 301 302 303 304 305 306 307 308 309") ); + Array44i B; + VERIFY( (A(span(2,5), 5)).ColsAtCompileTime == 1); + VERIFY( (A(span(2,5), 5)).RowsAtCompileTime == Dynamic); + VERIFY( (A(span(2,fix<5>), 5)).RowsAtCompileTime == 5); + VERIFY( (A(4, all)).ColsAtCompileTime == Dynamic); + VERIFY( (A(4, all)).RowsAtCompileTime == 1); + VERIFY( (B(1, all)).ColsAtCompileTime == 4); + VERIFY( (B(1, all)).RowsAtCompileTime == 1); + VERIFY( (B(all,1)).ColsAtCompileTime == 1); + VERIFY( (B(all,1)).RowsAtCompileTime == 4); + } void test_indexed_view() |