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

Function test_array

test/array.cpp:454–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454void test_array()
455{
456 for(int i = 0; i < g_repeat; i++) {
457 CALL_SUBTEST_1( array(Array<float, 1, 1>()) );
458 CALL_SUBTEST_2( array(Array22f()) );
459 CALL_SUBTEST_3( array(Array44d()) );
460 CALL_SUBTEST_4( array(ArrayXXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
461 CALL_SUBTEST_5( array(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
462 CALL_SUBTEST_6( array(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
463 }
464 for(int i = 0; i < g_repeat; i++) {
465 CALL_SUBTEST_1( comparisons(Array<float, 1, 1>()) );
466 CALL_SUBTEST_2( comparisons(Array22f()) );
467 CALL_SUBTEST_3( comparisons(Array44d()) );
468 CALL_SUBTEST_5( comparisons(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
469 CALL_SUBTEST_6( comparisons(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
470 }
471 for(int i = 0; i < g_repeat; i++) {
472 CALL_SUBTEST_1( min_max(Array<float, 1, 1>()) );
473 CALL_SUBTEST_2( min_max(Array22f()) );
474 CALL_SUBTEST_3( min_max(Array44d()) );
475 CALL_SUBTEST_5( min_max(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
476 CALL_SUBTEST_6( min_max(ArrayXXi(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
477 }
478 for(int i = 0; i < g_repeat; i++) {
479 CALL_SUBTEST_1( array_real(Array<float, 1, 1>()) );
480 CALL_SUBTEST_2( array_real(Array22f()) );
481 CALL_SUBTEST_3( array_real(Array44d()) );
482 CALL_SUBTEST_5( array_real(ArrayXXf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
483 }
484 for(int i = 0; i < g_repeat; i++) {
485 CALL_SUBTEST_4( array_complex(ArrayXXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
486 }
487
488 VERIFY((internal::is_same< internal::global_math_functions_filtering_base<int>::type, int >::value));
489 VERIFY((internal::is_same< internal::global_math_functions_filtering_base<float>::type, float >::value));
490 VERIFY((internal::is_same< internal::global_math_functions_filtering_base<Array2i>::type, ArrayBase<Array2i> >::value));
491 typedef CwiseUnaryOp<internal::scalar_abs_op<double>, ArrayXd > Xpr;
492 VERIFY((internal::is_same< internal::global_math_functions_filtering_base<Xpr>::type,
493 ArrayBase<Xpr>
494 >::value));
495}

Callers

nothing calls this directly

Calls 5

min_maxFunction · 0.85
array_realFunction · 0.85
array_complexFunction · 0.85
arrayFunction · 0.70
comparisonsFunction · 0.70

Tested by

no test coverage detected