MCPcopy Create free account
hub / github.com/PX4/eigen / data_and_stride

Function data_and_stride

test/block.cpp:235–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233
234template<typename MatrixType>
235void 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
255void test_block()
256{

Callers 1

test_blockFunction · 0.85

Calls 6

rowsMethod · 0.45
colsMethod · 0.45
transposeMethod · 0.45
rowMethod · 0.45
colMethod · 0.45

Tested by 1

test_blockFunction · 0.68