| 55 |
|
CPPUNIT_ASSERT(SMat3x3::identity() == identMat); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
– |
void SquareMatrixTestCase::testInverse() { |
| 58 |
|
|
| 59 |
< |
} |
| 59 |
> |
void SquareMatrixTestCase::testJacobi() { |
| 60 |
> |
SMat3x3 a; |
| 61 |
> |
Vector<double, 3> w1L; |
| 62 |
> |
Vector<double, 3> w1R; |
| 63 |
> |
SMat3x3 v; |
| 64 |
> |
a(0, 0) = 3.0; |
| 65 |
> |
a(0, 1) = 4.0; |
| 66 |
> |
a(0, 2) = 5.0; |
| 67 |
> |
a(1, 0) = 4.0; |
| 68 |
> |
a(1, 1) = 5.0; |
| 69 |
> |
a(1, 2) = 6.0; |
| 70 |
> |
a(2, 0) = 5.0; |
| 71 |
> |
a(2, 1) = 6.0; |
| 72 |
> |
a(2, 2) = 7.0; |
| 73 |
|
|
| 74 |
< |
void SquareMatrixTestCase::testDeterminant() { |
| 74 |
> |
w1R[0] = 15.3899; |
| 75 |
> |
w1R[1] = 0.0; |
| 76 |
> |
w1R[2] = -0.389867; |
| 77 |
> |
|
| 78 |
> |
SMat3x3::jacobi(a, w1L, v); |
| 79 |
|
|
| 80 |
+ |
CPPUNIT_ASSERT_DOUBLES_EQUAL(w1L[0], w1R[0], 0.0001); |
| 81 |
+ |
CPPUNIT_ASSERT_DOUBLES_EQUAL(w1L[1], w1R[1], OpenMD::NumericConstant::epsilon); |
| 82 |
+ |
CPPUNIT_ASSERT_DOUBLES_EQUAL(w1L[2], w1R[2], OpenMD::NumericConstant::epsilon); |
| 83 |
+ |
|
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
void SquareMatrixTestCase::testTrace() { |
| 87 |
< |
CPPUNIT_ASSERT_DOUBLES_EQUAL(identMat.trace(), 3.0, oopse::epsilon); |
| 88 |
< |
CPPUNIT_ASSERT_DOUBLES_EQUAL(symMat.trace(), 4.0, oopse::epsilon); |
| 87 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(identMat.trace(), 3.0, OpenMD::NumericConstant::epsilon); |
| 88 |
> |
CPPUNIT_ASSERT_DOUBLES_EQUAL(symMat.trace(), 4.0, OpenMD::NumericConstant::epsilon); |
| 89 |
|
} |
| 90 |
|
void SquareMatrixTestCase::testIsSymmertric(){ |
| 91 |
|
CPPUNIT_ASSERT(identMat.isSymmetric()); |