MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Definition at line 57 of file Matrix3DTest.cpp.
Matrix3DTest::Matrix3DTest | ( | ) | [inline] |
Definition at line 145 of file Matrix3DTest.cpp.
{}
Matrix3DTest::CPPUNIT_TEST | ( | test_equal | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_plus | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_minus | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_Frobenius_2 | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_transpose | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_plus_equal | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_times_equal_scalar | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_times_scalar | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_plus_transpose | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_plus_transpose_equal | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_outer_product | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_fill_lower_triangle | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_times | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_mult_element | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_times_vector | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_vector_times | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_det | ) | [private] |
Matrix3DTest::CPPUNIT_TEST | ( | test_B_times_invA | ) | [private] |
Matrix3DTest::CPPUNIT_TEST_SUITE | ( | Matrix3DTest | ) | [private] |
Matrix3DTest::CPPUNIT_TEST_SUITE_END | ( | ) | [private] |
void Matrix3DTest::setUp | ( | ) | [inline] |
Definition at line 96 of file Matrix3DTest.cpp.
{ // sets up the unit vectors e1.set( 1, 0, 0 ); e2.set( 0, 1, 0 ); e3.set( 0, 0, 1 ); mIdentity = " 1 0 0 " " 0 1 0 " " 0 0 1"; mMat1 = " 1 4.2 2 " " 5.2 3 4 " " 1 7 0.4"; mMat1sym = " 1 4.2 2 " " 4.2 3 4 " " 2 4 0.4"; mMat2 = " 2 4 5 " " 2 1 3 " " 0 7 8 "; mMat2trans = " 2 2 0 " " 4 1 7 " " 5 3 8 "; mMat1plus2 = " 3 8.2 7 " " 7.2 4 7 " " 1 14 8.4"; mMat1plus2trans = " 3 6.2 2 " " 9.2 4 11 " " 6 10 8.4"; mMat1times2 = " 10.4 22.2 33.6 " " 16.4 51.8 67.0 " " 16.0 13.8 29.2 "; mMat1times2inv = " 2.519141 0.088216 -0.977863 " " 1.009487 0.304594 -0.593375 " " 5.838881 -0.699068 -2.203728 "; tolEps = 1e-12; }
void Matrix3DTest::tearDown | ( | ) | [inline] |
Definition at line 142 of file Matrix3DTest.cpp.
{}
void Matrix3DTest::test_B_times_invA | ( | ) | [inline] |
Definition at line 290 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, and MBMesquite::timesInvA().
{ Matrix3D orig1( mMat1 ); timesInvA( mMat2, mMat1 ); // Checks mMat1 is unchanged CPPUNIT_ASSERT( mMat1 == orig1 ); // Checks mMat2 now contains the correct result for( int i = 0; i < 3; ++i ) for( int j = 0; j < 3; ++j ) CPPUNIT_ASSERT_DOUBLES_EQUAL( mMat2[i][j], mMat1times2inv[i][j], 0.0001 ); }
void Matrix3DTest::test_det | ( | ) | [inline] |
Definition at line 284 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT_DOUBLES_EQUAL, and MBMesquite::det().
{ double d = det( mMat1 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 48.064, d, tolEps ); }
void Matrix3DTest::test_equal | ( | ) | [inline] |
Definition at line 147 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ CPPUNIT_ASSERT( mMat1 == mMat1 ); CPPUNIT_ASSERT( mMat1 != mMat2 ); }
void Matrix3DTest::test_fill_lower_triangle | ( | ) | [inline] |
Definition at line 232 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ mMat1.fill_lower_triangle(); CPPUNIT_ASSERT( mMat1 == mMat1sym ); }
void Matrix3DTest::test_Frobenius_2 | ( | ) | [inline] |
Definition at line 170 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT_DOUBLES_EQUAL, and MBMesquite::Frobenius_2().
{ double fro = Frobenius_2( mMat1 ); CPPUNIT_ASSERT_DOUBLES_EQUAL( 124.84, fro, tolEps ); }
void Matrix3DTest::test_minus | ( | ) | [inline] |
Definition at line 160 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ Matrix3D res; res = mMat1 - mIdentity; Matrix3D correct( " 0 4.2 2 " " 5.2 2 4 " " 1 7 -0.6 " ); CPPUNIT_ASSERT( res == correct ); }
void Matrix3DTest::test_mult_element | ( | ) | [inline] |
Definition at line 247 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, and MBMesquite::mult_element().
{ Matrix3D mat = mult_element( mMat1, mIdentity ); Matrix3D correct( " 1 0 0 " " 0 3 0 " " 0 0 0.4" ); CPPUNIT_ASSERT( mat == correct ); }
void Matrix3DTest::test_outer_product | ( | ) | [inline] |
Definition at line 219 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, and MBMesquite::Matrix3D::outer_product().
{ Matrix3D mat; Vector3D vec1( 2, 7, 3 ); Vector3D vec2( 5, 8, 9 ); mat.outer_product( vec1, vec2 ); Matrix3D correct( " 10 16 18 " " 35 56 63 " " 15 24 27 " ); CPPUNIT_ASSERT( mat == correct ); }
void Matrix3DTest::test_plus | ( | ) | [inline] |
Definition at line 153 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, and moab::sum().
{ Matrix3D sum; sum = mMat1 + mMat2; CPPUNIT_ASSERT( sum == mMat1plus2 ); }
void Matrix3DTest::test_plus_equal | ( | ) | [inline] |
Definition at line 182 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ mMat1 += mMat2; CPPUNIT_ASSERT( mMat1 == mMat1plus2 ); }
void Matrix3DTest::test_plus_transpose | ( | ) | [inline] |
Definition at line 207 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, and MBMesquite::plus_transpose().
{ Matrix3D plus_trans = plus_transpose( mMat1, mMat2 ); CPPUNIT_ASSERT( plus_trans == mMat1plus2trans ); }
void Matrix3DTest::test_plus_transpose_equal | ( | ) | [inline] |
Definition at line 213 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ mMat1.plus_transpose_equal( mMat2 ); CPPUNIT_ASSERT( mMat1 == mMat1plus2trans ); }
void Matrix3DTest::test_times | ( | ) | [inline] |
Definition at line 238 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ Matrix3D mult = mMat1 * mMat2; CPPUNIT_ASSERT( mult == mMat1times2 ); mult = mMat1 * mIdentity; CPPUNIT_ASSERT( mult == mMat1 ); }
void Matrix3DTest::test_times_equal_scalar | ( | ) | [inline] |
Definition at line 188 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ mMat2 *= 3; Matrix3D correct( " 6 12 15 " " 6 3 9 " " 0 21 24 " ); CPPUNIT_ASSERT( mMat2 == correct ); }
void Matrix3DTest::test_times_scalar | ( | ) | [inline] |
Definition at line 196 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT.
{ Matrix3D tmp = mMat2 * 3; Matrix3D correct( " 6 12 15 " " 6 3 9 " " 0 21 24 " ); CPPUNIT_ASSERT( tmp == correct ); tmp[0][0] = 0; tmp = 3 * mMat2; CPPUNIT_ASSERT( tmp == correct ); }
void Matrix3DTest::test_times_vector | ( | ) | [inline] |
Definition at line 256 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, and MBMesquite::Vector3D::set().
{ Vector3D vec = mMat1 * e1; Vector3D correct( 1, 5.2, 1 ); CPPUNIT_ASSERT( vec == correct ); Vector3D vec_2( 3., 2., 5. ); Vector3D vec_12 = mMat1 * vec_2; correct.set( 21.4, 41.6, 19. ); CPPUNIT_ASSERT( vec_12 == correct ); }
void Matrix3DTest::test_transpose | ( | ) | [inline] |
Definition at line 176 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, and MBMesquite::transpose().
{ Matrix3D trans = transpose( mMat2 ); CPPUNIT_ASSERT( trans == mMat2trans ); }
void Matrix3DTest::test_vector_times | ( | ) | [inline] |
Definition at line 268 of file Matrix3DTest.cpp.
References CPPUNIT_ASSERT, CPPUNIT_ASSERT_DOUBLES_EQUAL, and MBMesquite::Vector3D::set().
{ Vector3D vec = e1 * mMat1; Vector3D correct( 1, 4.2, 2 ); CPPUNIT_ASSERT( vec == correct ); Vector3D vec2( 2.1, 3, 8 ); vec = vec2 * mMat1; correct.set( 25.7, 73.82, 19.4 ); int loop_i = 0; for( loop_i = 0; loop_i < 3; ++loop_i ) { CPPUNIT_ASSERT_DOUBLES_EQUAL( vec[loop_i], correct[loop_i], tolEps ); } }
Vector3D Matrix3DTest::e1 [private] |
Definition at line 83 of file Matrix3DTest.cpp.
Vector3D Matrix3DTest::e2 [private] |
Definition at line 83 of file Matrix3DTest.cpp.
Vector3D Matrix3DTest::e3 [private] |
Definition at line 83 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mIdentity [private] |
Definition at line 84 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat1 [private] |
Definition at line 85 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat1plus2 [private] |
Definition at line 89 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat1plus2trans [private] |
Definition at line 90 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat1sym [private] |
Definition at line 86 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat1times2 [private] |
Definition at line 91 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat1times2inv [private] |
Definition at line 92 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat2 [private] |
Definition at line 87 of file Matrix3DTest.cpp.
Matrix3D Matrix3DTest::mMat2trans [private] |
Definition at line 88 of file Matrix3DTest.cpp.
double Matrix3DTest::tolEps [private] |
Definition at line 93 of file Matrix3DTest.cpp.