Belle II Software development
DecorrelationMatrixTest Class Reference

Test Class. More...

Inheritance diagram for DecorrelationMatrixTest:

Protected Member Functions

virtual void SetUp ()
 Fills the data into the internal data structure that is used for testing.
 

Protected Attributes

std::array< std::vector< double >, 3 > m_testData
 data that is used in the tests
 
TestMatrix m_covMatrix
 covariance matrix of the data as calculated via MATLAB
 
TestMatrix m_identity = TestMatrix::Identity()
 provide the identity matrix as class-member since it is used in many testcases
 

Detailed Description

Test Class.

Definition at line 70 of file decorrelationMatrix.cc.

Member Function Documentation

◆ SetUp()

virtual void SetUp ( )
inlineprotectedvirtual

Fills the data into the internal data structure that is used for testing.

NOTE: data created with MATLAB and imported here hardcoded

Definition at line 77 of file decorrelationMatrix.cc.

78 {
79 m_testData = {{v1, v2, v3}};
80
81 TestMatrix tmpMatrix;
82 // cpp check does not like commas
83 tmpMatrix << 3.132492133948475, 0.974827954209597, -0.761264020048923,
84 0.974827954209597, 1.486186070946439, -0.840189849104485,
85 // cppcheck-suppress constStatement
86 -0.761264020048923, -0.840189849104485, 0.739017883637750;
87
88 // MATLAB calculates the empirical covariance matrix with a prefactor (n-1)^-1, but we do with a prefactor of n^-1 so this has
89 // to be corrected (n=3 in the test cases)
90 m_covMatrix = (double)(v3.size() - 1) / (double)v3.size() * tmpMatrix;
91 }
TestMatrix m_covMatrix
covariance matrix of the data as calculated via MATLAB
std::array< std::vector< double >, 3 > m_testData
data that is used in the tests
const std::vector< double > v3
MATLAB generated random vector.
Eigen::Matrix< double, 3, 3, Eigen::RowMajor > TestMatrix
typedef for less typing effort
const std::vector< double > v2
MATLAB generated random vector.
const std::vector< double > v1
MATLAB generated random vector.

Member Data Documentation

◆ m_covMatrix

TestMatrix m_covMatrix
protected

covariance matrix of the data as calculated via MATLAB

Definition at line 97 of file decorrelationMatrix.cc.

◆ m_identity

TestMatrix m_identity = TestMatrix::Identity()
protected

provide the identity matrix as class-member since it is used in many testcases

Definition at line 100 of file decorrelationMatrix.cc.

◆ m_testData

std::array<std::vector<double>, 3> m_testData
protected

data that is used in the tests

Definition at line 94 of file decorrelationMatrix.cc.


The documentation for this class was generated from the following file: