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

Function test_sparse_block

test/sparse_block.cpp:291–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291void test_sparse_block()
292{
293 for(int i = 0; i < g_repeat; i++) {
294 int r = Eigen::internal::random<int>(1,200), c = Eigen::internal::random<int>(1,200);
295 if(Eigen::internal::random<int>(0,4) == 0) {
296 r = c; // check square matrices in 25% of tries
297 }
298 EIGEN_UNUSED_VARIABLE(r+c);
299 CALL_SUBTEST_1(( sparse_block(SparseMatrix<double>(1, 1)) ));
300 CALL_SUBTEST_1(( sparse_block(SparseMatrix<double>(8, 8)) ));
301 CALL_SUBTEST_1(( sparse_block(SparseMatrix<double>(r, c)) ));
302 CALL_SUBTEST_2(( sparse_block(SparseMatrix<std::complex<double>, ColMajor>(r, c)) ));
303 CALL_SUBTEST_2(( sparse_block(SparseMatrix<std::complex<double>, RowMajor>(r, c)) ));
304
305 CALL_SUBTEST_3(( sparse_block(SparseMatrix<double,ColMajor,long int>(r, c)) ));
306 CALL_SUBTEST_3(( sparse_block(SparseMatrix<double,RowMajor,long int>(r, c)) ));
307
308 r = Eigen::internal::random<int>(1,100);
309 c = Eigen::internal::random<int>(1,100);
310 if(Eigen::internal::random<int>(0,4) == 0) {
311 r = c; // check square matrices in 25% of tries
312 }
313
314 CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,ColMajor,short int>(short(r), short(c))) ));
315 CALL_SUBTEST_4(( sparse_block(SparseMatrix<double,RowMajor,short int>(short(r), short(c))) ));
316 }
317}

Callers

nothing calls this directly

Calls 1

sparse_blockFunction · 0.85

Tested by

no test coverage detected