Imported Upstream version 2.81
[platform/upstream/libbullet.git] / UnitTests / BulletUnitTests / TestCholeskyDecomposition.h
1 #ifndef TESTCHOLESKYDECOMPOSITION_H
2 #define TESTCHOLESKYDECOMPOSITION_H
3
4 #include <cppunit/TestFixture.h>
5 #include <cppunit/extensions/HelperMacros.h>
6 #include <LinearMath/btMatrix3x3.h>
7
8 class TestCholeskyDecomposition : public CppUnit::TestFixture
9 {
10   public:
11
12     void setUp() 
13     {
14       I.setIdentity();
15     }
16
17     void tearDown() 
18     {
19     }
20
21     void testZeroMatrix();
22     void testIdentityMatrix();
23     void testPositiveDefiniteMatrix();
24     void testPositiveSemiDefiniteMatrix();
25     void testNegativeDefiniteMatrix();
26
27     CPPUNIT_TEST_SUITE(TestCholeskyDecomposition);
28     CPPUNIT_TEST(testZeroMatrix);
29     CPPUNIT_TEST(testIdentityMatrix);
30     CPPUNIT_TEST(testPositiveDefiniteMatrix);
31     CPPUNIT_TEST(testPositiveSemiDefiniteMatrix);
32     CPPUNIT_TEST(testNegativeDefiniteMatrix);
33     CPPUNIT_TEST_SUITE_END();
34
35   private:
36     /**
37      * Returns TRUE if the specified matrices are equal and FALSE otherwise.
38      *
39      * @param A - the first matrix to be tested.
40      * @param B - the second matrix to be tested.
41      *
42      * @return a boolean indicating whether the specified matrix is symmetric.
43      */
44     bool equal(const btMatrix3x3& A, const btMatrix3x3& B) const;
45
46   private:
47     btMatrix3x3 L;
48     btMatrix3x3 I;
49 };
50
51 #endif // TESTCHOLESKYDECOMPOSITION_H
52