Home | History | Annotate | Download | only in test

Lines Matching refs:block

13 template<typename MatrixType> void block(const MatrixType& m)
46 // check nested block xpr on lhs
55 //check block()
58 RowVectorType br1(m1.block(r1,0,1,cols));
59 VectorType bc1(m1.block(0,c1,rows,1));
60 VERIFY_IS_EQUAL(b1, m1.block(r1,c1,1,1));
63 //check operator(), both constant and non-constant, on block()
64 m1.block(r1,c1,r2-r1+1,c2-c1+1) = s1 * m2.block(0, 0, r2-r1+1,c2-c1+1);
65 m1.block(r1,c1,r2-r1+1,c2-c1+1)(r2-r1,c2-c1) = m2.block(0, 0, r2-r1+1,c2-c1+1)(0,0);
73 // test fixed block() as lvalue
74 m1.template block<BlockRows,BlockCols>(1,1) *= s1;
75 // test operator() on fixed block() both as constant and non-constant
76 m1.template block<BlockRows,BlockCols>(1,1)(0, 3) = m1.template block<2,5>(1,1)(1,2);
77 // check that fixed block() and block() agree
78 Matrix<Scalar,Dynamic,Dynamic> b = m1.template block<BlockRows,BlockCols>(3,3);
79 VERIFY_IS_EQUAL(b, m1.block(3,3,BlockRows,BlockCols));
85 VERIFY_IS_EQUAL(v1.template head<2>(), v1.block(0,0,2,1));
90 VERIFY_IS_EQUAL(v1.template tail<2>(), v1.block(i,0,2,1));
98 // stress some basic stuffs with block matrices
105 // now test some block-inside-of-block.
108 VERIFY_IS_EQUAL( (m1.block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2)) , (m1.block(r2,c2,rows-r2,cols-c2)) );
109 VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , (m1.row(r1).segment(c1,c2-c1+1)) );
110 VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).col(0)) , (m1.col(c1).segment(r1,r2-r1+1)) );
111 VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , (m1.row(r1).segment(c1,c2-c1+1)).transpose() );
112 VERIFY_IS_EQUAL( (m1.transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , (m1.row(r1).segment(c1,c2-c1+1)).transpose() );
115 VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2)) , ((m1+m2).block(r2,c2,rows-r2,cols-c2)) );
116 VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)) );
117 VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).col(0)) , ((m1+m2).col(c1).segment(r1,r2-r1+1)) );
118 VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)).transpose() );
119 VERIFY_IS_EQUAL( ((m1+m2).transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)).transpose() );
125 dm = m1.block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2);
126 VERIFY_IS_EQUAL(dm, (m1.block(r2,c2,rows-r2,cols-c2)));
129 dm = m1.block(r1,c1,r2-r1+1,c2-c1+1).row(0).transpose();
135 dv = m1.block(r1,c1,r2-r1+1,c2-c1+1).col(0);
139 dm = m1.block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0);
145 dv = m1.transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0);
197 compare_using_data_and_stride(m1.block(r1, c1, r2-r1+1, c2-c1+1));
198 compare_using_data_and_stride(m1.transpose().block(c1, r1, c2-c1+1, r2-r1+1));
208 CALL_SUBTEST_1( block(Matrix<float, 1, 1>()) );
209 CALL_SUBTEST_2( block(Matrix4d()) );
210 CALL_SUBTEST_3( block(MatrixXcf(3, 3)) );
211 CALL_SUBTEST_4( block(MatrixXi(8, 12)) );
212 CALL_SUBTEST_5( block(MatrixXcd(20, 20)) );
213 CALL_SUBTEST_6( block(MatrixXf(20, 20)) );
215 CALL_SUBTEST_8( block(Matrix<float,Dynamic,4>(3, 4)) );