diff options
author | Gael Guennebaud <g.gael@free.fr> | 2017-01-16 22:21:23 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2017-01-16 22:21:23 +0100 |
commit | 4989922be2708378b2438db5a843640ec468ce4c (patch) | |
tree | 19f81b7439f227edde89cd38fccffd94fbc1d3af /test/indexed_view.cpp | |
parent | 12e22a2844d060cfbeab7a48512046ee59709e53 (diff) |
Add support for symbolic expressions as arguments of operator()
Diffstat (limited to 'test/indexed_view.cpp')
-rw-r--r-- | test/indexed_view.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 472268010..88211f05e 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -211,6 +211,12 @@ void check_indexed_view() VERIFY_IS_APPROX( A(seq(1,n-1-2), seq(n-1-5,7)), A(seq(1,last-2), seq(last-5,7)) ); VERIFY_IS_APPROX( A(seq(n-1-5,n-1-2), seq(n-1-5,n-1-2)), A(seq(last-5,last-2), seq(last-5,last-2)) ); + VERIFY_IS_APPROX( A.col(A.cols()-1), A(all,last) ); + VERIFY_IS_APPROX( A(A.rows()-2, A.cols()/2), A(last-1, end/2) ); + VERIFY_IS_APPROX( a(a.size()-2), a(last-1) ); + VERIFY_IS_APPROX( a(a.size()/2), a((last+1)/2) ); + + // Check fall-back to Block { VERIFY( is_same_type(A.col(0), A(all,0)) ); @@ -219,6 +225,8 @@ void check_indexed_view() VERIFY( is_same_type(A.middleRows(2,4), A(seqN(2,4),all)) ); VERIFY( is_same_type(A.middleCols(2,4), A(all,seqN(2,4))) ); + VERIFY( is_same_type(A.col(A.cols()-1), A(all,last)) ); + const ArrayXXi& cA(A); VERIFY( is_same_type(cA.col(0), cA(all,0)) ); VERIFY( is_same_type(cA.row(0), cA(0,all)) ); |