15#include <TMatrixDSym.h>
17#include <gtest/gtest.h>
19TEST(TrackFindingCDCTest, root_TMatrixD)
21 TMatrixD jacobian(2, 2);
29 TMatrixD covariance(2, 2);
38 left.Mult(jacobian, covariance);
40 TMatrixD result(2, 2);
41 result.MultT(left, jacobian);
43 EXPECT_EQ(0, result(0, 0));
44 EXPECT_EQ(-1, result(0, 1));
45 EXPECT_EQ(-1, result(1, 0));
46 EXPECT_EQ(1, result(1, 1));
50TEST(TrackFindingCDCTest, root_TMatrixDSym_Similarity_differing_rows_columns)
61 EXPECT_EQ(2, cov2.GetNrows());
62 EXPECT_EQ(2, cov2.GetNcols());
65 TMatrixD jacobianInflate(3, 2);
66 jacobianInflate.Zero();
68 jacobianInflate(0, 0) = 1;
69 jacobianInflate(1, 1) = 1;
70 jacobianInflate(2, 0) = 1;
71 jacobianInflate(2, 1) = 1;
74 cov2.Similarity(jacobianInflate);
76 EXPECT_EQ(3, cov2.GetNrows());
77 EXPECT_EQ(3, cov2.GetNcols());
79 EXPECT_EQ(1, cov2(0, 0));
80 EXPECT_EQ(0, cov2(0, 1));
81 EXPECT_EQ(1, cov2(0, 2));
83 EXPECT_EQ(0, cov2(1, 0));
84 EXPECT_EQ(1, cov2(1, 1));
85 EXPECT_EQ(1, cov2(1, 2));
87 EXPECT_EQ(1, cov2(2, 0));
88 EXPECT_EQ(1, cov2(2, 1));
89 EXPECT_EQ(2, cov2(2, 2));