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

Function test_linearstructure

test/linearstructure.cpp:114–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void test_linearstructure()
115{
116 g_called = true;
117 VERIFY(g_called); // avoid `unneeded-internal-declaration` warning.
118 for(int i = 0; i < g_repeat; i++) {
119 CALL_SUBTEST_1( linearStructure(Matrix<float, 1, 1>()) );
120 CALL_SUBTEST_2( linearStructure(Matrix2f()) );
121 CALL_SUBTEST_3( linearStructure(Vector3d()) );
122 CALL_SUBTEST_4( linearStructure(Matrix4d()) );
123 CALL_SUBTEST_5( linearStructure(MatrixXcf(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
124 CALL_SUBTEST_6( linearStructure(MatrixXf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
125 CALL_SUBTEST_7( linearStructure(MatrixXi (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
126 CALL_SUBTEST_8( linearStructure(MatrixXcd(internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2), internal::random<int>(1,EIGEN_TEST_MAX_SIZE/2))) );
127 CALL_SUBTEST_9( linearStructure(ArrayXXf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
128 CALL_SUBTEST_10( linearStructure(ArrayXXcf (internal::random<int>(1,EIGEN_TEST_MAX_SIZE), internal::random<int>(1,EIGEN_TEST_MAX_SIZE))) );
129
130 CALL_SUBTEST_11( real_complex<Matrix4cd>() );
131 CALL_SUBTEST_11( real_complex<MatrixXcf>(10,10) );
132 CALL_SUBTEST_11( real_complex<ArrayXXcf>(10,10) );
133 }
134
135#ifdef EIGEN_TEST_PART_4
136 {
137 // make sure that /=scalar and /scalar do not overflow
138 // rational: 1.0/4.94e-320 overflow, but m/4.94e-320 should not
139 Matrix4d m2, m3;
140 m3 = m2 = Matrix4d::Random()*1e-20;
141 m2 = m2 / 4.9e-320;
142 VERIFY_IS_APPROX(m2.cwiseQuotient(m2), Matrix4d::Ones());
143 m3 /= 4.9e-320;
144 VERIFY_IS_APPROX(m3.cwiseQuotient(m3), Matrix4d::Ones());
145
146
147 }
148#endif
149}

Callers

nothing calls this directly

Calls 1

linearStructureFunction · 0.85

Tested by

no test coverage detected