| 233 | |
| 234 | template<typename MatrixType> |
| 235 | void data_and_stride(const MatrixType& m) |
| 236 | { |
| 237 | typedef typename MatrixType::Index Index; |
| 238 | Index rows = m.rows(); |
| 239 | Index cols = m.cols(); |
| 240 | |
| 241 | Index r1 = internal::random<Index>(0,rows-1); |
| 242 | Index r2 = internal::random<Index>(r1,rows-1); |
| 243 | Index c1 = internal::random<Index>(0,cols-1); |
| 244 | Index c2 = internal::random<Index>(c1,cols-1); |
| 245 | |
| 246 | MatrixType m1 = MatrixType::Random(rows, cols); |
| 247 | compare_using_data_and_stride(m1.block(r1, c1, r2-r1+1, c2-c1+1)); |
| 248 | compare_using_data_and_stride(m1.transpose().block(c1, r1, c2-c1+1, r2-r1+1)); |
| 249 | compare_using_data_and_stride(m1.row(r1)); |
| 250 | compare_using_data_and_stride(m1.col(c1)); |
| 251 | compare_using_data_and_stride(m1.row(r1).transpose()); |
| 252 | compare_using_data_and_stride(m1.col(c1).transpose()); |
| 253 | } |
| 254 | |
| 255 | void test_block() |
| 256 | { |