--- trunk/test/math/SquareMatrixTestCase.cpp 2004/10/15 15:19:28 78 +++ trunk/test/math/SquareMatrixTestCase.cpp 2009/11/25 20:02:06 1390 @@ -55,17 +55,37 @@ void SquareMatrixTestCase::testIdentity() { CPPUNIT_ASSERT(SMat3x3::identity() == identMat); } -void SquareMatrixTestCase::testInverse() { -} +void SquareMatrixTestCase::testJacobi() { + SMat3x3 a; + Vector w1L; + Vector w1R; + SMat3x3 v; + a(0, 0) = 3.0; + a(0, 1) = 4.0; + a(0, 2) = 5.0; + a(1, 0) = 4.0; + a(1, 1) = 5.0; + a(1, 2) = 6.0; + a(2, 0) = 5.0; + a(2, 1) = 6.0; + a(2, 2) = 7.0; -void SquareMatrixTestCase::testDeterminant() { + w1R[0] = 15.3899; + w1R[1] = 0.0; + w1R[2] = -0.389867; + + SMat3x3::jacobi(a, w1L, v); + CPPUNIT_ASSERT_DOUBLES_EQUAL(w1L[0], w1R[0], 0.0001); + CPPUNIT_ASSERT_DOUBLES_EQUAL(w1L[1], w1R[1], OpenMD::NumericConstant::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(w1L[2], w1R[2], OpenMD::NumericConstant::epsilon); + } void SquareMatrixTestCase::testTrace() { - CPPUNIT_ASSERT_DOUBLES_EQUAL(identMat.trace(), 3.0, oopse::epsilon); - CPPUNIT_ASSERT_DOUBLES_EQUAL(symMat.trace(), 4.0, oopse::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(identMat.trace(), 3.0, OpenMD::NumericConstant::epsilon); + CPPUNIT_ASSERT_DOUBLES_EQUAL(symMat.trace(), 4.0, OpenMD::NumericConstant::epsilon); } void SquareMatrixTestCase::testIsSymmertric(){ CPPUNIT_ASSERT(identMat.isSymmetric());